美文网首页
实用的Shell(一)

实用的Shell(一)

作者: 诺之林 | 来源:发表于2020-12-31 15:40 被阅读0次

    查看Home下文件夹大小?

    man du
    du - estimate file space usage
    
    -s, --summarize
           display only a total for each argument
    -h, --human-readable
           print sizes in human readable format (e.g., 1K 234M 2G)
    
    man sort
    sort - sort lines of text files
    
    -h, --human-numeric-sort
           compare human readable numbers (e.g., 2K 1G)
    -r, --reverse
           reverse the result of comparisons
    
    man head
    head - output the first part of files
    
    -n, --lines=[-]NUM
           print the first NUM lines instead of the first 10; with the leading '-', print all but the last NUM lines of each file
    

    如何杀死php-fpm进程?

    man ps
    ps - report a snapshot of the current processes
    
    To see every process on the system using standard syntax
    ps -ef
    To see every process on the system using BSD syntax
    ps ax
    SIMPLE PROCESS SELECTION
    a      Lift the BSD-style "only yourself" restriction
    -e     Select all processes
    x      Lift the BSD-style "must have a tty" restriction
    OUTPUT FORMAT CONTROL
    -f     Do full-format listing
    
    man grep
    grep, egrep, fgrep, rgrep - print lines matching a pattern
    
    -v, --invert-match
           Invert the sense of matching, to select non-matching lines
    
    man awk
    gawk - pattern scanning and processing language
    
    n = 5
    print $n
    prints the fifth field in the input record.
    
    man xargs
    xargs - build and execute command lines from standard input
    
    echo hello | echo
    
    echo hello | xargs echo
    
    man kill
    kill - send a signal to a process
    

    参考

    相关文章

      网友评论

          本文标题:实用的Shell(一)

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