Cat
Command
Command
Cat Command is used for following purposes:
1.
Create File
Create File
2.
Write File
Write File
3.
Append File
Append File
4.
Display File Content
Display File Content
5.
Concatenate Files
Concatenate Files
How to create File Using Cat Command:
Ø cmd: cat > /home/SALMAN/Desktop/MyDoc My_file1
How to save data in file:
Ø press ctrl+d to save and exit from the file
How to display data/content
Ø cat /home/ SALMAN /Desktop/MyDoc/My_File1
Ø [junaid@localhost MyDoc]$ cat
MyFile MyFile2
MyFile MyFile2
o Multiple file data displays
How to append any file:
Ø cat >> /home/ SALMAN /Desktop/MyDoc
My_file1
My_file1
How to concat two files in a new:
Ø cat My_file1 My_file2
>> newFile (treminal in same directory)
>> newFile (treminal in same directory)
Display Line Numbers in File Content:
Ø
cat -n MyFile (Terminal and file at same directory)
cat -n MyFile (Terminal and file at same directory)
No comments:
Post a Comment