查看服务器位数
getconf LONG_BIT
查看linux版本
uname -a
cat /etc/redhat-release
查看已安装软件(分rpm/deb/yum包安装的)
rpm -qa
dpkg -l
yum list installed
yum list installed | grep anaconda
环境变量
#显示环境变量HOME echo $HOME #设置新环境变量 export HELLO="Hello!" echo $HELLO #使用env命令显示所有的环境变量 env | grep TEST #使用set命令显示所有本地定义的 Shell 变量 #使用unset命令来清除环境变量 #set可以设置某个环境变量的值。清除环境变量的值用unset命令。如果未指定值,则该变量值将被设为 NULL unset $TEST #使用readonly命令设置只读变量 export TEST="Test..." #增加一个环境变量TEST readonly TEST #将环境变量TEST设为只读 unset TEST #会发现此变量不能被删除 -bash: unset: TEST: cannot unset: readonly variable TEST="New" #会发现此也变量不能被修改 -bash: TEST: readonly variable #环境变量的设置位于 /etc/profile【对所有用户生效(永久的)】和.bash_profile【对单一用户生效(永久的)】 #如果需要增加新的环境变量可以添加下属行 #vi /etc/profile export path=$path:/path1:/path2:/pahtN source /etc/profile #vim /home/guok/.bash_profile #guok用户的环境变量 export path=$path:/path1:/path2:/pahtN source /home/guok/.bash_profile
-bash: uname: command not found
#Debian apt-get install coreutils #Ubuntu apt-get install coreutils #Alpine apk add coreutils #Arch Linux pacman -S coreutils #Kali Linux apt-get install coreutils #CentOS yum install coreutils #Fedora dnf install coreutils #OS X brew install coreutils #Raspbian apt-get install coreutils #Docker docker run cmd.cat/uname uname
View Code
-bash: arch: command not found
#Debian apt-get install coreutils #Ubuntu apt-get install coreutils #Alpine apk add coreutils #Arch Linux pacman -S mailman #Kali Linux apt-get install coreutils #CentOS yum install coreutils #Fedora dnf install coreutils #OS X brew install coreutils #Raspbian apt-get install coreutils #Docker docker run cmd.cat/arch arch
View Code
-bash: uptime command not found
#Debian apt-get install procps #Ubuntu apt-get install procps #Alpine apk add procps #Arch Linux pacman -S procps-ng #Kali Linux apt-get install procps #CentOS yum install procps-ng #Fedora dnf install procps-ng #Raspbian apt-get install procps #Docker docker run cmd.cat/uptime uptime
View Code
原创文章,作者:Carrie001128,如若转载,请注明出处:https://blog.ytso.com/268100.html