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

The subject is UNIX. Please answer questions and include the Exercise number. Ex

ID: 3736308 • Letter: T

Question

The subject is UNIX.

Please answer questions and include the Exercise number.

Exercises:

4.1, A file in a file system with a block size of 1024 bytes contains 1026 bytes. How many bytes of disk space does it occupy?

4.4, Create a file foo. How do you assign all permissions to the owner and remove all permissions from others using (i) relative assignment and (ii) absolute assignment? Do you need to make any assumptions about foo’s default permissions?

4.9, You tried to copy a file foo from another user’s directory, but you got the error message cannot create file foo. You have write permission in your own directory. What could be the reason, and how do you copy the file?

4.10 What do you do to ensure that no one is able see the names of the files you have?

4.13 If the owner doesn’t have write permission on a file but her group has, can she (i) edit it, (ii) delete it?

5.2, How will you add /* at the beginning of a line and */ at the end?

5.6, In the midst of your work, how can you see the list of users logged in? If you have a number of UNIX commands to execute, which course of action will you take?

5.13, How will you search for a pattern printf and then repeat the search in the opposite direction from that in which the original search was made?

5.16, If the power to the machine is cut off while a vi session is active, how does it affect your work? What salvage operation will you try?

5.18 You made some changes to a read-only file and then found that you can’t save the buffer. What course of action will you take without quitting the editor?


Thank You!

                                                                          

Explanation / Answer

Please find my answer:

4.1 as the block size is 1024,but we have 1026 thus the disk space is 2 blocks i.e 2048.
4.4
Assumption that ur the owner as only the owner has permissions to alter permissions
relative when used with the + or - symbols
$touch foo --this creates empty file
chmod u=rwx foo ---assign all perms to user/owner
chmod o = -rwx ---remove al permission to others.
Absolutemode:
In this mode file permissions are not represented as characters but a three digit octal number.  
$ touch foo
$ chmod 700 foo --this removes all persmission to others and add all to user/owner
4.9
That would be because the way your current permissions are set, no one can move that file.
chmod -R o+rwx foo --this wil help with everyone the ability to read, write and execute on that directory.
4.10
renaming files with prefix dot(.) will hide ur files.
mv foo .foo
5.2
gsed command heps to add
gsed -i '1s/^/* /gm; $s/$/ *//gm' foo
5.3
w command or who command

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