0% found this document useful (0 votes)
17 views2 pages

Linux Piping

Y

Uploaded by

panda73665
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Linux Piping

Y

Uploaded by

panda73665
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Cat > abc.

txt Hello BCA /MCA SCA -> It will create a file and text data into it.

Cat >> atb.txt LPU -> Append the LPU at the last of file

cat abc.txt -> For displaying the same file

2 > file name -> Display error in another file

2 >> -> It directs the error msg from the command and store it in the file
and append it.

&> -> It stores the output and error to a given file.

& >> -> Append the output and error to existed file .

< -> File to command .

> -> Command to file

>> -> append data in existed file.

ls | grep “.txt” > text_file. -> First list all files then search files whose extension is .txt and
redirect or store it in text.txt file.

cat sample.txt | head -10| tail -5 -> Show all the content of sample .txt file in the sample txt show me
the first 10 of the line of the data and from that show me the last 5 of the data.

* Touch will only create the file and cat is used to create then add data into it.

Cp abc.txt abc1.txt -> Copying data from one file to another.

Cp -r /root /sakshi -> For copying complete directory from one file to another.

Mv abc.txt abc1.txt -> For moving / renaming files

Mkdir /sakshi /sakshi -> Creating directory inside the directory

mkdir -p /sakshi /sakshi -> Creating directory inside the directory

rm abc.txt -> Deleting file name

cat > sss.txt -> Check what right is provided to file

ls -l sss.txt -> It shows the right provided by system

chmod u+w sss.txt -> It give the write permission to user as well u means user and w means
write.

Chmod u+x sss.txt -> For executable

You might also like