CS 3377 EXAM 1 REVIEW QUESTIONS AND
ANSWERS 100% CORRECT
cd - ANSWER change to another directory
mkdir - ANSWER make a directory
cp - ANSWER copy a file
pwd - ANSWER display current working directory
mv - ANSWER move a file to another location
rm - ANSWER
rmdir - ANSWER delete a directory
ls - ANSWER list filenames and directories
chmod - ANSWER change file security setting
,man - ANSWER help manual
Count the files that you own in all your directories (where your userid is myusername) -
ANSWER ls -lR | grep myusername | wc -l
What UNIX command is used to update the modification time of a file and/or change the
file's access? - ANSWER touch
The file "mypage.html" has permissions set for read and write only for owner. Which of the
following command will change the permissions so that the file can be viewed on the WWW?
- ANSWER chmod og+r mypage.html
To list the permissions on files, which of the following commands will work? - ANSWER ls -l
When you use the ln command, which of the following occurs? - ANSWER a file is created that
points to an existing file
(T/F) The command "grep -i hello" prints all the lines in file, not containing the string "hello".
- ANSWER false
Which expression shows the proper way to add the directory /usr/bin to your path? -
ANSWER PATH=$PATH:/usr/bin
,Which of the following is not a UNIX file type?
plain file
special file
batch file
directory file - ANSWER batch file
How do you create a new directory called "flower"? - ANSWER mkdir flower
Which of these is not a common UNIX shell discussed in class (or textbook or lecture)?
bash
sh
fresh
ksh - ANSWER fresh
What is the command to search all files in your current directory for the word "hello"? -
ANSWER grep hello *
Which of the following is not a benefit of the fact that many UNIX commands operate on
plain ASCII text files?
, the same file can be used by many programs
output to the terminal and to files can be done in the same way
most current UNIX installations have a graphical user interface
these commands can be used as filters for the output of other commands - ANSWER most
current UNIX installations have a graphical user interface
Change the current directory to /usr/local/bin - ANSWER cd /usr/local/bin
Which command will print the contents of all files in the current directory whose names start
with the character "a" and end with a period (".") followed by any two characters followed by
a number? - ANSWER cat a*.??[0-9]
(T/F) Consider a file abc which can be "read, write, execute" only by the owner. After the
command "chmod o+x abc", the file "abc" is executable by group. - ANSWER false
How do you rename file "new" to be "old"? - ANSWER mv new old
To delete a file called mynotes.txt, which command do you use? - ANSWER rm -i mynotes.txt
ANSWERS 100% CORRECT
cd - ANSWER change to another directory
mkdir - ANSWER make a directory
cp - ANSWER copy a file
pwd - ANSWER display current working directory
mv - ANSWER move a file to another location
rm - ANSWER
rmdir - ANSWER delete a directory
ls - ANSWER list filenames and directories
chmod - ANSWER change file security setting
,man - ANSWER help manual
Count the files that you own in all your directories (where your userid is myusername) -
ANSWER ls -lR | grep myusername | wc -l
What UNIX command is used to update the modification time of a file and/or change the
file's access? - ANSWER touch
The file "mypage.html" has permissions set for read and write only for owner. Which of the
following command will change the permissions so that the file can be viewed on the WWW?
- ANSWER chmod og+r mypage.html
To list the permissions on files, which of the following commands will work? - ANSWER ls -l
When you use the ln command, which of the following occurs? - ANSWER a file is created that
points to an existing file
(T/F) The command "grep -i hello" prints all the lines in file, not containing the string "hello".
- ANSWER false
Which expression shows the proper way to add the directory /usr/bin to your path? -
ANSWER PATH=$PATH:/usr/bin
,Which of the following is not a UNIX file type?
plain file
special file
batch file
directory file - ANSWER batch file
How do you create a new directory called "flower"? - ANSWER mkdir flower
Which of these is not a common UNIX shell discussed in class (or textbook or lecture)?
bash
sh
fresh
ksh - ANSWER fresh
What is the command to search all files in your current directory for the word "hello"? -
ANSWER grep hello *
Which of the following is not a benefit of the fact that many UNIX commands operate on
plain ASCII text files?
, the same file can be used by many programs
output to the terminal and to files can be done in the same way
most current UNIX installations have a graphical user interface
these commands can be used as filters for the output of other commands - ANSWER most
current UNIX installations have a graphical user interface
Change the current directory to /usr/local/bin - ANSWER cd /usr/local/bin
Which command will print the contents of all files in the current directory whose names start
with the character "a" and end with a period (".") followed by any two characters followed by
a number? - ANSWER cat a*.??[0-9]
(T/F) Consider a file abc which can be "read, write, execute" only by the owner. After the
command "chmod o+x abc", the file "abc" is executable by group. - ANSWER false
How do you rename file "new" to be "old"? - ANSWER mv new old
To delete a file called mynotes.txt, which command do you use? - ANSWER rm -i mynotes.txt