Linux single-line script command collection this article will recently used some of the more interesting and powerful single-line commands to sort out, saving space is not an example. New updates will be found in the future. Www.2cto.com # export help document manls | col-b>ls.man.txt # View fil... linux single-line script command collection this article will recently used some of the more interesting and powerful single-line commands to sort out, saving space is not an example. New updates will be found in the future. Www.2cto.com # export help documentation man ls | col-B> ls.man.txt # view the union of file1 and file2 cat file1 file2 | sort | uniq # view the intersection of file1 and file2 cat file1 file2 | sort | uniq-d or comm-12 11.dat 22.dat # check that only one-side sets of file1 and file2 exist cat file1 file2 | sort | uniq-u www.2cto.com # view the set comm that only exists in file1 -23 file1 file2 # view the set comm-13 file1 file2 that only exists in file2 # display the top 10 most occupied files or directories in the current directory: du-sh * | sort-nr | head # find up to 10 files in the current directory (including subdirectories. -type f | xargs ls-l | awk '{print $5 "" $9}' | sort-nr | head # locate the current directory (including subdirectories) the latest 10 files find. -type f | xargs ls-lt | head # extract all variables in the expression (remove duplicates) echo '(int1-2) /100 * int1 + int2 * int3' | \ tr' \ (\) \ + \-\ * \/''' |\# delete the symbol :() +-*/sed-re's/\ B [0-9] + \ B // g' | \ # delete a number (excluding numbers in variables) tr ''' \ n' | \ sed '/^ $/d' | \ sort-u # count the actual number of lines in the C language program (excluding comment lines and empty lines) cat xxx. c | \ sed '/^ [\ t] * \/\ */,/. * \/d '| \ # Delete/**/sed'/^ [\ t] * \/d '| \ # Delete // sed '/^ [\ t] * $/d' | \ # delete empty row wc-l
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.