For the following, cmd1 and cmd2 are arbitrary UNIX commands, and file1 and file2 are files owned by you. Write UNIX (bash) commands to:
(a) Run cmd1 and append its output to file1.
(b) Run cmd1, and if it returns a status of 0, run cmd2.
(c) Run cmd1 and redirect both standard output and standard error to file1.
(d) Compare file1 and file2 (as text files).
(e) Run cmd1 passing the names of all files in the current directory as arguments.
(f) Replace file1 with the output of cmd1.
(g) Sort file1 and store the result in file2.
(h) Run cmd1 in the background at low priority.
(i) Set the environment variable $FOO to "Hello"
(j) Set permissions so that anyone may execute file1.
(k) Set permissions on file1 and file2 so that anyone can read them but only you can edit them.
(l) Set permissions on dir1 so that anyone may list the files in it, or read or execute those files, but only you can add or remove files.
(m) Kill the process with process ID 12345.
(n) Show what background processes are currently running.
(o) Show the owners and permissions for file1 and file2.
(p) Print all lines in file1 containing "foo".