Text File Editor commands
- Cat: Used to view plain text files (shorter)
Format: Cat [Options] [file]
Parameters |
Role |
-N |
Show line Numbers |
-B |
Show line numbers (blank lines are not shown) |
-A |
Displays the not visible " a symbol, such as a Space tab |
- MORE: For viewing plain text files (longer)
Format: more [options] [file]
Parameters |
Role |
- Digital |
How many rows are displayed in advance |
-D |
Show message and error content |
- Head: Used to view the first n rows of a plain text file
Format: Head [options] [file]
Parameters |
Role |
-N |
View Top N Line |
-n-10 |
View all but do not show after Line |
- Tail: Used to view the following n lines of a plain text file
Format: tail [options] [file]
Parameters |
Role |
-N |
show the post N of a file Line |
-F |
Refresh the displayed content continuously |
Usage: Tail–n 3 last.txt is to view the following 3 lines of the Last.txt file
- Od: For viewing files in special formats
Format: OD [options] [file]
Parameters |
Role |
-ta |
Show default formatting |
-tc |
Show ASCII Coding |
-to |
Show octal |
-td |
Show decimal |
-tx |
Display hexadecimal |
-tf |
Show floating-point numbers |
- Tr: Used to convert characters in a text file
Format: TR [source character] [target character]
[Email protected] lab1]# more Tr.txt
A b c d e F g h i j k l m n o p q R S t u v w x y Z
[Email protected] lab1]# more Tr.txt |tr [A-z] [a-z]
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
- Wc: The number of lines, characters, and bytes used to count text files
Format: WC [parametric] File
Parameters |
Role |
-L |
Number of rows displayed |
-W |
Displays the number of characters |
-C |
Number of bytes displayed |
linux[Basic]-07-text file operation [01]