Flux rss

UNIX - Files

Introduction to UNIX files

In UNIX systems any element is represented in the form of a file. All files are architectured around a single tree structure where the base, called the root, is written "/".

File types

UNIX systems define different file types:

  • Physical files, entered on the hard disk. This is a file in the generally understood sense of the word;
  • Directories are files (nodes) of the tree structure able to contain files or other directories. A directory contains at least a parent directory (written ..), relating to the directory at the higher level, and a current directory (written .), i.e. itself;
  • Links are special files enabling several names (links) to be associated to a single and same file. This system makes it possible to have several instances of the same file in several places in the tree structure without needing to copy it, which in particular helps to ensure maximum coherence and save on disk space. There are two types of links:
    • Symbolic links representing virtual pointers (shortcuts) to the real files. In the event that a symbolic link is deleted, the file which it points to is not deleted. Symbolic links are created using the In -s command according to the following syntax:
      ln -s name-of-real-file name-of-symbolic-link
    • Physical links (also called hardlinks) represent an alternative name for a file. So, when a file has two physical links, the deletion of one or other of these links does not lead to the deletion of the file. More specifically, while there is at least one physical link remaining, the file is not deleted. On the other hand, when all physical links for the same file are deleted the file is too. Please note however, that it is only possible to create physical links within the single and same file system. Physical links are created using the In (without the option -n) command according to the following syntax:
      ln name-of-real-file name-of-physical-link
  • Virtual files do not really exist because they only exist in the memory. These files, located in particular in the /proc directory contain information about the system (processor, memory, hard disks, processes, etc.);
  • The Device files located in the /dev/ directory relate to the system devices. This concept may be disconcerting for a new user for the first time.

The concept of mount points

Files in a UNIX system are organised into a single tree structure. It is however possible to have several partitions using a mechanism called mounting which makes it possible to connect a partition to a directory in the main tree structure. So, the fact of mounting a partition in the directory /mnt/partition makes all the files in the partition accessible from this directory, called the "mount point".

File hierarchy under Unix

To ensure compatibility and portability, UNIX systems comply with the FHS (File Hierarchy Standard) standard. The basic hierarchy of a Unix system is as follows:

/the root, containing the main directories
/binContains the executables necessary for the system, used by all users.
/bootContains the loading files for the kernel, including the bootstrap loader.
/devContains entry points for the devices.
/etcContains the configuration files required for the administration of the system (files passwd, group, inittab, ld.so.conf, lilo.conf, etc.)
/etc/X11contains specific files for the configuration of X (contains XF86Config, for example)
/homeContains the users' personal directories. Insofar as the directories located under /home are intended to host the user files for the system, you are advised to dedicate a specific partition to the /boot directory in order to limit damage in the case of disk space saturation.
/libContains standard libraries shared between the system's different applications.
/mntMakes it possible to host the mount points of temporary partitions (CD-Rom, floppy disk, etc.)
/procMerges a collection of virtual files making it possible to obtain information about the system or processes being executed.
/rootRoot administrator's personal directory. The administrator's personal directory is located apart from the other personal directories because it is located in the root partition so as to be able to be loaded at the start, before the mounting of the /home partition.
/sbinContains essential system executables (for example the command adduser).
/tmpcontains temporary files
/usrSecondary hierarchy
/usr/X11R6this directory is reserved for system X version 11 release 6
/usr/X386used before by X version 5, this is a symbolic link to /usr/X11R6
/usr/bincontains the majority of binary files and user commands
/usr/includecontains header files for the programs C and C++
/usr/libcontains most of the shared libraries for the system
/usr/localcontains data relating to the programs installed on the local machine by the root
/usr/local/binBinaries for local programs
/usr/local/includeLocal C and C++ header files
/usr/local/libShared local libraries
/usr/local/sbinLocal system binaries
/usr/local/shareIndependent hierarchy
/usr/local/srcLocal source files
/usr/sbincontains binary files not essential for the system that are reserved for the system administrator
/usr/sharereserved for non-dependent data of the architecture
/usr/srccontains source code files
/varcontains changeable data such as database files, logs, files for the print spooler or even waiting emails.


Last update on Thursday October 16, 2008 02:43:15 PM.
This document entitled « UNIX - Files » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Results for UNIX Files

