-
How do you you abort a running program?
Control C
-
What would you type at the command line to see all the files in the directory
named /home/tsoro?
ls -a /home/tsoro
-
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 is the parent directory?
the directory directly above your current directory
-
What is a startup file?
a text file containing Unix commands that are run just before the shell gives you a prompt
-
What directory is the starting point for an 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
-
If you have read permission on a directory, can you read the files in that directory?
no, you need read permission on each file
-
If you have write permission on a directory, what can you do in that directory?
create a file or directory, delete a file or directory, rename a file or directory inside the directory
-
If you have write permission on a directory to you have write permission on the files it contains?
no, you need write permission on each file
-
What does the PATH shell variable contain?
the list of directories the shell must search to find the file to run a command
- Write two commands that will take you to your home directory,
that is, make your home directory the current directory.
Any two of the following are acceptable
cd
cd ~
cd ~UNIX_ID
cd /home/UNIX_ID
- Look at the diagram
on the last page. Assume that you are in /home/tsoro.
Now write the single command you would use to go to the directory named
frank
using an absolute pathname.
cd /classes/it/it244/frank
- Again, look at the diagram
on the last page. Assume that you are in the directory
/classes.
Write the single command you would use to go to the directory
/classes/it/it244/frank using a relative pathname.
cd it244/frank
- Look at the diagram on the last page.
Assume that you are in the directory /home.
Write a single command to go to the directory /classes/it244
using a relative pathname.
cd ../classes/it/it244
- Look at the diagram on the last page.
Assume that you are in the directory named frank.
Write a command to create a symbolic link to the directory named
classes.
ln -s /classes
or
ln -s ../.. classes
- Write the single command you would use to move the directory named
work
from your home directory to your current directory.
mv ~/dir .
- Write the single command you would use to create the file
logged_on.txt which would contain a listing
of all users currently logged on in reverse alphabetical order.
who | sort -r > logged_on.txt
- Write the single command you would use to give the following permissions to the
file work.sh.
The owner should be able to do anything with the file.
The group should only be able to read and execute the file.
Everyone else should only be able to read the file.
chmod 754 work.sh
- Write thesingle command you would use to to give the following permission to
the directory dir1.
The owner should be able to do everything.
The group should be able to run ls
and cd
on the
directory.
Everyone else should have no permission on the directory.
chmod 750 dir1
- The file red_sox.txt in your current directory has the format
2011-07-02 Red Sox @ Astros Win 7-5
2011-07-03 Red Sox @ Astros Win 2-1
2011-07-04 Red Sox vs Blue Jays Loss 7-9
2011-07-05 Red Sox vs Blue Jays Win 3-2
…
Write a command to find all Red Sox wins when they are not playing at home.
When "vs" appears between the names of the two teams, it means it is a home game.
grep Win red_sox.txt | grep -v vs