E-learning module "Linux Basics"

Files and Directories

Files:

  • Every file is located within the directory tree.
  • Plain files contain data, e.g. text or pictures.
  • Special files exist for the periphery, network and communication channels (/dev directory).
  • Filenames can have at most 256 characters (and do not need extensions for the file type).
  • Filenames are case sensitive: Filename is not the same as filename.
  • Files starting with a dot . are hidden files (for example, ~/.bashrc) and are not displayed by the command ls , but by ls -a .

 
 

Directories:

  • Directories contain one or more files (e.g. plain files) and/or subdirectories.
  • There are clearly defined directions: a directory „up“ or further „down“ in the tree structure.
Every directory contains two special „directories“:
  • .   → A link to the current directory.
  • .. → A link to the directory above.
Therefore, it is possible to provide a path relative to the current location.

Examples for absolute and relative paths:

$ pwd
  /home/user1/Desktop → current location.

Change to the upper directory using an absolute path:
$ cd /home/user1
$ pwd
  /home/user1

Change to the upper directory using a relative path:
$ cd ../
$ pwd
  /home/user1

Question: What would  cd ./../ or cd ../../user1/ do instead?

The content of this e-learning module is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license (CC BY-NC-SA 3.0 DE).



Bisher wurde noch kein Kommentar abgegeben.