linux 几个简单命令 20190518

查看系统基本信息

[root@abc ~]# uname -r
[root@abc ~]# ifconfig
[root@localhost ~]# man ls | wc -l
[root@localhost ~]# uname
[root@localhost ~]# uname -a
[root@localhost ~]# uname -r
[root@localhost ~]# hostname
[root@localhost ~]# hostname abc
[root@localhost ~]# hostname
[root@localhost ~]# ifconfig
[root@localhost ~]# ifconfig ens32
[root@localhost ~]# ifconfig ens32 192.168.147.128 netmask 255.255.255.0
[root@localhost ~]# route add default gw 192.168.147.1
[root@localhost ~]# df
[root@localhost ~]# df -h
[root@localhost ~]# free

目录和文件基本操作

[root@localhost ~]# cd /root
[root@localhost ~]# pwd
[root@localhost ~]# mkdir temp
[root@localhost ~]# cp /bin/a* /root/temp
[root@localhost ~]# ls /root/temp
[root@localhost ~]# cp /etc/httpd/ /root/temp
[root@localhost ~]# cp -r /etc/httpd/ /root/temp
[root@localhost ~]# ls temp/
[root@localhost ~]# cp -r /etc/httpd/* /root/temp
[root@localhost ~]# ls temp
[root@localhost ~]# ln -s /sbin/ifconfig /root/temp/ifconfig
[root@localhost ~]# ls /root/temp
[root@localhost ~]# ll temp
[root@localhost ~]# ln -s /sbin/ifconfig /root/temp/ifconfig
[root@localhost ~]# find / -name yum
[root@localhost ~]# which yum
[root@localhost ~]# cp /usr/bin/yum /root/temp
[root@localhost ~]# rm -rf temp

cat,more,less,head,tail,wc,grep使用

[root@abc ~]# cat /proc/cpuinfo
[root@abc ~]# cat /etc/passwd
[root@abc ~]# cat /etc/shadow
[root@abc ~]# cat /var/log/messages
[root@abc ~]# tail /etc/passwd
[root@abc ~]# head /etc/passwd
[root@abc ~]# head -12 /etc/passwd
[root@abc ~]# tail -20 /etc/passwd
[root@abc ~]# tail -f /etc/passwd
[root@abc ~]# cat anaconda-ks.cfg
[root@abc ~]# wc anaconda-ks.cfg -l
[root@abc ~]# more anaconda-ks.cfg
[root@abc ~]# less anaconda-ks.cfg
[root@abc ~]# wc /etc/passwd
[root@abc ~]# wc -l /etc/passwd
[root@abc ~]# grep 'root' /etc/passwd
[root@abc ~]# ps -ef
[root@abc ~]# ps -ef | grep ssh

打包解包过程。

[root@abc ~]# pwd
[root@abc ~]# mkdir temp
[root@abc ~]# cp /bin/n* temp
[root@abc ~]# ls temp/
[root@abc ~]# tar cvf temp.tar temp/
[root@abc ~]# ls
[root@abc ~]# cd /home/
[root@abc home]# cp /root/temp.tar ./
[root@abc home]# ls
[root@abc home]# tar xvf temp.tar
[root@abc home]# ls
[root@abc home]# ls temp

你可能感兴趣的:(linux 几个简单命令 20190518)