Top 10 command in linux with example

vinod kumar
3 min readDec 2, 2020

--

Top 10. Cat command in Linux use for create the file {cat is short for “concatenate”}, this command is most frequently use in the Linux. if you want to create single or multiple file with the help of cat command. You can do multiple tasks with help of cat command like {view, concatenate and make the file.

Syntax for create the file with cat. Cat > file name.

1 } See in the below example how we create the file with cat.

if you have a file in you system and you want to check the content in the file , then you can use the cat command for view the file content .This syntax use views the file content

2} Below example for view the file content.

3} if you want to view the content of multiple at the same time. You can use the below syntax.

4} if you want to give the line number in your file. You can use below example.

5} cat –b. This cat command use to give the number before the line. You can see in the below example

6} you can copy date from one file to another file with the help redirection operator . you use this operator carefully it will overwrite the content.

7}. Cat –e, this flag use for write the $ mark at the end of the line. See in the below example

8} cat-s , with the help of this flag you can squeeze-blank space more than one blank line in the file

9}. CAT –T, you can see TAB space in you output, see in the below example.

10}. Append the stander output the redirection operator.

You can append in existing file with >> {double greater} content of txt file will be append at the end of txt1 file

--

--

No responses yet