CSCI 57 and 65: Introduction to Unix Courses
Laboratory Assignment 4
1. TURN-IN a hard copy of the following:
- On all homework please include
- Your Name
- Course Number
- Date
- ecst login name
- This webpage is to be printed
from unix and your answers recorded on it. You must include the
printing cover page (details given in lab).
- To print use the command lpr -Pparrot <filename>
- To view the printer queue use the command lpq -Pparrot
- (parrot is the name of the printer in our lab)
- Please answer the following questions (answers and/or help given in lab). The first 14 questions
should be pure review. You should know the answers these ones without
having to look them up or think about it by this point. If you do
not know the answers to these questions then you are behind.
- What command is used to create a directory?_______________________________
- What command is used to remove a directory?______________________________
- What command is used to remove a file?__________________________________
- What command is used to rename a file?__________________________________
- What command is used to move a file?___________________________________
- What command is used to copy a file?____________________________________
- What command is used to clear your terminal?______________________________
- What command is used to create links to files or directories?___________________
- What command is used to change your password?___________________________
- What command is used to page output?____________________________________
- What is a Unix pipe used for?_________________________________________________________________________________________________
- What command is used to print your present working directory?_________________
- What is the man command for?__________________________________________
- What does the whatis command do (if you aren't sure type whatis whatis )?________________________________________________
- What does the cal command do?__________________________________________
- What is the difference in the last column of output between the who command and the w command?_______________________________________________________________________________
- View a long listing in your HOME directory (type ls -l ) the first character on each line represents the file type. For most files it is just a dash '-'
- With what character are directories identified by in this column?_____________
- With what character are links identified by?_____________
- Give the chmod command to change permissions on file1
to give:
- Owner - read write execute
- Group - read write
- Other (or world) - read only
- $___________________________________________________________________
- Give the chmod command to change permissions on file2
to give:
- Owner - read execute
- Group - read execute
- Other - no permissions
- $___________________________________________________________________
- Give the chmod command to change permissions on file3
to give:
- Owner - read write execute
- Group - read execute
- Other - execute
- $___________________________________________________________________
- Give the chmod command to add read permission for the group
ownership of file4 but without modifying other existing permissions:_____________________________________________________________________________
- Give the chmod command
to modify the permissions on all files ending with the .txt extension
in the current directory to (answer should include a wildcard):
- Owner - read write execute
- Group - read write execute
- Other - read execute
- $___________________________________________________________________
- What is your standard file creation mode (type umask to see)?______________________
- What umask would you use if you wanted all of the files you
created to have by default
- rwx for owner
- rwx for group
- read only for other
- _______________________________________________________
- In what file would you change your default umask to make this a permanent change?_________________________________
- A file has the following permissions -rwxr-xr-x what is the octal value for these permissions (the three numbers)?_______________________
- A file has the following permissions -rw-r----- what is the octal value
for these permissions (the three numbers)?_______________________
- A file has the following permissions -r-x-wx--x what is the octal value for these permissions (the three numbers)?_______________________
- A file has the following permissions -rwxrwxrwx what is the octal value for these permissions (the three numbers)?_______________________
- A file has the following permissions ---------- (no permissions at all) what is the octal
value for these permissions (the three numbers)?_______________________
- What month and day was /user/s/toddj/somefile.txt last modified (use a long listing of ls to find out)?___________________________
- What option should you pass to chown to make it operate on files and directories recursively (read the man page, type man chown)?___________
- What command and option is used on the ECST systems to setup a
web directory for your user account?__________________________________
- After you run this command what new link appears in your HOME directory?_______________________________
- Where does this link point to (type ls -l to see)?__________________________________________________
- What happens if you export a senseless path (for example export PATH=blah )?_________________________________________________________
- Create three directories, give one execute permission only, chmod 111 dirname, give another read permission only, chmod 444 dirname, and a third one give read and execute permissions chmod 555 dirname
- Try to cd to each one and try an ls -a on each one to see the differences in behavior.
- What effect does giving execute permission on a directory
have?_________________________________________________________________________________
- What effect does giving read permission on a directory
have?____________________________________________________________________________________