Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Linux / Unix: please help as much as you can. Thanks. (1) Give commands for the

ID: 3854360 • Letter: L

Question

Linux / Unix: please help as much as you can. Thanks.

(1) Give commands for the following

a. Create the directory tree homework/project/.notes from your home directory in one command. Multiple commands must not be used

b. Change the mode of the directory ".notes" as executable only by you.

c. Modify the permissions of a file not readable or writeable or executable by *anyone*.. in one command. Then remove this file. Show commands to do this

(2) Give number equivalents of the following permissions

-r--rwxr--
-rwx-w--w-
----rwx---

(3) Write commands for the following

a. Create a symlink to $HOME/homework in /tmp. Name the link homework_link.
b. Create a hardlink to $HOME/homework in /tmp. Name the link as homework_hard
c. Set the permissions of a file to readonly for user, group and other without using numbers.
d. Redo the command c. with numbers
e. Add permissions to the same file so that group and other can write and execute. Do not use numbers.

Explanation / Answer

1. a. Creating a directory tree from home:

mkdir -p ~/homenetwork/project/.notes will create the directory tree accordingly.

Here -p will create the parent directories in the path if they don't readily exist.

b. Change the mode of the directory .notes as executable only by you.

By default the directory will have execute permissions to all the user, group, and other categories.

So, all you have to do is remove the execute permission to group, and other categories.

chmod go-x homenetwork/project/.notes/ will remove the executable permissions from everybody else.

c. To modify the permissions of a file not readable/writable/executable by anyone, all you need to do

is use the sudo before writing the command. sudo will give you admin authorization on that file,

which otherwise you (or anyone) is not authorized to access/modify the file.

So, to remove the file, all you have to do is:

$sudo rm fileName

2. a. The octal number system for the file permissions is: 4 for read, 2 for write, and 1 for execute.

So, -r--rwxr-- will give only read permission to user which will sum upto 4,

and will give all the read/write/execute permission to group which will sum upto 7,

and finally only read permission to other which will sum upto 4 again.

So, the number equivalent is: 474

b. On the same lanes, for -rwx-w--w- will give all permissions (7) to user, and only write permission (2)

to group and other. So, the number equivalent is: 722.

c. ----rwx--- is all permission to group members, and no permissions to anybody else.

The number equivalent is: 070

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote