Chapter 3. Files, directories and Unix commands

Table of Contents
Unix commands for files and directories
Options in Unix commands
Some files of interest

The Linux file system is a hierarchical file system organized as a tree, files are said to reside in a directory, directories can contain sub-directories.

Each file has a unique absolute filename, e.g. /usr/bin/ssh, /etc/passwd, and /home/einstein/photoeffect.tex. File names may however also be given as relative file names. Such names are relative to the current working directory.


Unix commands for files and directories


Options in Unix commands

The default (standard) workings of many commands may be changed by supplementing them with an option. The options usually start with a hypen. Options are often used with the ls command. Try the following ones:

The last example gives a long listing

-rw-r--r--    1 olsson   olsson      23254 Aug 26 09:13 linux.mac
drwxr-xr-x    2 olsson   olsson       4096 Aug 25 14:37 html
The information given here is, in short:


Some files of interest

Certain files controls how the shell (Chapter 4), emacs (Chapter 5), and other programs behave. The most important of these are located in your home directory, they all start with a period ('.'), and are therefore not displayed when using ls unless the -a option is used:

$ cd
$ ls -a
.              .alias         .bash_profile  .cshrc
..             .bash_history  .bashrc        .mozilla
Of these, .bashrc contains startup instructions for your shell.

There is also lots of configuration information in the /etc directory. Your personal settings will, however, always take precedence.