(Linux) - Is each of the following an absolute pathname, a relative pathname, or
ID: 3715996 • Letter: #
Question
(Linux)
- Is each of the following an absolute pathname, a relative pathname, or a simple filename?
milk_co
correspond/business/milk_co
/home/max d. /home/max/literature/promo
..
letter.0210
- What do dot (.), dotdot (..), and ~ represent in UNIX? Show use of all three.
- What are the permissions for your home directory set by your system
administrator (not the directory called /home, not the permissions of the files in your home directory)? What command did you use to answer the question? Show your session(copy/paste).
- Suppose that you want to block everyone (except you) at the main door (your ~ directory) of your directory hierarchy (i.e., your home directory-not the files inside the directory). Take the necessary steps to do this. Show the session that you used to accomplish the task and confirm that the task has actually been done.
- Create a file, called sample, in your home directory and symbolically set its permissions to
read and write for yourself, read for users in your group, and none to everyone
else. What command did you use to create the file? What command did you use to
set privileges?
- Create a directory, called sampledir, in your home directory and numerically set its permissions to everything for yourself, read for users in your group, and none to everyone
else. What command did you use to create the directory? What command did you use to
set privileges?
- Give the command for removing an empty directory called personal under your home directory. How would you remove it if the personal directory is not empty?
- What is an inode number in UNIX? Show the command for displaying the inode numbers for the root directory and your home directory (not the directory called /home).
- Suppose that umask is set to 022 on a system. What will be the default
permissions for the new directories and text files that you create? Explain
your answer.
Explanation / Answer
Is each of the following an absolute pathname, a relative pathname, or a simple filename?
milk_co
correspond/business/milk_co
/home/max d. /home/max/literature/promo
..
letter.0210
Answer:
milk_co
It is a simple filename
correspond/business/milk_co
It is a relative pathname
/home/max
It is absolute pathname
/home/max/literature/promo
It is also absolute pathname
…
simple filename
- What do dot (.), dotdot (..), and ~ represent in UNIX? Show use of all three.
Answer:
(dot) and ..(dot dot) represent the current and a level higher directories respectively.
.(dot)
The dot (.) points to the present working directory, that is, it tells the computer to look in the current directory. This means that cd. moves you nowhere. And, the command ./stomes1.sh tells the computer to look for the stomes1.sh script in the current directory.
..(dot dot):
The dot-dot (..) points to the directory just above the current working directory. So, for /home/stomes, the .. points to /home. But, this works in any directory, meaning that cd.. will always move you one level up the directory tree.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.