Javatpoint Logo
Javatpoint Logo

Variable Directory (/var)

The term 'var' is short for varible. Files that have an unexpected size and whose content is expected to change continuously (that's why it is named as variable) during normal operation of the system are stored here. For example, log files, spool files and cache files.

Example:

Linux fhs variable directory1

Look at the above snapshot, command "ls /var" displays '/var' content.

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

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

/var/log

The '/var/log' directory contains all log files.

Example:

Linux fhs variable directory2

Look at the above snapshot, command "ls /var/log" displays the '/var/log' content.

/var/cache

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

Example:

Linux fhs variable directory3

ls /var/cache

Look at the above screenshot, command "ls /var/cache" displays the '/var/cache' content.

/var/spool

The '/var/spool' directory is used to spool the files waiting to be processed. For example, printing queues and mail queues.

Example:

Linux fhs variable directory4

Look at the above screenshot, command "ls /var/spool" displays the '/var/spool' content.

/var/lib

The '/var/lib' directory stores the files that contains state information like databases. File's data modifies as their respective programs run.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA