Skip to content

Instantly share code, notes, and snippets.

@datduyng
Created June 8, 2018 19:11
Show Gist options
  • Select an option

  • Save datduyng/6ef302300b3c4818d637e71adbdcb5fd to your computer and use it in GitHub Desktop.

Select an option

Save datduyng/6ef302300b3c4818d637e71adbdcb5fd to your computer and use it in GitHub Desktop.

Assignment01

Problem 1(8 points):

a. What did you type to look up this man page (give the entire command)

  • man man

b. Who was the original author of themancommand?

  • John W. Eaton (jwe@che.utexas.edu)

c. Which command flag can be used with the man command to have it display help information?

  • -h, --help

d. Which command flag can be used with the man command to make it behave the same as the whatis command?

  • -f

THE UNIX FILESYSTEM

Problem 2 (12 points): Answer the following questions about absolute and relative filenames:

a. What is a relative filename?

  • A Relative filename is the relative location of a file to some given location in the file system

b. What distinguishes an absolute filename from a relative filename?

  • If it starts with a /, it is absolute

c. Would pictures/trip_to_nebraska/ be considered absolute or relative?

  • Relative

d. Would /important_files/accounts/myFile.txt be considered absolute or relative?

  • Absolute

e. Would ../files/test.rbbe considered absolute or relative?

  • Relative

f. Assume you have a directory with a bunch of files inside. You have written a program (also inside of that directory) to read and write to those files. If you are going to be moving the directory to different locations on your computer, and you do not want to have to keep modifying your computer program to use those same files every time you move the directory, should you use absolute or relative filenames? Why?

  • Relative and Absolute will both work because when user attempt too move file using relative/absolute path unix system will change the path of everything inside a directory as well as the directory.

Problem 3 (10 points): Answer the following questions about the ‘.’ and ‘..’ directories assuming you are currently in the /usr/local/bin directory for each question:

a)What specific directory(absolute path)does ‘.’ refer to (in this case)?

  • /usr/local/bin

b)What specific directory(absolute path)does ‘..’ refer to (in this case)?

  • Point to parent directory: /usr/local

c)If you were to run the command cd ../../lib , what would be the new current working directory? (give the absolute path)?

  • /usr/lib

d)If you were to run the command cd ./system, what would be the new current working directory?(give the absolute path)?

  • /usr/local/bin/system/

e)Are the ‘.’ and ‘..’ directories considered to be visible or hidden?

  • the . and .. directories consider to be hidden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment