Linux Piping
Linux Piping
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
2 >> -> It directs the error msg from the command and store it in the file
and append it.
& >> -> Append the output and error to 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 -r /root /sakshi -> For copying complete directory from one file to another.
chmod u+w sss.txt -> It give the write permission to user as well u means user and w means
write.