實用的Shell(一)

查看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

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章