I wanted to do several commands on the same line I accidenta
I wanted to do several commands on the same line. I accidentally type “ls \\; cat data” and it does something strange. What, and why?
Answer:
Solution
If you have to run multiple commands in linux shell then you have use && symbol in order to execute them.
Suppose you have to list root and open data file the do as:
ls \\ &&cat data
But wnen you run ls \\; cat data”,it will give output as
ls: cannot access ;: No such file or directory
ls: cannot access cat: No such file or directory
ls: cannot access data: No such file or directory
because it will assume that \\; cat data are these are files or directories.
