Skip to content

Commit 0f50695

Browse files
author
listout
committed
example of df command added to os-commands
1 parent b1005a0 commit 0f50695

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

OS/os-commands.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [top]()
55
- [ps aux]()
66
- [kill]()
7-
7+
- [df]()
88

99
***************
1010

@@ -164,3 +164,46 @@
164164
- [A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linux](https://www.tecmint.com/how-to-kill-a-process-in-linux/)
165165
- [How To Use ps, kill, and nice to Manage Processes in Linux](https://www.digitalocean.com/community/tutorials/how-to-use-ps-kill-and-nice-to-manage-processes-in-linux)
166166
- [Linux / Unix: killall Command Examples](https://www.cyberciti.biz/faq/unix-linux-killall-command-examples-usage-syntax/)
167+
168+
**************************
169+
## df
170+
171+
- `df` (abbreviated disk **d**isk **f**ree) is a standard Unix command used to display the amount of available disk space for file systems on which the invoking user has appropriate write access.
172+
- `df` for Unix-like and Linux systems is a part of X/Open portability guide since issue 2 of 1987.
173+
- Syntax:
174+
175+
```$ df```
176+
177+
```bash
178+
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
179+
/dev/hd4 32768 16016 52% 2271 14% /
180+
/dev/hd2 4587520 1889420 59% 37791 4% /usr
181+
/dev/hd9var 65536 12032 82% 518 4% /var
182+
/dev/hd3 819200 637832 23% 1829 1% /tmp
183+
/dev/hd1 524288 395848 25% 421 1% /home
184+
/proc - - - - - /proc
185+
/dev/hd10opt 65536 26004 61% 654 4% /opt
186+
```
187+
188+
- To get a more readable format we can pass the `-h` argument which displays in more human readable formats like `KB, MB, GB, or TB`
189+
190+
`$ df -h or df --human-redable`
191+
192+
```
193+
Filesystem Size Used Avail Use% Mounted on
194+
/dev/root 3.0G 2.3G 720M 77% /
195+
devtmpfs 123M 0 123M 0% /dev
196+
```
197+
198+
- Other useful arguments include
199+
- `-a or --all`: List all dummy, duplicate, or inaccessible files which are ommited by default.
200+
- `-k`: Use 1024-byte units, instead of default 512-byte units, when writing large figures.
201+
- `-P or --portabilty`: Use a POSIX portable output format, when writing to files.
202+
- `-t fstype or --type=fstype`: Limit the listing of the fstype. By default nothing is ommited.
203+
204+
### Resources:
205+
206+
- [Manual Page from GNU Coreutils](https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html)
207+
- [Linux General Commands Manual](https://www.mankier.com/1/df)
208+
- [FreeBSD General Commands Manual](https://www.freebsd.org/cgi/man.cgi?query=df&sektion=1)
209+
- [df commands examples](https://www.tecmint.com/how-to-check-disk-space-in-linux/)

0 commit comments

Comments
 (0)