Previous Page | Next Page

  1. Agustin's Linux Manual
  2. System Administration
  3. About the Author
  4. Contents
  5. Administration
  6. Terminals
  7. Command Basics
  8. Root Directory
  9. Executing Commands
  10. File specs
  11. File Permission
  12. How permissions are assigned
  13. Change ownership chown
  14. Running multiple commands
  15. Killing Processes
  16. Bash configuration files
  17. VI Editor
  18. Creating path environment
  19. Midnight Commander
  20. Linuxconf Utility
  21. Networking
  22. Domain Name Service DNS
  23. Router and Gateway
  24. Adding Users
  25. User Accounts
  26. Managing Groups
  27. Mounting File System
  28. NFS Mounts
  29. Disk Quotas
  30. Run levels
  31. Linuxconf Control
  32. Mandrake Control Center
  33. Creating a Boot Disk
  34. Switching Boot Mode
  35. Hardware Configurations
  36. Printer Configuration
  37. Installing Printers
  38. Samba Printer
  39. Managing services
  40. Managing Users
  41. Program Scheduler
  42. Software Management
  43. Installing CUPS

File specs

Let's give a quick look at the following listing

[root@server2 collections]#ls l
total
-rw-r--r--1 rootroot6        Aug 1709:09 afile
-rw-r--r--1 rootroot27        Aug 1709:46 file2
-rw-r-- r--1 rootroot14        Aug 1709:46 myfile
drwxr-xr-x2 rootroot4096  Aug 1710:34 another/
-rw-rr--1 rootroot14        Aug 1710:46 original.myfile

[root@server2 collections]#
As you can see on the ls output, it gives you details of who owns the file, types of file and so on.

On the first column   rw-r--r--    drwxr-xr-x   these letters represent the rights on the files.

	r	read
	w	write
	x	execute
	d 	means it is a directory
	

You can also see a column 1 root it means that belongs to root. The third column root means group root. On the very right column it shows the date and hour when it was created. Because of that fact, those files belong to root; only root can modify them. To prove this theory, exit the super user mode go into your user's home directory and subdirectory collections.

Try to backup a file, use the cp command

[user1@server2 collections]$cp file2 file3
cp: can not create regular file 'file3': Permission denied
[user1@server2 collections]$

Now you can see how neat this is, you cannot do anything to those files even though it is sitting in a regular user's home directory because root has ownership of those files.

Try to remove the file using the remove command: rm

[user1@server2 collections]$ rm afile
rm: remove write-protected regular file 'afile'? y
rm: can not remove 'afile': Permission denied

[user1@server2 collections]$

See you cannot even remove the file or work at all in the directory collections. When the directory collection was created by root, it inherited its permission to all files and subdirectories. Only root can change the permission to these files and probably grant some permission to other users.
Now if you go one step up in your home directory, there you can write, delete or remove.