ECS 30-A

Homework #1

Fall 2008

Due: 4:00pm, Monday, October 6

 

1. What happens if you give the following command when the file called done already exists? 

% cp stuff done

What happens if you give the following command instead?

% mv stuff done

 

2. What command will send the files chapter1, chapter2, and chapter3 to the printer?  What command would you use to have the files printed in 2 columns with a landscape orientation? 

 

3. If you accidentally started to print a huge binary file, how would you go about removing the print job from the print queue?

 

4. What command line displays the system documentation for the ftp utility?

 

5. Should you ordinarily start your filenames with a period (.)?  Why or why not?

 

6. What command would you use to make your home directory the working directory?  What command identifies the working directory?

 

7. If your working directory is /usr/alex/ecs30, provide two ways to create the subdirectory called hw1.

 

8. What sequence of commands can you use to remove a directory called /usr/alex/old_stuff and all of its contents?

 

9. Based on the following result from ls -l

% ls –l

total 1764

-rw-r--r--   31 davis    users      688949 Oct  5 22:54 File1.dat

drwx------    2 davis    users        4096 Oct 17 09:14 private

-rwxr-xr-x    5 davis    users       28855 Oct  6 15:49 timetest.PC.out

-rw-r--r--    7 davis    users         774 Sep 29 15:17 vector.c

-rw-r--r--    7 davis    users        1398 Sep 29 15:17 vector.h

%

a. Is vector.c a regular file?

b. Is private a regular file?

c. May members of the users group read the private file?

d. What command can davis use to give permission to everyone to write vector.h?  What would the permssions flags be for vector.h after executing the command?

e. When was vector.c last modified?

f. What does the 31 for File1.dat mean?

 

10. What does it mean to have execute permission for a directory?

 

11. What command would you use to display the contents of vector.c one screen at a time?  How would you advance to the next screen?

 

12. How would display only the first three lines of vector.h?

 

13. What is the command to start the newsgroup reader?

 

14. What is the command to turn in your file named first.c to the hw2 directory of the cs30a account?  What is the command to find out what directories to which you can submit files in the cs30a account?