Flux rss
Bookmark Bookmark & Share
UNIX - I file UNIX - Os ficheiros Unix- Die Dateien UNIX - Les fichiers UNIX: Archivos

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.
UNIX Commands Table of the main UNIX commands Unix Commands Description Options ls lists the content of a directory -a Displays all files, including hidden files -I Displays a... en.kioskea.net/contents/unix/unixcomm.php3
Converting DOS /UNIX and vice-versa Converting DOS /UNIX and vice-versa Intro Conversion DOS to UNIX / UNIX to DOS Conversion from DOS to UNIX Conversion from UNIX to DOS Intro Though there are (dos2unix and unix2dos) utility programs capable of performing this task,... en.kioskea.net/faq/sujet-1313-converting-dos-unix-and-vice-versa
Modify file or folder creation date Hello, i want to change the original file creation and modification date to new. how to change folder or file creation date. plz help me en.kioskea.net/forum/affich-35052-modify-file-or-folder-creation-date
MacOS X: Delete obstinate FilesMacOS X: Delete obstinate Files It may happens sometimes when trying to empty the recycle bin and that the files or folders you want to delete it still refuses to disappear. To resolve this problem, use a UNIX command in Terminal.... en.kioskea.net/faq/sujet-1547-macos-x-delete-obstinate-files
How to read a file line by lineHow to read a file line by line Intro Tips Bonus Intro One of the most common errors of learning scripts bash on GNU / Linux is to read a file line by line, is to use a loop "for" (for line in $ (cat file.txt) do. ..), which in this... en.kioskea.net/faq/sujet-1757-how-to-read-a-file-line-by-line
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
Windows bat file to connect to the Unix systeHello, I want to create a batch file on my Windows application which can connect to the Unix server run few command on the Unix server and exit the batch file. Any automated script or batch file which allows me to execute command on remote Unix server... en.kioskea.net/forum/affich-97336-windows-bat-file-to-connect-to-the-unix-syste
Tar-file contents on windows from cmd lineHello, I have tar-files on the windows platform and I want to have a listing of the tar-contents. Something similar to the unix tar tvf command. There are of course tools with a graphical interface, but I am searching for a command line call, because... en.kioskea.net/forum/affich-55710-tar-file-contents-on-windows-from-cmd-line
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
Download Multiple File Search and ReplaceMultiple File Search and Replace is an application that lets you find and replace files or its contents. It is then possible to quickly search many files, and add text or links in many Web pages for example. Indeed, the software is designed for... en.kioskea.net/telecharger/telecharger-1966-multiple-file-search-and-replace
Download Bluetooth File SenderBluetooth File Sender is a management software of portable telephone files allowing you to use PC as a mobile phone. With this kit, you have access to your telephone from your PC as to another PC in a network. The interface is easy to use and you can... en.kioskea.net/telecharger/telecharger-2660-bluetooth-file-sender
Download Easy File LockerTo keep your privacy and secure up your data on your machine, the best way is to hide them altogether. Easy File Locker is primarily a tool to block access, modification, reading, deleting, moving or copying your files or folders. But to make... en.kioskea.net/telecharger/telecharger-1082-easy-file-locker
FTP protocol (File Transfer Protocol)Introduction to FTP protocol FTP protocol (File Transfer Protocol) is, as its name indicates a protocol for transferring files. The implementation of FTP dates from 1971 when a file transfer system (described in RFC141) between MIT machines... en.kioskea.net/contents/internet/ftp.php3
Introduction to UNIX systemsThe UNIX system 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... en.kioskea.net/contents/unix/unixintro.php3
File formats and extensionsComment: The list below is not exhaustive and certain extension names may have several functionalities. As for the programmes proposed for using these files, they are not necessarily the only ones or the most appropriate... en.kioskea.net/contents/systemes/format.php3