-
Notifications
You must be signed in to change notification settings - Fork 0
/
diskspace_usage.txt
48 lines (38 loc) · 1.81 KB
/
diskspace_usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
View info about your filesystem and available disk space:
Ref: https://www.howtogeek.com/409611/how-to-view-free-disk-space-and-disk-usage-from-the-linux-terminal/
df #dumps all file system
df -h #dumps all file system in readable format
Here is a brief explanation about the display on terminal:
Fileystem: The name of this filesystem.
1K-Blocks: The number of 1K blocks that are available on this filesystem.
Used: The number of 1K blocks that have been used on this file system.
Available: The number of 1K blocks that are unused on this file system.
Use%: The amount of space used in this file system given as a percentage.
File: The filesystem name, if specified on the command line.
Mounted on: The mount point of the filesystem.
Flags:
-B -> block size
df -BM #display all files in Megabytes
--total -> ads a bottom line total
df --total
df --total -BM #display total in megs
-T -> type of files
df -T #provides input as to type of file
-x -> exclude specific types of files
df -x squashfs
df -x squashfs --total
df /dev/sda* #displays size of HDD
df -h --total /dev /run #display size of folders
Output and aliasing:
Let's create an alias allowing to see disk space usage.
Parameters:
source: The name of the filesystem.
fstype: The type of the filesystem.
size: The size of the filesystem, by default in 1K blocks.
used: The space used on the filesystem, by default in 1K blocks.
avail: The available space on the filesystem, by default in 1K blocks.
pcent: The percentage of used space on the filesystem in inodes, by default in 1K blocks.
file: The filesystem name if specified on the command line.
target: The mount point for the filesystem.
alias diskSpace="df -h /dev/sda1 --output=source,fstype,size,used,avail,pcent"
Calling diskSpace will show HDD source / type / size / used / available / percentage in human readable format