Final Review Flashcards
(100 cards)
What command would you use to keep a record of every command you type and the output of those commands?
script
What key would you press to get the last command you typed?
up arrow
What keys would you hit to go to the beginning of the command line?
Control A
How do you abort a running program?
Control C
What would you type at the command line to get the man page for the ls command?
man ls
If you wanted to use one of the characters that have special meaning to Unix in a filename, what TWO things could you do?
put a backslash in front of it or quote it
What would you type on the command line if you wanted to go to the directory /home?
cd /home
What would you type at the command line to delete the file named memo.txt?
rm memo.txt
What would you type at the command line to copy the file named memo.txt to memo.bak?
cp memo.txt memo.bak
What would you type at the command line to move the file named memo.txt into the directory named work?
mv memo.txt work
What would you type at the command line if you wanted to see the value of the variable SHELL?
echo $SHELL
If you started typing the name of a file on the command line and wanted Unix to supply the rest, what would you do?
hit the Tab key
What would you type at the command line if you wanted to find all lines in the file results.txt that contained the word “homework”?
grep homework results.txt
What would you type at the command line if you wanted to find all lines in the file results.txt that DID NOT contain the word “homework”?
grep -v homework results.txt
What would you type at the command line if you wanted to see all the lines in numbers.txt sorted in REVERSE NUMERIC order?
sort -nr numbers.txt
If you saw the following prompt, what is your CURRENT DIRECTORY?
it244gh@vm75:/courses/it244/s19/ghoffman$
/courses/it244/s19/ghoffman
What would you type at the command line if your wanted to find all lines in the file red_sox.txt that had the word “Win”, but NOT the word “Rays”?
grep Win red_sox.txt | grep -v Rays
What would you type at the command line if your wanted to find all lines in the file red_sox.txt that had the word “Win”, but NOT the word “Rays”, and have the lines sorted alphabetically?
grep Win red_sox.txt | grep -v Rays | sort
What program would you use to find where the program file for tar is located?
which or whereis
What command would you use to find out all the users currently logged on to the machine you are using?
finger or who
What is the name of the directory at the top of the Unix filesystem?
root
What symbol is used to represent the top of the Unix filesystem?
/
What do you call the directory directly above your current directory?
the parent directory
What directory are you in when you first log in to a Unix machine?
your own home directory