Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Those functions under Linux you do not know the df command     - Linux environment variable configuration (Linux)

- MongoDB in bulk timestamp change the date format (Database)

- Linux environment Duplex (multi-machine) automatic mutual backup scheme (Linux)

- CentOS minimal network is unavailable resolved (Linux)

- CentOS 7 hard disk expansion toss record (Linux)

- Linux System Getting Started tutorial: Ubuntu desktop using the command line to change the system proxy settings (Linux)

- JBPM6 Installation and Configuration Tutorial (Linux)

- How Bluetooth turned off by default in Ubuntu 14.04 (Linux)

- OpenVPN offsite interconnecting room availability and load balancing solution (Server)

- Ubuntu install the camera driver (Linux)

- The virtual memory (Linux)

- ORA-14400: inserted partition key does not map to any partition (Database)

- Kernel compile under Debian (Linux)

- Ubuntu Linux use MAC binding against ARP attacks (Linux)

- An Example of GoldenGate Extract Process Hang Problem Solving (Database)

- CentOS 6.7 compile and install LAMP (Server)

- Use Ansible installation NGINX and NGINX Plus (Server)

- Compare several ways to transfer files between Linux hosts (Linux)

- redis main building and disaster recovery from a cluster deployment (Database)

- Spring3 + SpringMVC + Hibernate4 full annotation environment configuration (Server)

 
         
  Those functions under Linux you do not know the df command
     
  Add Date : 2017-08-31      
         
         
         
  Question: I know that I can use on Linux df command to view disk usage. Can you tell me the command df practical examples that I have to use it to maximize it?

For disk storage, there are a lot of command line or GUI-based tool that can tell you about the current disk space usage. These tools show a variety of human readable format, disk utilization details, such as easy-to-understand summary, detailed statistics or intuitive visual reports. If you want to know how many different file systems of free disk space, the df command may be what you need.

df command can display any disk utilization "mounted" file system. This command can be invoked in different ways. Here are some examples of useful df command.

With human readable way to display

By default, df command 1K blocks to show disk space, it looks not very intuitive. "-h" Parameter df make a more readable way to print disk space (for example, 100K, 200M, 3G).

$ Df -h
FilesystemSizeUsedAvailUse% Mounted on
/ Dev / mapper / Ubuntu-root 909G565G299G66% /
none 4.0K04.0K0% / sys / fs / cgroup
udev 3.9G4.0K3.9G1% / dev
tmpfs 785M1.2M784M1% / run
none 5.0M05.0M0% / run / lock
none 3.9G63M3.8G2% / run / shm
none 100M48K100M1% / run / user
/ Dev / sda1 228M98M118M46% / boot
Display Inode Usage

When you monitor disk usage, you must pay attention to not only the disk space as well as "inode" usage. In Linux, inode is a data structure used to store a particular file metadata when creating a file system, a pre-defined inode number will be assigned. This means that a file system may run out of space not only because the large files used up all the available space, it may be because many small files used all possible inode. With the "-i" option to display inode usage.

$ Df -i
FilesystemInodesIUsedIFreeIUse% Mounted on
/ Dev / mapper / ubuntu-root 605143041217535592967693% /
none 10044171310044041% / sys / fs / cgroup
udev 100062355210000711% / dev
tmpfs 100441760810038091% / run
none 10044171110044061% / run / lock
none 100441728810041291% / run / shm
none 10044172810043891% / run / user
/ Dev / sda1 1244963461241501% / boot
Display total disk usage

By default, df command displays the utilization of a single file system disk. The total disk usage if you want to know all file systems, increase "--total" option (see the bottom of the summary line).

$ Df -h --total
FilesystemSizeUsedAvailUse% Mounted on
/ Dev / mapper / ubuntu-root 909G565G299G66% /
none 4.0K04.0K0% / sys / fs / cgroup
udev 3.9G4.0K3.9G1% / dev
tmpfs 785M1.2M784M1% / run
none 5.0M05.0M0% / run / lock
none 3.9G62M3.8G2% / run / shm
none 100M48K100M1% / run / user
/ Dev / sda1 228M98M118M46% / boot
total 918G565G307G65% -
Display file system type

