File Related Commands:: Cat Command: This Command Is Used To Create A File. Syntax: $cat Filename

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

File related commands:

Cat command: This command is used to create a file.


Syntax: $cat > filename
To display the content of file the syntax is:
$cat < filename
Appending files: This command is used to append the content of one file
to another file.
Syntax: $ filename1>>filename2
Touch command: This command is used to create an empty file.
Syntax: $touch filename
Cp command: This command is used to copy a file.
Syntax: $cp <source file>< target file>
In this command overwriting is main prolem.
To overcome this prolem the following command is used. !or this the
syntax is:
$cp "i <source file><target file>
Mv command: This command is used to move or rename the file.
Syntax: $mv <source file><target file>
Wc command: This command is used to count the numer of lines#
words and character in one or more files.
Syntax: $wc filename
To display the numer of lines the syntax is:
$wc "l filename
Ls commands: These commands are used to list the files.
Syntax: $ ls
Ls x command: this command is used to list the file in row wise.
Syntax: $ls "x
Ls l command: This command is used for long listing of files.
Syntax: $ls "l
Ls r command: This command is used to list all files and directories
under the current dictionary.
Syntax: $ls "r
Ls t command: This command is used to list all the files on the asis of
modification or creation of files.
Syntax: $ls "t

You might also like