Linux - Tree structure of files To ensury compatibility and portability, Linux systems comply with the sole FHS (File Hierarchy Standard) standard. The basic hierarchy is as follows: /the root, containing the main directories /bincontains essential executables of the system, used... en.kioskea.net/linux/linarb.php3
Wrinting a script to move files Hello, I need to write a script that will search a directory and its subfolders for *.txt files and *.tiff files, each .txt file having a corresponding .tiff file, the files will be located in different folders within the directory which will be... en.kioskea.net/forum/affich-26659-wrinting-a-script-to-move-files
Linux - User management When several people have access to a system, the administrator must manage the users. To do so, he must know the common commands and files to be configured. The important files are: the /etc/passwd file the /etc/group file The /etc/passwd file... en.kioskea.net/unix/unix-users.php3

Results for UNIX Files

Print Screen (Windows, Mac OS X and Unix/Linux)How to make a Print Screen (Windows, Mac OS X and Unix/Linux) What is a Print Screen? How to make a Print Screen (Windows) How to make a Print Screen (Mac OS X) How to make a Print Screen (Unix/Linux) Screen Capture Softwares What is a... en.kioskea.net/faq/sujet-141-print-screen-windows-mac-os-x-and-unix-linux
Create and Open a RAR fileCreate and Open a RAR file How to create a RAR file How to open a RAR file RAR is an archive file format that is used during data compression, error recovery and file spanning. RAR is the acronym for Roshal Archive, inspired by the... en.kioskea.net/faq/sujet-143-create-and-open-a-rar-file
To see the content of a .jar file.To see the content of a .jar file. A simple method to see the content of a .jar file: firstly rename it in .zip file and open it. If you want to see the content of java programs compiled in .class, you must use a Java decompiler like JAD: (a... en.kioskea.net/faq/sujet-556-to-see-the-content-of-a-jar-file

Results for UNIX Files

Move files from windows to Unix in Visual basHi , I want to move files from Windows to Unix , can i do it with Visual Basic programming or Access . Please let me know , as i have to transfer files. en.kioskea.net/forum/affich-14131-move-files-from-windows-to-unix-in-visual-bas
I need to remove remote machine fileHello, i need to remove remote linux server file from my local unix server.now i write unix shell script in unix server A and remove files from linux server B. thanks in advance. Jack en.kioskea.net/forum/affich-44303-i-need-to-remove-remote-machine-file
Problem with space (Solved)Hi All, I have a flat file contains some records, I have to add a header and trailer to that flat file and store that in a new file. I am not aware of how to put the space using unix commands, like in RPAD('BILLS',10,' ') in Sql... en.kioskea.net/forum/affich-1342-problem-with-space

Results for UNIX Files

Download StuffIt ExpanderSystem requirements : Mac OS 10.4 or higher. StuffIt Expander file expansion software expands and decodes any compressed file you download from the Internet or receive attached to your email. It expands StuffIt archives, unzips Zip files... en.kioskea.net/telecharger/telecharger-118-stuffit-expander
Download Tail AceTail Ace is an utility of chase for Windows. It works as the orders of chase UNIX but with more functionality.Program can work on several files all at once. Add it directly your favorite files so that you do not have to search the same files in every... en.kioskea.net/telecharger/telecharger-535-tail-ace
Download Switch File Format ConverterSwitch is an utility of audio conversion for Windows. Switch is very easy to use. It is enough to add the file to convert in the list, to choose desired format and to clicker conversion on the button.It inserts a simple and intuitive interface. The... en.kioskea.net/telecharger/telecharger-785-switch-file-format-converter

Results for UNIX Files

Swedish court convicts man of file sharingA student downloads music from a file-sharing website in 2001. A Swedish court has handed down a suspended sentence and a 10,000-kronor (1,655-dollar, 1,070-euro) fine to a man found guilty of sharing some 4,500 music files and 30 films on the... en.kioskea.net/actualites/swedish-court-convicts-man-of-file-sharing-10338-actualite.php3

Results for UNIX Files

UNIX system - Commands Unix Commands Description Options ls lists the content of a directory -a Displays all files, including hidden files -I Displays a detailed listing -R Displays the files recursively (i.e. in the sub-directories) -d Displays only the directories and... en.kioskea.net/unix/unixcomm.php3
Uuencode/Uudecode UUencode encoding (a contraction of Unix-to-Unix encode) is an algorithm for converting 8-bit binary data into a 7-bit format. Uuencoding was originally created for sending binary files using the email protocol uucp. The uucp system translated the... en.kioskea.net/base/uuencode-uudecode.php3
UNIX system - Introduction The Unix system is a multi-user, multi tasking operating system which means that it allows a single or multiprocessor computer to simultaneously execute several programs by one or several users. It has one or several command interpreters (shell) as... en.kioskea.net/unix/unixintro.php3