编程知识 cdmana.com

Common commands of Linux operating system

Basic commands
  1. essential information
    uname -a
    uptime
    last
    cat /etc/redhat-release
    cat /proc/cpuinfo
    free -m
  2. Disk management
    df
    du
    fdisk
    mkfs
    fsck
    mount
    umount
  3. Internet Information
    ifconfig
    route -n
    iftop
    iptables -L
    netstat -lntp
    telnet
    wget
    dig
    nslookup
  4. Users and groups
    cut -d: -f1 /etc/passwd
    cut -d: -f1 /etc/group
    id <username>
    w
    user*
    group*
    passwd
  5. Application process
    yum
    rpm -qa
    systemctl
    top/htop
    ps aux
    kill
    pkill
    killall
  6. File directory
    cat
    more
    vi
    pwd
    tree
    touch
    mkdir
    cp
    mv
    rm
    tar
    zip
  7. File search
    find
    locate
    whereis
    which
  8. Character processing
    sed
    awk
    grep
    sort
    uniq
  9. Content validation
    md5sum
    cksum
    diff
  10. Restart shutdown
    reboot
    init 6
    shutdown -r now
    halt
    init 0
    shutdown -h now
Common commands
Serial number explain command Add
1 Find where the software is installed whereis nginx
2 Check port usage lsof -i:80 netstat -lntp | grep :80
3 Delete garbled files ( Delete by specifying the file node number ) ls -l
find -inum -delete xxx
4 See files that exclude comment lines and blank lines grep -v "^#" file | grep -v "^$"
5 Delete comment lines and empty lines from the file sed '/ \*#/d; /^$/d' file
6 In the file AA Replace with BB sed 's/AA/BB/g' file
8 See the union of two files sort file1 file2 | uniq uniq -u Delete intersection ,uniq -d Take out the intersection
9 Check the time difference between the target server and the local machine clockdiff x.x.x.x
10

版权声明
本文为[Bluse]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225104724977e.html

Scroll to Top