This is faster than opening the file in an editor, and there’s no chance you can accidentally alter the file. The cat command (short for “concatenate”) lists the contents of files to the terminal window. bash_aliases file in your home directory. To make your aliases always be available to you, add them to the. Type pf, a space, and the name of the process you are interested in: pf shutterĪliases defined on the command line will die with the terminal window.
If you wanted to discover the process ID (PID) of the shutter process-or to find out if shutter was even running-you could use the alias like this. The grep command looks for entries in the output from ps that match the command line parameter $1. This alias uses the ps command to list the running processes and then pipes them through the grep command.
This is required if the command sequence has spaces in it. Note the use of quotation marks around the command sequence. Here’s an alias called pf (for process find) that is just a little more complex. Aliases can be much more intricate than that simple example.