Mid Term Flashcards
(96 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
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
How do you get the next screenfull when using man?
hit the Space bar
How do you exit the man program?
hit q
What is the other program, besides man, that you can use to get help?
info
Name the three whitespace characters.
Space, Tab and newline (Enter or Return)
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 /courses?
cd /courses
What would you type at the command line to see what directory you are currently in?
pwd
What would you type at the command line to see ALL the files in the directory named /home/ghoffman?
ls -a /home/ghoffman
What would you type at the command line to print to the screen the contents of the file named memo.txt?
cat memo.txt
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 create a directory named work?
mkdir work
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
What would you type at the command line if you wanted to know the network name of the Unix computer you were using?
hostname
Name one of the two pager programs that allow you to read a long file one screenful at a time.
more or less
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 the FIRST 10 lines of the file log.txt?
head log.txt