Can somebody give me an example how I can copy a file and open the copied file afterwards with the “cat” command in Linux? The statement should be in one line.
Thanks for your help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can cheat:
cat inputfile > outputfile && cat outputfileYou can substitute the first part using cp:
cp inputfile outputfile && cat outputfileYou can use
;instead of&&, so that the outputfile is displayed even if the copying did not succeed:cp inputfile outputfile; cat outputfileOr you can use
tee:cat inputfile | tee outputfile(note that this displays the file while copying, not afterwards)