Logo  

CS256 - Fundamentals of Structured Programming

Displaying exercises/e1/files/e1.txt

Exercise #1

Using a text editor of your choice, edit this file and write in the answers to
the following questions. Use the "man" command to reference any of the named
commands. When asked how to do something, write out the command you would use
to do it:

 1. Command to change your password?



 2. What is the full absolute path to your home directory?



 3. Using the "cp" command, how would you make a copy of a file called "f.txt"
    as "g.txt"?



 4. Using "cp", how would you make a copy of a directory called 'abc' located
    in the current working directory and all its contents as 'backup' located
    in your home directory?



 5. Command to move the directory "xdir" in the current directory to the
    directory ".trash" located in your home directory:



 6. Get a long listing of /u1/junk/cs151/fstab and answer:
    a) What is the group owner of the file?


    b) What is the size of the file?


 7. How would you rename the file "in.txt" to "out.txt"?



 8. What would be the "chmod" command to set the permissions on the file
    'file.txt' such that the owner had full access, the group could read only
    and other users could not access the file at all?



 9. "chmod" command to make sure that a file is executable for everyone, but
    w/o modifying the other permissions, whatever they may be?



10. How would you use "mkdir", in a single invocation, to make the sub-directory
    path "x/y/z" in your home directory?



11. How would you use the "du" command to produce only the total usage for the
    amount of disk space your home directory is using, in human readable format.