Linux 103 Training MOdule Basic System Mgmt
This presentation will cover the following commands df free
df command df command in Linux provides disk space usage information of file systems. $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 132239776 6210884 119311504 5% / tmpfs 4021876 0 4021876 0% /dev/shm /dev/sdb2 30969600 117740 29278696 1% /home/oracle
Option -h stands for “human” readable format. G is used for gigabytes and M is used for megabytes. $ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 127G 6.0G 114G 5% / tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sdb2 30G 115M 28G 1% /home/oracle /dev/sdc1 550G 70M 522G 1% /home/data Display Grand Total in the Output Display a grand total of every column then we can use the ‘–total’ flag. $ df -h --total total 710G 6.2G 668G 1%
Free command Display amount of free and used memory in the system By default without any options, free command shows the used and free space of physical and swap memory in KB units as shown below, $ free total used free shared buffers cached Mem: 509336 462216 47120 0 71408 215684 -/+ buffers/cache: 175124 334212 Swap: 915664 11928 903736 2. Switch the free Output in KB, or MB, or GB Free allows to display the size of memory space in bytes or KB or MB or GB as shown below, $ free -b Mem: 521560064 474198016 47362048 0 73826304 220983296 -/+ buffers/cache: 179388416 342171648 Swap: 937639936 12210176 925429760
$ free -k total used free shared buffers cached Mem: 509336 463084 46252 0 72104 215804 -/+ buffers/cache: 175176 334160 Swap: 915664 11924 903740 $ free -m Mem: 497 452 45 0 70 210 -/+ buffers/cache: 171 326 Swap: 894 11 882 To display the totals line at the end, execute free command with -t option $ free -t Mem: 509336 463332 46004 0 72256 215804 -/+ buffers/cache: 175272 334064 Total: 1425000 475256 949744