Title: Quiz 7 - Redirection and more wild cards
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review

Q: Write a command to display a list of people on the system and store it in a file called "whofile".
A: who|tee whofile / w|tee whofile / finger|tee whofile

Q: Write a command to fina all file called "mine" on your system.
A: find / -name mine / fine / -name "mine"

Q: Given the command: sp file1 file 2 > file3 What ends up in file3?
A: file 3 is empty / Nothing. The contents of file1 are copied to file2. / Nothing, the file is created with no contents / nothing ends up in file3, and file1 overwrites file2

Q: Write a command to report how many hidden and non-hidden files you have in your home directory.  Do not search subdirectories.
A: ls -a ~ | wc -l / ls -l-a~ | wc -l

Q: Write a command to report the count of occurrences of the sequence "Fatal Error 220" in all files ending in".log" in the directory /spool/log.
A: grep -c "Fatal Error 220" /spool/log/*.log / grep "Fatal Error 220" /spool/log/*.log | wc -l

Q: Write a command to list all lines in the file "lawyers" that have the word "honest". Do no just assume that there are no honest lawyers.
A: grep "honest" lawyers / grep honest lawyers / grep -i "honest" lawyers

Q: Write a command to list all files owned by "user17" on the system. Direct errors to the bit bucket.
A: find / -user user17 2> /dev/null

Q: Write a command to find all large files in your home directory or below it. A large file is one that has more than 100 blocks.
A: find ~/ -size +100 / find ~ -size +100

Q: Create two files in directory xmen which is below your pwd. Use one command. Call the files marvel1 and marvel2
A: touch xmen/marvel{1,2} / touch xmen/marvel1 xmen/marvel2 / touch ./xmen/marvel{1,2}

Q: Write a command to report the number of words in the file "my_speech"
A: wc -w my_speech / cat my_speech | wc -w