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? passwd 2. What is the full absolute path to your home directory? echo ~ echo $HOME 3. Using the "cp" command, how would you make a copy of a file called "f.txt" as "g.txt"? cp f.txt 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? cp -r abc ~/backup -r = recursive copy (copies the directory and all it's children contents to the destination.) 5. Command to move the directory "xdir" in the current directory to the directory ".trash" located in your home directory: mv xdir ~/.trash/ 6. Get a long listing of /u1/junk/cs151/fstab and answer: Use the command: ls -l /u1/junk/cs151/fstab and get: -rw-r--r-- 1 sbaker daemon 644 Jan 19 2018 /u1/junk/cs151/fstab ------ --- a) What is the group owner of the file? daemon b) What is the size of the file? 644 7. How would you rename the file "in.txt" to "out.txt"? mv in.txt 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? chmod 740 file.txt or: chmod u=rwx,g=r,o= file.txt - Note there are no spaces between the comma separated fields. - Note also the mode must be the first parameter with the filenames following it. 9. "chmod" command to make sure that a file is executable for everyone, but w/o modifying the other permissions, whatever they may be? chmod a+x file 10. How would you use "mkdir", in a single invocation, to make the sub-directory path "x/y/z" in your home directory? mkdir -p ~/x/y/z ^ Must specify your home directory as I assume you could be somewhere other than your home directory when executing commands. -p = Make all (missing) parent directories. 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. du -sh ~ -s = summary -h = human readable ~ = Your home directory