Find/root/data-type f-exec rm-rf {} \;
Find/root/data-type F | Xargs rm-f
Find-type to find by file type
Delete all files in a directory, but keep a specified file
Method One:
find/root/-type F! -name "File10" | Xargs rm-f
find/root/-type F! -name "File10"-exec rm-rf {} \;
-exec processing the results of a lookup (processing the previous result)
{} indicates what was found
\; Translated
When copied, the same name does not prompt for overwriting
/bin/cp/mnt/test.txt/tmp/test.txt Full path
\cp/mnt/test.txt/tmp/test.txt plus \
Alias setting aliases
Unalias Canceling aliases
See only 20 to 30 lines of one file
head-30 Test.txt | Tail-11
Print line number
Sed-n ' 20,30p ' test.txt
Sed ' s#oldboy#oldgirl#g ' test.txt replaces Oldboy with Oldgirl (only replaces output, file is not replaced)
Sed-i ' s#oldboy#oldgirl#g ' test.txt means replace G for global, #可以用/@ replace
Seq
Tail-f Real-time changes to trace files
awk filters content, prints, deletes
Filter content (Fetch columns)
awk ' {print '} ' files in the first column, $ two in the second column
Awk-f ":" ' {print $} ' file-F is the flavor delimiter
Awk-f ":" ' {print $ ', ' $ $ ', ' $ $} ' in the middle of a comma to split
awk ' {if (nr<31 && nr>19) printf $ "\ n"} ' test.txt NR is line number
Find/root/data-type f-name "Test.txt" | Xargs sed-i ' s/oldboy/oldgirl/g '
Linux basic commands