LINUX-Frequently used commands
|cat command Display the contents of a file|
|cat [Option] file-name|
|The cat command will output the contents of the file specified as an argument to the standard output.
If multiple files are specified as arguments, the contents of the specified files will be concatenated and displayed.
|Frequently used options|
|-v Display control codes and other hidden codes
-e In addition to the functions of the ”-v” option, add $ to the end of the line and display it
-t In addition to the ”-v” option feature, display the Tab code as ^I
-s Replace multiple consecutive blank lines with a single blank line
|Example: Display the contents of a file.|
|$ cat temp1.txt
|Example: Display with $ at the end of the line|
|$ cat -e temp1.txt ← Run it with the option "-e".
|Example: Display with TAB code|
|$ cat -t temp1.txt ← Run it with the option "-t".
C. ^|^| ghi---D.
↑The area where the tab is entered is shown as "^|".
|Example: Replace multiple consecutive blank lines with a single blank line|
|$ cat -s temp1.txt ← Run it with the option "-s".
← A blank line becomes one line.