Linux exercise 7 - File permissions

  1. Create a new file first.txt and a new directory second to your user's home directory. What are the permissions for newly created file and directory?
  2. Change file (first.txt) permissions using numerical format in the following way: owner → all permissions, group → read and write permissions and other → no permissions. Return original permissions for the file using symbolic format.
  3. Change root or other user for the owner for the directory (second).
  4. Change directory permissions in a way that only owner has permissions for the directory.
  5. Create a new file and set root or other user as a file owner.
  6. Create two files: hard_link.txt and soft_link.txt. Create hard and soft link for these files according to file names. Check the results with ls -l command. What does the output of the command tell about the links and how do links differ? Remove the files you created and recheck the results with ls -l command. What differences do you notice?
  7. Use find command to list /etc directory contents including only files with .conf extension and starting with letter l (small l, not capital I). Do not include files from subdirectories!
  8. Below is a presentation of a directory structure where temperature data from sensors s1, s2 and s3 has been saved for log files under sensor specific directories. Create this directory structure with files. Important: Check the location of this directory structure within the Linux filesystem!
  9. Users user (regular user) and root have been marked for the directory presentation below. Create the following permissions: user can only access the first sensor's temp.log file and root has access to the whole directory structure. User should have adequate permissions for reading and editing the temp.log file.

Linux excercise 7 - File permissions