Question

Create a directory dir1 • Create a file file1 in dir1 • Go to home directory...

Create a directory dir1

• Create a file file1 in dir1

• Go to home directory

• Remove owner write permission permission for dir1

• Go to dir1

• Remove file1

Explain your observation?

Note: If you don't have write permission for a directory, then you can't delete a file in the directory. If you have write access to the file you can update the data in the file.

Homework Answers

Answer #1

First we perform the following steps:

1. Create a directory dir1
2. Create a file called file1 in dir1
3. Go back to home directory
4. Remove owner's write permission permission for dir1
5. Go inside to dir1

Now when we try to remove the file1 we will get the error as follows:

rm: cannot remove 'file1': Permission denied

The reason is as follows:

Although you still have the write property of file file1, deleting it means you are making changes to the directory dir1 it resides in, not the file itself. This is because a file is just an inode, and the directory refers to that inode. By removing it, you are just removing a reference to that file's inode in the directory. So the owner is changing the directory dir1 and not the file file1, hence the error.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Linux, please avocado is an empty file Q14 – Specify a single line command that gives...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives the owner and group permission to execute the file avocado while giving the owner sole permission to read and write the file. Do not change any other permission, i.e., do not remove permission from others to execute the file, if they already have that permission. Q15 – File/directory permissions are subject to permissions on the parent directories. For example, consider the file /home/dv35/cs265/lab1.txt. If...
PART 4: Learn about commands to navigate the directory tree structure: use the ls –ali /  ...
PART 4: Learn about commands to navigate the directory tree structure: use the ls –ali /   command to review the contents of the / directory Review the Linux Filesystem Standard (FSSTD) and document the following directories’ contents / ------- |--bin |--boot               |--dev               |--etc |--home               |--lib               |--mnt               |--opt               |--root               |--sbin               |--tmp               |--usr               |--var 3. use the cd etc  OR cd /etc  to change your default directory to the etc directory 4. use the...
What's appropriate setting for your home directory if you want to share some subdirectories, but don't...
What's appropriate setting for your home directory if you want to share some subdirectories, but don't want the anyone else to browse, add or remove entries in your home directory. 1. 700 2. 744 3. 755 4. 711
IN LINUX answer the following with what you would type to get the desired result. Change...
IN LINUX answer the following with what you would type to get the desired result. Change the permissions of the /home/shared/salesproject/ folder itself, allowing the owner and group full access, with no access for anyone else on the system. Log in as "susan" (password "secret") and make sure she can access the /home/shared/salesproject/ directory and files within. Create a file in /home/shared/salesproject/ as susan. What are the owner, group, and mode of the file she created? Log in as "sam"...
Suppose that you are a superuser on a Linux system, and there is a file “/home/bob/foo”,...
Suppose that you are a superuser on a Linux system, and there is a file “/home/bob/foo”, which is owned by an ordinary user Bob. You need to give a permission to read this file to an ordinary user Alice, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice.
Time: 10 minutes Objective: Create, view and extract tar archives. Description:  In this activity, the student will...
Time: 10 minutes Objective: Create, view and extract tar archives. Description:  In this activity, the student will use the tar utility to create, view, and extract a tar archive and use it options to name the tar file and view files as they are being archived and extracted. 1.     Start your Linux server virtual machine and sign-on with your individual user ID.  All Activities should begin in your home directory. 2.    Create a directory by typing  mkdir Act6-1 and press Enter.  Switch to this new directory...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
Create shell scripts, each in its own .sh file. Please include a shebang line at the...
Create shell scripts, each in its own .sh file. Please include a shebang line at the top of the script as well as appropriate comments through out. Write a script that uses sed to replace all instances of the name "Lizzy" with "Elizabeth" in a text file. Save the updated text in a new file named after the original text file with "-formal" appended before the file extension, e.g. old.txt -> old-formal.txt. Test this script on the data-shell/writing/data text files....
Create a client for your BankAccount classcalled BankAccountClient.java.    This a separate file from the BankAccount file....
Create a client for your BankAccount classcalled BankAccountClient.java.    This a separate file from the BankAccount file. Both files must be in the same directory to compile. Display all dollar amounts using the DecimalFormat class. Create an account Ask the user for the type of account, the bank account number, the amount that they will deposit to start the account. Set interest earned to 0. Print the account information using an implicit or explicit call to toString Update an account Use...
This program is in C++: Write a program to allow the user to: 1. Create two...
This program is in C++: Write a program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT