What does var mean in linux
In Linux, var means "changeable" and is the abbreviation of variable. It is a directory used to store data that needs to be changed when the system is running. The files stored in this directory often change and are often used for deployment. Project program files; usually the size of the directory where these data are located changes or expands frequently.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What does var mean in Linux
variable variable, volatile
The files stored in this directory often change (increase, Modify, delete)
Often used to deploy project programs (php) files
/var includes data to be changed when the system is running. These include directories that are specific to each system, that is, cannot be shared with other computers, such as /var/log, /var/lock, /var/run. Some directories can still be shared with other systems, such as /var/mail, /var/cache/man, /var/cache/fonts,/var/spool/news. The purpose of the var directory is to extract files that need to be changed or temporarily generated files and directories in the usr directory during operation, so that the usr directory can be mounted in a read-only manner. It is implicitly required that the var directory must be mounted in a readable and writable manner.
/var File system: /var contains data that needs to be changed during normal system operation. Usually the size of the directory where these data are located is frequently changed or expanded. It turns out that some contents in the /var directory are in /usr, but in order to maintain the relative stability of the /usr directory, directories that need to be changed frequently are placed in /var.
Through the analysis of this directory, pay attention to the following needs
1) The purpose and function of each directory.
2) What information can be obtained through the information in the directory, and how to access this information.
3) Is it safe to operate files in the directory?
Extended knowledge:
/var/account/pact
Purpose: This directory saves the process records used in the system . When a process terminates, each process writes a record to the statistics file (pacct or acct). The purpose of process statistics is to provide command usage statistics for basic services in the system. The file can be analyzed by data tools (sa, ac).
Usage: The process statistics subsystem is not activated by default, it must be started. To start process statistics in a Linux system, use the accton command, which must be run as root. The form of accton command is accton file, file must exist first. If it does not exist, first use the touch command to create the pacct file: touch /var/log/pacct, and then run accton: accton /var/account/pacct. Once accton is activated, you can use the lastcomm command to monitor the commands executed at any time in the system. To turn off statistics, use the accton command without any parameters.
pact files cannot be read directly with cat.
Note: This file will grow a lot and needs to be maintained (delete, dump)
/var/crash
Purpose: When the system crashes The dumped file can be used to analyze the reasons for machine down.
Use: crash tool to analyze the files in this directory. Reference document linux-2.6.20.6/Documentation/kdump/kdump.txt
crash -S /boot/System.map-2.6.18-53.el5PAE /boot/vmlinuz-2.6.18-53.el5PAE /var/crash/xxxx
/var/cache
Purpose: To store the cache data of the application. The data saved in this directory can be regenerated by the application. Therefore, the loss of data in this directory will not affect the system.
/var/lib
This directory saves status information during the running of the system or an application. Users are not allowed to change files in this directory.
/var/mail
The directory where mail storage files are linked to /var/spool/mail in CGS. In the fhs document, it is clearly stated that it should be extracted from /var/spool/mail so that it can be used by multiple applications on multiple hosts.
/var/opt
add-on application stores variables in this directory and static variables in /opt.
/var/tmp
Temporary files generated by the application can be sorted regularly. /usr/tmp -> ../var/tmp.
/var/lock
Many programs follow the convention of creating a lock file in /var/lock to support the specific device or file they are using. . Other programs are aware of this locked file and will not attempt to use this device or file. Note that this directory cannot be changed at will.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What does var mean in linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Linux is suitable for servers, development environments, and embedded systems. 1. As a server operating system, Linux is stable and efficient, and is often used to deploy high-concurrency applications. 2. As a development environment, Linux provides efficient command line tools and package management systems to improve development efficiency. 3. In embedded systems, Linux is lightweight and customizable, suitable for environments with limited resources.

Using Docker on Linux can improve development and deployment efficiency. 1. Install Docker: Use scripts to install Docker on Ubuntu. 2. Verify the installation: Run sudodockerrunhello-world. 3. Basic usage: Create an Nginx container dockerrun-namemy-nginx-p8080:80-dnginx. 4. Advanced usage: Create a custom image, build and run using Dockerfile. 5. Optimization and Best Practices: Follow best practices for writing Dockerfiles using multi-stage builds and DockerCompose.

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

The steps to start an Oracle listener are as follows: Check the listener status (using the lsnrctl status command) For Windows, start the "TNS Listener" service in Oracle Services Manager For Linux and Unix, use the lsnrctl start command to start the listener run the lsnrctl status command to verify that the listener is started

This article describes how to effectively monitor the SSL performance of Nginx servers on Debian systems. We will use NginxExporter to export Nginx status data to Prometheus and then visually display it through Grafana. Step 1: Configuring Nginx First, we need to enable the stub_status module in the Nginx configuration file to obtain the status information of Nginx. Add the following snippet in your Nginx configuration file (usually located in /etc/nginx/nginx.conf or its include file): location/nginx_status{stub_status

This article introduces two methods of configuring a recycling bin in a Debian system: a graphical interface and a command line. Method 1: Use the Nautilus graphical interface to open the file manager: Find and start the Nautilus file manager (usually called "File") in the desktop or application menu. Find the Recycle Bin: Look for the Recycle Bin folder in the left navigation bar. If it is not found, try clicking "Other Location" or "Computer" to search. Configure Recycle Bin properties: Right-click "Recycle Bin" and select "Properties". In the Properties window, you can adjust the following settings: Maximum Size: Limit the disk space available in the Recycle Bin. Retention time: Set the preservation before the file is automatically deleted in the recycling bin

In Debian systems, readdir system calls are used to read directory contents. If its performance is not good, try the following optimization strategy: Simplify the number of directory files: Split large directories into multiple small directories as much as possible, reducing the number of items processed per readdir call. Enable directory content caching: build a cache mechanism, update the cache regularly or when directory content changes, and reduce frequent calls to readdir. Memory caches (such as Memcached or Redis) or local caches (such as files or databases) can be considered. Adopt efficient data structure: If you implement directory traversal by yourself, select more efficient data structures (such as hash tables instead of linear search) to store and access directory information
