If you want to display the contents of multiple files at the same time in Linux system, you need to use the cat command. What are the uses of the cat command? Let's take a look at the usage of the cat command under Linux.
is connected to the use of the cat command or the standard input file and print. This command is often used to display the contents of a file, or to connect several files for display, or to read and display content from standard input, which is often used in conjunction with redirection symbols.
1. Command format:
cat [options] [files]. . .
2. Command function:
cat has three main functions:
1. Display the entire file at a time: cat filename
2. Create a file from the keyboard: cat 》 filename can only be created New files, you cannot edit existing files.
3. Combine several files into one file: cat file1 file2 》 file
3. Command parameters:
-A, --show-all is equivalent to -vET
-b, --number-nonblank is numbered for non-empty output lines
-e Equivalent to -vE
-E, --show-ends displays $
-n, --number for all lines of the output, starting with 1 for all lines Number of lines outputted
-s, --squeeze-blank There are two consecutive lines of blank lines, which are replaced by blank lines of one line
-t is equivalent to -vT< Br>
-T, --show-tabs Display tab characters as ^I
-u (ignored)
-v, --show-nonprinting Use ^ and M-reference, except for LFD and TAB
4. Example:
Instance 1: Add the line number of the log2012.log file to the log2013.log file.
Command:
cat -n log2012.log Log2013.log
Output:
[root@localhost test]# cat log2012.log
2012-01
2012-02
======[root@localhost test]# cat log2013.log
2013-01
2013-02
2013-03
======[root@localhost test]# cat -n log2012.log log2013.log
1 2012-01
2 2012-02
3
4
5 ======
6 2013-01
7 2013-02
8
9
10 2013-03
11 ======[root@localhost test]#
Description:
Previous12 Next page Total 2 pages
Linux when starting the sshd service, an error message, prompting Could not load host key: /etc /ssh
When you need to display the routing table in the Linux system operation, you will be exposed to the
If you want to display the contents of multiple files at the same time in Linux sys
Linux users find that the space usage is less than 70% when executing the df -h com
The process of reading MBR information from Linux system
Linux System Shell Command Line Operation Method
Linux routing command operation example summary
Linux system shell command tutorial
What are the differences between the three load balancing methods of LVS?
Linux Ubuntu tab key auto-completion command method
Linux vim comment color can't see how to change?
How to quickly clear Linux file content
How to shield the storm ui kill function in Linux
How does Win8.1 get the experience index to evaluate the quality of computer hardware?
Win8 system window transparency setting method
Win8 start button right click does not respond how to do?
Win10 UI changes: Introducing Win7's Aero Frosted Glass
Microsoft disclosed Win8 system details: resource usage is less than Win7
Win7 file association error how to cancel
Why are files and folders displayed in blue and green
Manually retrieve the Win8.1 system start menu
What is the process of dwm.exe in Win7 system? How to turn off dwm.exe