If you are using terminal / bash, and you want to perform multiple operations, you can consider concatenating them. For example, if you wanted to listthe contents of a directory (Desktop, in the example), you would want to do the following:
This will set your shell location to Desktop. Then, run the application “ls” to list the contents of the folder:
Your output will be whatever folders you have in your Desktop directory (in my case, the reference to my Home directory, and my text file “tips.txt”:
However, you can concatenate the commands by using the | symbol (which is obtained by pressing Shift + Function + Z (it must be in that order)) . As such, the two commands above become:
cd /home/user/Desktop | ls
The output is the same.
You can perform multiple concatenations as well – take, for example, the search function “grep”. If you have a lot of files in a directory, simply listing them may not be particularly useful, as you then have to look for the particular file name – and a computer is much better at matching text strings than you are 😉 As such, why not search the output of the listing?
cd /home/user/Desktop | ls | grep tips
(note that you do not have to use the complete name- you could
grep “ti” or even “ip”. It simply looks for a matching of the order of the letters, anywhere in the strings)
The output will be all the matches- if there is no output, you will see nothing.
Edit: Claude has been very quick off the mark which an excellent tip, pointing out that you could also concatenate as follows:
cd /home/user/Desktop;ls / grep tips