Linux Variable (var) and Non-Standard directores command descriptions

‘var’ is short for variable.

Files that have an unexpected size. Whose content is expected to change continuously (that’s why it is named as variable) during normal operation of the system are stored here.

log files, spool files and cache files.

Like example of /var command :

# ls /var

If you run the the command you can see, command “ls /var” displays ‘/var’ content.

We’ll explain some of the /var sub-directories here:

/var/log
/var/cache
/var/spool
/var/lib

Linux /var/log command

The ‘/var/log’ directory contains all log files.

Like example of /var/log command :

# ls /var /log

Run the command “ls /var/log” displays the ‘/var/log’ content.

Linux /var/cache command

/var/cache directory stores application cache data. Cache data are locally generate by I/O or calculation. Cache must be able to regenerate or restore the data. These files can be delete without any loss of data.

Like example of /var/cache command :

# ls /var/cache

Linux /var/spool command

‘/var/spool’ directory is use to spool the files waiting to be process.

For example: printing queues and mail queues.

Like example of /var/spool command :

# ls /var/spool

Linux /var/lib command

Unix or Linux /var/lib directory stores the files that contains state information like databases. File’s data modifies as their respective programs run.

Like example of /var/lib command :

# ls /var/lib

Non-Standard Directories

Directories which do not come under the standard FHS are call non-standard directories.

Non-standard directories are as follows below :

/cdrom
/run
/lost + found

Linux /cdrom command

‘/cdrom’ directory is not in the standard FHS but cdrom can be mount on this directory. Ideally according to standard FHS cdrom should be mount under ‘/media’.

Like example of /cdrom command :

# ls /cdrom

Linux /run command

‘/run’ directory stores run-time variable data. Variable run time data means, data about the running system since last boot.

Like example of /run command :

# ls /run

Linux /lost + found command

The system during crash or in any other situation when Linux file system checker (fsck) recovers lost data, that data is store in this directory.

Like example of /lost+found command :

# ls /lost + found

Please dear If you understand, Then you can practice more and more. Thank you 🙂

Leave a Reply