Almost everything in Unix is a file!

  • Regular files
  • Directories - Directories are just files listing a set of files
  • Symbolic links - Files referring to the name of another file
  • Devices and peripherals - Read and write from devices as with regular files
  • Pipes - Used to cascade programs.
    cat *.log | grep error
  • Sockets - Inter process communication

 

File names

File name features since the beginning of Unix

  • File names in linux are Case sensitive
  • File names in linux has No obvious length limit
  • File names in linux can contain any character (including whitespace, except /). File types stored in the file (“magic numbers”). File name extensions not needed and not interpreted. Just used for user convenience.
  • File name examples:
    README			.bashrc			Windows Buglist
    index.htm		index.html		index.html.old
    

 

File paths

A path is a sequence of nested directories with a file or directory at the end, separated by the / character

  • Relative path:
    $ documents/files/my_filwe.txt
    
    Relative to the current directory
  • Absolute path:
    $ /home/pc_name/dir/file_abc.txt
    
  • root directory.
    $ /
    
    Start of absolute paths for all files on the system (even for files on removable devices or network shared).