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

The root Directory

Command ls / this command lists the root directory

[agustin@server2 agustin]$ ls /
	bin/	boot/	dev/	etc/	home/	initrd/	lib/	mnt/	opt/
	proc/	root/	sbin/	tmp/	usr/	var/

Throughout the decade, developers had tried to define standards for the file system hierarchy and for what each of these directories should be used for. But even with the efforts of all these people there are still variations among all distributions.

/root directory of the entire system
/binholds system executables
/sbinholds system executables and are essential for starting up the system
/bootholds the files needed during the booting process including the kernel
/devit is a special directory that holds information regarding peripherals /dev/ttys0, /dev/had, etc.
/homeholds all the home directories for all users except root
/libholds system binary libraries, shared libraries and kernel module
/opthere is where optional applications might go
/rootthis is the home directory for super user, do not confuse this folder with /
/tmpHere is where temporary files are stored; it is usually emptied when systems restart.
/varis where variable system files go, system logging, file locks, printer Spooling, mail spooling and many others.
/etcThis directory holds almost all configuration files. As administrator you will spending most of your time tweaking settings in this folder.
/initrdthis directory is used at boot time, in the initrd to perform pivot_root
/mntThis directory is used as a mount point. Here you can temporarily mount medias such as CD-ROM, zip and other file systems. Example: /mnt/windows, /mnt/floppy, mnt/cd-rom
/procthis directory is used as a kernel information access hooks, example of usage:

[agustin@server2 proc]$cat cpuinfo
[agustin@server2 agustin]$cat filesystems

/usrIt is a very large directory, holds application programs; it also has several important additional directories.
/usr/bincontains binaries executables
/usr/includeThis directory contains C headers with various libraries applications.
/usr/localapplication programs used locally

The Print working directory command: pwd

	[agustin@server2 agustin]$ pwd
	[agustin@server2 agustin]$

The command whoami, displays who you are at the current prompt

[agustin@server2 agustin]$ whoami

[agustin@server2 agustin]$

If you want to know who is logged into the entire system use the who command

	[agustin@server2 agustin]$ who
	agustin	vc/1	Aug 17 07:38
	root		vc/2	Aug 19 06:51
	user1		vc/3	Aug 19 06:46

	[agustin@server2 agustin]$

Switching from regular user to root
To gain root's power temporarily use: su

[agustin@server2 agustin]$ su
Password:*******	(when you  are typing the password, you can not  see it)

[root@server2 agustin]# whoami

[root@server2 agustin]#

Observe your prompt, it has been changed. When you are in this mode you can do anything; be careful how you use the super user account. Protect the root account at all cost.

The root account is strictly used for system administration. Any regular user cannot do things that are strictly for root unless root grants the right to the user.