Sunday, July 17, 2005

Linux Filesystem

The concept of file system is entirely diffrent in linux and windows. Windows uses drives to organise your files and directories. Linux uses a single root directory (represented as / ) to organise files. Other things are organised as sub-directories of this root folder. In windows, you need to know the drive in which a file resides to access that file. But under linux, you can access that file by reffering to the root folder. Even if you have multiple hard disks, everything is under the root folder /. The following list gives a list of second level directories under linux.


/bin/ ---- system binaries, user programs with normal user permissions
/sbin --- executables that need root permission
/data/ --- a user defined directory
/dev/ ---- system device tree
/etc/ ---- system configuration
/home/ --- users' subdirectories
/home/{username} akin to the Windows My Documents folder,
where files owned by a specific person live
/tmp/ ---- system temporary files
/usr/ ---- application software
/usr/bin - executables for programs with user permission
/var/ ---- system variables
/lib/ ---- libraries needed for installed programs to run
/mnt/ ---- mounted partitions, such as those on CD-ROMs and floppies

Each and every device (including removable devices and fixed hard disks) is
represented in linux as a sub directory under the root folder.

Hidden files are also treat with some diffrence under linux. Windows keeps this information under the file metadata or file attributes. But under linux hidden files start with a period (aka - dot eg: '.myfile' is a hidden file).

No comments: