美文网首页
linux 几个简单命令 20190518

linux 几个简单命令 20190518

作者: 082e63dc752b | 来源:发表于2019-05-18 10:20 被阅读0次

    查看系统基本信息

    [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

          本文链接:https://www.haomeiwen.com/subject/oxyzaqtx.html