1. cat cat is used to read, display, or concatenate the contents of a file
Cat file.txt //show The content of file.txt shows the contents of the file.txt in cat file.txt file1.txt .... Show the content of File.txt file1.txt ..... Show multiple files file.txt file1.txt ... Contents of cat File.txt | Tr-s ' \ n ' //show the content of file.txt. It will squeeze adjacent ' \ n ' characters to a single ' \ n ' to display the contents of file.txt, and replace successive empty lines with one
Cat-t file.txt //show The content of file.txt and Highlight tab characters as ^i displays the contents of the File.txt and displays tab pay as ^i
Cat-n file.txt //show every line and a line number prefixed display the contents of the file
2. find list all the files and fol DERs from the current directory to the descending child directories
Find Base_path//list All files and subfiles in Base_path find/root/deploy_ws/-name "testlist.*"//list all files with F Ilename starting with testlist in/root/deploy_wsfind/root/deploy_ws/-iname "testlist.*"//list all files with filename Starting with Testlist In/root/deploy_ws, the more important are to ignore CASEFIND/ROOT/DEPLOY_WS \ (-name "testlist.*" -or-name "*.plugin" \)-print//list all files with filename starting with testlist or ending with Pluginfind/root/deplo Y_WS \ (-name "testlist.*"-and-name "*.plugin" \)//list all files with filename starting with testlist and ending with Pluginfind/root/deploy_ws-path "*bat*"-print//list All Files In/root/deploy_ws and the path for the files should MATC H Bat*find. -regex ". *\ (\.txt\|\.sh\) $"//list all files with the filename ending with txt or sh in current dir.find. ! -name "*.txt"-print//list files The name does not end with. txt
Find. -type D-print//list only directories including descendants
Find. -type f-print//list only regular files
Find. -type L-print//list only Symbolic links
Find/usr/lib/firefox/plugins-type l-print//list Symbolic Links in/usr/lib/firefox/plugins
Some Useful Shell command