How can we help?

You can also find more resources in our Help Center.

59 terms

Unix Final Exam

STUDY
PLAY
Given the following directory structure:
root (/)
|
|
jason
|
|
cop3353
/ \
/ \
/ \
MyResume fun
/ \
/ \
/ \
Game1 Game2
Which command will delete the file MyResume? Use absolute pathnames.
rm /jason/cop3353/MyResume
Which of the following is not an appropriate filename?
Money$$!
Given the following directory structure:
root (/)
|
|
jason
|
|
cop3353
/ \
/ \
/ \
MyResume fun
/ \
/ \
/ \
Game1 Game2

Which command will move Game1 into the cop3353 directory? Use absolute pathnames.
mv /jason/cop3353/fun/Game1 /jason/cop3353
Which UNIX command allows you to find info about any command?
man
Given the following directory structure:
root (/)
|
|
jason
|
|
cop3353
/ \
/ \
/ \
MyResume fun
/ \
/ \
/ \
Game1 Game2

What is the absolute pathname of the fun directory?
/jason/cop3353/fun
What are the two main types of files you encounter in UNIX?
text and binary
Given the following directory structure:
root (/)
|
|
jason
|
|
cop3353
/ \
/ \
/ \
MyResume fun
/ \
/ \
/ \
Game1 Game2

Which command will list the files under the fun directory? Assume you are in the cop3353 directory and use relative pathnames.
ls fun
An alternative to your UNIX programming environment is an IDE. IDE stands for
integrated development environment
When you log in to linprog, which directory do you start at?
your home directory
Given the following directory structure:
root (/)
|
|
jason
|
|
cop3353
/ \
/ \
/ \
MyResume fun
/ \
/ \
/ \
Game1 Game2
What is the relative pathname of jason, assuming your current working directory is fun?
..\..
A _______ is what you get whenever the computer runs a program
process
The place in emacs where you type your text is known as the
buffer window
In emacs, yanking is also known as
pasting
Which operator allows you to redirect input from a file (instead of the keyboard)?
<
In emacs, killing is also known as
cutting
Which type of text editor is emacs?
Which of the common UNIX text editors did we focus on?
How would you list all files and directories (in your current working directory) that begin with e or k?
ls [ek]*
Which shell does linprog use by default?
tcsh
Which operator allows you to redirect output to a file (instead of the screen)?
>
Given the following long listing of files and directories:
-rwx------ 1 porter CS-Grads 9885 Sep 15 03:36 add.x
-rw-r--r-- 1 porter CS-Grads 278 Sep 15 02:38 add.cpp
drwx------ 2 porter CS-Grads 4096 Sep 15 18:20 Fun
-rwx------ 1 porter CS-Grads 7642 Sep 15 02:39 loop.x
-rw-r--r-- 1 porter CS-Grads 305 Sep 15 02:33 loop.cpp
chmod go-r loop.cpp
Given the following long listing of files and directories:
-rwx------ 1 porter CS-Grads 9885 Sep 15 03:36 add.x
-rw-r--r-- 1 porter CS-Grads 278 Sep 15 02:38 add.cpp
drwx------ 2 porter CS-Grads 4096 Sep 15 18:20 Fun
-rwx------ 1 porter CS-Grads 7642 Sep 15 02:39 loop.x
-rw-r--r-- 1 porter CS-Grads 305 Sep 15 02:33 loop.cpp
read, write, and execute
The command wc -l filename displays the number of lines in the filename.
True or False
True
The chmod command is used to modify the program mode from foreground to background execution.
True or False
False
Where does the command sort +1 xyz sort the xyz file
on the second field
Given the following long listing of files and directories:
-rwx------ 1 porter CS-Grads 9885 Sep 15 03:36 add.x
-rw-r--r-- 1 porter CS-Grads 278 Sep 15 02:38 add.cpp
drwx------ 2 porter CS-Grads 4096 Sep 15 18:20 Fun
-rwx------ 1 porter CS-Grads 7642 Sep 15 02:39 loop.x
-rw-r--r-- 1 porter CS-Grads 305 Sep 15 02:33 loop.cpp
Which permissions does the group have on the file add.cpp?
read
How do you change the access mode of myfile to the owner rwx only.
chmod 700 myfile
What does the command head -5 Xfile Zfile
displays the first 5 lines of the Xfile and Zfile files
Changing file permission is one way to protect your files from unauthorized users.
True
What does the following command do:

grep hello xyz
finds the string hello in the specified file
A Cron job is _______.
the process of scheduling commands or scripts to run on a regular basis at specific times.
If you use _______ to combine commands, the system will run both in sequence but run the second only if the first succeeds.
&&
One method of script creation is to enter a series of commands followed by the _______ command.
history
At the shell prompt, typing "time" followed by the complete command, will provide feedback to how long the command took to execute.
True of False?
True
In order to view a list of the current processes that are running in the current shell, type _______ at the shell prompt.
ps
Which of the following would be used to run a shell script?
sh
A shell script is nothing more than a list of commands for Unix or Linux to execute.
True or False
True
Using the _______ command, in conjunction with the PID number, will delete practically any process running or suspended on a system.
kill
Which command can take input from a user while a script is running?
read
Programs, scripts and commands are all considered to be _______.
processes
An alternative to your UNIX programming environment is an IDE. IDE stands for
integrated development environment
What is the following makefile line called?
add.o: add.h add.cpp
a dependency line
Which g++ flag allows you to compile code, but not link it?
-c
In a makefile, every action line must begin with
a tab character
By default, the make program gets its instructions from a file named
makefile
The part of g++ that creates an executable file is called the
linker
What is the output of the following command?
g++ -o add.x add.cpp
an executable file named add.x
Which compiler do you use on linprog to compile C++ programs?
g++
Which command will compile the C++ file add.cpp on linprog?
g++ add.cpp
In order to manage larger C++ projects in UNIX, you can use a program named
make
to send an email from the shell prompt, just type in _______ followed by the recipient's address.
mail
pine
mutt
In order to automatically forward emails from one email account to another, a file named _______ must be created and placed in the _______ directory.
home
.forward
The traceroute command is used to _______.
find out what route the packets take to arrive at the destination computer.
The command that allows you to log into a remote server is:
telnet
The telnet command is used to connect to a remote server.
True or False?
True
The command to close the telnet connection is: exit
True or False
False (it's quit)
The ping command is used to _______.
find out if the computer is up and functional.
Which of the following is the correct way to send a text file using mail?
mail reh0399@fsu.edu < myfile.txt
Which remote server is used by the Computer Science Department to send emails?
shell
The command that displays the status of the telnet connection is:
status