cat command
cat command
cat = concatenate
In this section, what is cat command and why we use it and what are its options, we will give detailed information about all these questions by giving examples.so let's learn
A.what is cat command ?
it concatenates files and displays them on the screen. This means that this command continuously displays the contents of the files one after the other, so that we think that this content is present inside the same file which is displayed on the screen.
B. why use cat command ?
We can have many files present, by opening these files, we use its contents for useful work.Sometimes these files prefer to view the contents of all the files together instead of opening one file at a time, this command is very useful at that time. Apart from this, there are some other important features of this command, which will be known further.
C. operation with its options
In this we will discuss the cat command with its option. Within this, we will tell the main purpose of cat command with practical.
Syntax :
cat [options] file1 file2 file3 ... ... ..
1. cat file :
With no options in this command, it displays the contents of the file on the screen when only one file argument is given.
We have a file named file.txt. On running it with cat command, the content of the file is being displayed.
2. cat file1 file2 file3 ... ... :
When we run two or more files with this command, then the contents of all the files are displayed one after the other.
To understand this, we will take three files, you can take two files or more than three files.
First file is file.txt and two more files are shown on the screen below
Comments
Post a Comment