Understanding UNIX
Understanding UNIX
A conceptual understanding of file system, especially data structure and related terms will help
you become a successful system administrator. I have seen many new Linux system
administrator w/o any clue about file system. The conceptual knowledge can be applied to
restore file system in an emergency situation.
What is a File?
File are collection of data items stored on disk. Or it's device which can store the information,
data, music (mp3), picture, movie, sound, book etc. In fact what ever you store in computer it
must be inform of file. Files are always associated with devices like hard disk ,floppy disk etc.
File is the last object in your file system tree. See Linux/UNIX - rules for naming file and
directory names.
What is a directory?
Directory is group of files. Directory is divided into two types:
• Root directory - Strictly speaking, there is only one root directory in your system, which
is denoted by / (forward slash). It is root of your entire file system and can not be
renamed or deleted.
• Sub directory - Directory under root (/) directory is subdirectory which can be created,
renamed by the user.
Directories are used to organize your data files, programs more efficiently.
# cat /proc/cpuinfo
# cat /proc/sys/net/ipv4/ip_forward
# echo "1" > /proc/sys/net/ipv4/ip_forward
# echo "0" > /proc/sys/net/ipv4/ip_forward
• NFS: Network file system allows many users or systems to share the same files by using
a client/server methodology. NFS allows sharing all of the above file system.
• Linux also supports Microsoft NTFS, vfat, and many other file systems. See Linux kernel
source tree Documentation/filesystem directory for list of all supported filesystem.
You can find out what type of file systems currently mounted with mount command:
$ mount
OR
$ cat /proc/mounts
• / - Special file system that incorporates the files under several directories including
/dev, /sbin, /tmp etc
• /usr - Stores application programs
• /var - Stores log files, mails and other data
• /tmp - Stores temporary files