By default, df command does not display a file system type information. With "-T" option to add the file system information to the output.

$ Df -T
FilesystemType1K-blocks UsedAvailableUse% Mounted on
/ Dev / mapper / ubuntu-root ext4 95289334859158329231288284466% /
none tmpfs 4040% / sys / fs / cgroup
udev devtmpfs 4002492440024881% / dev
tmpfs tmpfs 80353611968023401% / run
none tmpfs 5120051200% / run / lock
none tmpfs 40176686017639574922% / run / shm
none tmpfs 102400481023521% / run / user
/ Dev / sda1 ext2 23319110002512072546% / boot
Include or exclude specific file system type

If you want to know the remaining space specific file system type, with the "-t" option. You can use this option to include many more file system types.

$ Df -t ext2 -t ext4
Filesystem1K-blocks UsedAvailableUse% Mounted on
/ Dev / mapper / ubuntu-root 95289334859158338031288275666% /
/ Dev / sda1 23319110002512072546% / boot
Exclude specific file system type, use the "-x" option. Also, you can use this option multiple times to exclude multiple file system types.

$ Df -x tmpfs
Display a specific mount point disk usage

If you specify a mount point with df, it reports that mount in place of the file system's disk usage. If you specify a regular file (or a directory) instead of a mount point, df show disk usage will include this file (or directory) file system.

$ Df /
Filesystem1K-blocks UsedAvailableUse% Mounted on
/ Dev / mapper / ubuntu-root 95289334859158352831288260866% /
$ Df / home / dev
Filesystem1K-blocks UsedAvailableUse% Mounted on
/ Dev / mapper / ubuntu-root 95289334859158352831288260866% /
Information displayed virtual file system

If you want to display all existing file systems (including virtual file system) disk space information, with the "-a" option. Here, the virtual file system means that no corresponding physical device fake file system, for example, tmpfs, cgroup virtual file system or FUSE file system security. The virtual file system of size 0 without "-a" option will not be reported.

$ Df -a
Filesystem1K-blocks UsedAvailableUse% Mounted on
/ Dev / mapper / ubuntu-root 95289334859157871631288742066% /
proc 000- / proc
sysfs 000- / sys
none 4040% / sys / fs / cgroup
none 000- / sys / fs / fuse / connections
none 000- / sys / kernel / debug
none 000- / sys / kernel / security
udev 4002492440024881% / dev
devpts 000- / dev / pts
tmpfs 80353611968023401% / run
none 5120051200% / run / lock
none 40176685814439595242% / run / shm
none 102400481023521% / run / user
none 000- / sys / fs / pstore
cgroup 000- / sys / fs / cgroup / cpuset
cgroup 000- / sys / fs / cgroup / hugetlb
/ Dev / sda1 23319110002512072546% / boot
vmware-vmblock 000- / run / vmblock-fuse
     
         
         
         
  More:      
 
- To install Samba server on CentOS 6.6 (Server)
- Select helps secure the system network management tools (Linux)
- Bug tracking library after FastJson omitted the decimal point 0 (Programming)
- When a software RAID data recovery and reconstruction of how failure (Linux)
- MongoDB replication instance (Database)
- How to query the role of Linux services (Linux)
- RedHat6.4 installation tutorial --- Minimal Edition (Linux)
- Linux program analysis tool: ldd and nm (Linux)
- Oracle create a temporary table space group (Database)
- Security Knowledge: How to hide a backdoor PHP file tips (Linux)
- How to implement large-scale distributed Yahoo depth study on the Hadoop cluster (Server)
- EChart simple and practical control on chart (Programming)
- How to set the default Fedora from the command line (Linux)
- Build RPM package uses Docker mirror (Linux)
- Ubuntu users to install the system indicator SysPeek 0.3 (Linux)
- OpenCV 3.0 + Python 2.7 installation and testing under Ubuntu 14.04 (Linux)
- Redis data types Introduction (Database)
- Linux Getting Started Tutorial: Ubuntu laptop screen brightness adjustment (Linux)
- Ubuntu set Swap Space Tutorial (Linux)
- Linux shell scripts bubble sort (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.