-
What command would you use to keep a record of every command you type and the output of
those commands?
script
-
How do you you abort a running program?
Control C
-
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 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
-
What directory are you in when you first log in to a Unix machine?
your own home directory
-
What directory is the starting point for EVERY absolute path?
the root directory
-
What directory is the starting point for a relative path?
the current directory
-
By default, which account is the owner of a file or directory?
the account that created it
-
Name the three types of access permissions.
read, write and execute
-
Name the three categories of accounts which are used in assigning access permissions.
owner, group, everyone else
-
Who can change the access permissions on a file or directory?
only the owner
-
What does the PATH shell variable contain?
the list of directories the shell must search
to find the file to run a command
-
What does a program do just before it stops running?
it sends an exit status to the shell
-
What does an exit status of 0 mean?
it means that the program encountered no errors
-
Look at the diagram on the
last page.
You are in the directory named it.
Write the ABSOLUTE pathname for the directory named
hw2 under the it244
directory.
You do not have to write a Unix command, I only want the pathname.
/courses/it/it244/hw/hw2
-
Look at the diagram on the
last page.
You are in the directory named courses.
Write the RELATIVE pathname for the directory named
hw1
under the it116 directory.
You do not have to write a Unix command, I only want the pathname.
it/it116/hw/hw1
-
Look at the diagram on the
last page.
You are in the directory named it117.
Write the RELATIVE pathname for the root directory.
You do not have to write a Unix command, I only want the pathname.
../../..
-
Look at the diagram on the
last page.
You are in the directory named bob
under home.
Write the RELATIVE pathname for the django
directory under projects.
You do not have to write a Unix command, I only want the pathname.
../../projects/django
-
Look at the diagram on the
last page.
You are in the directory gh.
Write the command to create a soft link to the hw2
directory under the it244 directory.
You may use either an absolute or relative pathname.
ln -s /courses/it/it244/hw/hw2
-
Write a SINGLE command to copy the file memo.txt
from your parent directory to your current directory.
cp ../memo.txt .
-
Write a SINGLE command that will change the permissions on the
FILE do_something so that the owner
can do anything with the file, the group can read and execute it,
and everyone else can only read the file.
chmod 754 do_something
-
Write a SINGLE command that will change the permission on the DIRECTORY
dir1 so that the owner can do anything in the directory,
the group can run
ls
and change the names of files in the directory, and everyone else
can only run cd
on the directory.
chmod 761 dir1
-
What is the name of the only program that can create a process?
the kernel
-
What would you write on the command line to remove the directory
dir1 in your parent directory.
Assume this directory is empty.
rmdir ../dir1