Assume permissions on a file allow you to write to the file but not to delete it.

a. Give a command to empty the file without invoking an editor.
b. Explain how you might have permission to modify a file that you cannot
delete.

a. $ cat /dev/null > filename
b. To delete a file, you must have write and execute permission for the direc-
tory holding the file. To write to a file, you must have write permission

for the file and execute permission for the parent directory. When you
have write permission only for a file and execute permission only for the
directory holding the file, you can modify but not delete the file.

Computer Science & Information Technology

You might also like to view...

Which concept ensures that data is protected from unauthorized modification or data corruption?

A. Confidentiality B. Integrity C. Availability D. Identification

Computer Science & Information Technology

Which of the following statements about layered operating systems is true?

a) Layered operating systems group components that perform similar functions into layers. b) Layered operating systems are easier to modify than monolithic operating systems. c) User processes’ requests may need to interact with multiple layers, resulting in slower performance than in a monolithic system. d) all of the above.

Computer Science & Information Technology