du stands for disk usage. This simple linux command provides a summary of harddisk or storage space disk usage. It has many parameter arguments that can provide results in many screen format. du command can also summarize files and directories in a recursive manner.
Here are several usage of to use the du (disk usage) command.
# cd /home/vertitoTo list the files and directories from there
# ls -laShow summary in bytes
-rw-r--r-- 1 root root 29 2007-08-11 11:57 file.txt
drwxr-xr-x 2 root root 4096 2007-08-11 11:57 folder1
# du -bNow, let us get a more human readable results
4096 ./folder1
8221 .
# du -a
4 ./file.txt
4 ./folder1
12 .
# du -ahThe above shows that my file.txt has about 4K of filesize rounded to nearest power of 1024K including . an ..
4.0K ./file.txt
4.0K ./folder1
12K .
Now, let us it in bytesThe above is the same results you get from issuing ls -la command. 8221 is . and ..
# du -ab
29 ./file.txt
4096 ./folder1
8221 .
Now let us do it once again in human readable form
# du -abhYou can also exclude file glob pattern or shell expression for files like so
29 ./file.txt
4.0K ./folder1
8.1K .
# du -abh --exclude='file.txt'Recursive directory disk usage summary can also be achieved by doing the default usage without any parameters
# du -abh --exclude='*.txt'
4.0K ./folder1
8.0K .
# cd /homeYou can also limit the recursive search dept like so
# du
# du --max-depth=2which search on the 2nd level of directory only and ignores any folder found above the 2nd level folders.
Getting the summarized return in a human readable form
# du -shAlternatively if you wish to get the last time modification
# du -ah --time
4.0K 2007-08-11 11:57 ./file.txt
4.0K 2007-08-11 11:57 ./folder1
12K 2007-08-11 11:57 .
If you are using mbox type of mail storage handling, these commands can be handy checking and reporting partition and/or folder disk usage when incorporated inside a shell scripts. Furthermore, you can create and generate your TOP 10 users with largest mails on monthly or weekly basis that could give you more detailed email report and alerts from it..
At regular interval and again using a script, you can also watch and monitor folder/partition usage changes and alerts you for certain specified thresholds like for /home or /var/ftp or /tmp.











10 comments:
The du command scripts are the fundamental in linux navigation. It is the easiest and promptest way to know memory status.
A nice article on Linux du command to supplement the given information.
http://www.thegeekscope.com/linux-du-command-to-find-disc-space-usage/
Interesting information. Thanks for sharing.
Best Mobility Services | Austere Technologies
Butikken har løst problemer for mig, tjenesten er meget tålmodig,køb moncler boern det er en perfekt shopping oplevelse. Da jeg modtog Moncler tøj, troede jeg,køb moncler herrer jakke det var en god kopi af Moncler dunjakke. Jeg kan lide denne online butik, denne Moncler kjole er enkel og generøs. Meget tilfreds med dette køb.
TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
Check out the best
sofa bed
shoe rack nz
bedroom furniture nz
I have been paying attention to replica watches.fake iwc watches After receiving the goods, I was very surprised, the leather strap is comfortable, the watch is light weight, high quality and the price is good.replica iwc portofino watches If you are looking for a watch that suits your everyday wear, this replica watch is definitely the perfect outfit. I will buy again!
This information is meaningful and magnificent which you have shared here about the du command in linux. I am impressed by the details that you have shared in this post and It reveals how nicely you understand this subject. I would like to thanks for sharing this article here.
Great Article Cloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Dijital Ajans Önerim Bigcrunch.
kripto para, siber güvenlik, VPN, bitcoin gibi konularda
Lorentlabsı inceleyebilirsiniz.
mastodon güvenli mi
Post a Comment