du df free command in linux to check disk space | Pro Tech guides

du df free command in linux to check disk space

df command shows available disk space in your system. du command in Linux is used to find the amount of used memory in your files and folders.

Linux command to check disk space in files | folders | System

du, df and free command in linux
check disk space in linux

Hello, guys Today I'm going to show you a bunch of commands.

Which you can use to view the "free resources" and used resources in your Linux operating system.

So let's get started,

df command

The first command which I'm going to show you is the "df" command and this "df" command report the amount of "available disk space" being used by your filesystem.

df command in linux to check disk space
df command in linux

$df
For example, I'm in my "home directory" Now I just give this "df" command.

And now it gives me this kind of output.

But what is these numbers doesn't have any units on it.

And we cannot easily understand what amount of "disk space" is being used and what amount of disk space is available.

df command in linux with -h flag
df command with "-h" flag

$df -h
So for making it "Human-readable" use "-h" flag with this command. Just write "df -h"

  • "-h" stands for Human Readable.

So when you give this "-h" flag with this "df" command.

You will be able to see the human-readable form of the output.

du command

So the next command I'm going to show you is the "du" command.

This "du" command is used to estimate and display the disk space used by "files".

du command in linux to check disk space in files
du command in linux

$du -h

For example, I'm in my "root directory" and I want to estimate the space used in this folder called "usr".

I will just go to the "usr" folder and then just write "du -h" and press ENTER

So it's going to give you all this output and at the last, it's going to give you the amount of space used by this "usr folder".


du command with Summary flag [-s]

When you give the "du" command. It prints all files first and then gives you the memory disk space usage.

When you run this command in large folder. It takes more time and also prints unnecessary outputs.

So I just want to see only the "final output" not all the output related to files.

du command in linux with summary flag -s
du command with summary flag

$sudo du -sh
For that I can use "sudo du -sh" and press ENTER

  • This "-s" flag is for Summary.
  • "-h" for Human Readable.

Then it's going to calculate the memory and in few seconds you are going to see all the memory used.

So this "du" command will help you to estimate and display the disk space used by "files". 

free Command

Now the third command which I'm going to show you is the "free" command.

"free" command displays the total amount of free and used physical and swap memory in the system as well as the buffer used by the kernel.

Free command in linux
Free command in linux

$free
So you can just use "free" and then press ENTER

It's going to give you the used space, free space and the cache space which is used by your kernel.


But this is also not human-readable so there are some flags. Which you can use with this free command and these flags are,

  • "-b" for byte.
  • "-k" for kilobyte.
  • "-m" for megabyte.
  • "-g" for gigabyte.
  • "-t" for terabyte.


So these are the command which you can use to view the memory usage in your system.


Conclusion

  • "df" command:- used to report the amount of available disk space being used by your file system.
  • "du" command:- To estimate and display that disk space used by the files.
  • "free" command:- To display the total amount of free and used physical and swap memory in the system.

So in this way you can use the memory in your system.

I hope you enjoyed this tutorial please rate comment and bye.

HAVE A NICE DAY💖

Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: du df free command in linux to check disk space
du df free command in linux to check disk space
df command shows available disk space in your system. du command in Linux is used to find the amount of used memory in your files and folders.
https://1.bp.blogspot.com/-0NRmAOunjto/YAbpQNMacDI/AAAAAAAADAY/CsyuoCnpVTgAapezygfhA1Ax7Dydfrf3gCNcBGAsYHQ/s16000/disk-space.jpg
https://1.bp.blogspot.com/-0NRmAOunjto/YAbpQNMacDI/AAAAAAAADAY/CsyuoCnpVTgAapezygfhA1Ax7Dydfrf3gCNcBGAsYHQ/s72-c/disk-space.jpg
Pro Tech guides
http://www.protechguidez.com/2021/01/du-df-free-command-in-linux-to-check.html
http://www.protechguidez.com/
http://www.protechguidez.com/
http://www.protechguidez.com/2021/01/du-df-free-command-in-linux-to-check.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content