How do I make ls show file sizes in megabytes?
I want to share how to see disk size using megabytes for you linux server. In this guide linux command for show directory size. No any problem using this command run on your server.
- VM Not Responding/Cannot Shutdown/Cannot Force Shutdown XenServer
- How Can I Create the Date modified of a File?
- How To Use Free SSL on My WordPress Web Site
Step #01: Connect your server using putty or MobaXterm from official website. Then op
en putty or MobaXterm for ssh on your server.
ssh -l root 10.44.50.10
Then type your server root password.
Step #02: Now run command for see disk size using megabytes
[[email protected] ~]# ls -l –block-size=M
Output below :
total 1M
This size is for root directory.
Now you goto another directory and run this command
[[email protected] ~]# cd /var/
[[email protected] var]# ls -l –block-size=M
Output below :
total 1M drwxr-xr-x. 2 root root 1M Apr 11 2018 adm drwxr-xr-x. 5 root root 1M Oct 2 15:18 cache drwxr-xr-x. 2 root root 1M Apr 12 2018 crash drwxr-xr-x. 3 root root 1M Oct 2 15:18 db drwxr-xr-x. 3 root root 1M Oct 2 15:18 empty drwxr-xr-x. 2 root root 1M Apr 11 2018 games drwxr-xr-x. 2 root root 1M Apr 11 2018 gopher drwxr-xr-x. 3 root root 1M Oct 2 15:17 kerberos drwxr-xr-x. 24 root root 1M Oct 2 15:18 lib drwxr-xr-x. 2 root root 1M Apr 11 2018 local lrwxrwxrwx. 1 root root 1M Oct 2 15:17 lock -> ../run/lock drwxr-xr-x. 7 root root 1M Jan 9 19:49 log lrwxrwxrwx. 1 root root 1M Oct 2 15:17 mail -> spool/mail drwxr-xr-x. 2 root root 1M Apr 11 2018 nis drwxr-xr-x. 2 root root 1M Apr 11 2018 opt drwxr-xr-x. 2 root root 1M Apr 11 2018 preserve lrwxrwxrwx. 1 root root 1M Oct 2 15:17 run -> ../run drwxr-xr-x. 8 root root 1M Oct 2 15:18 spool drwxrwxrwt. 3 root root 1M Jan 9 20:04 tmp drwxr-xr-x. 2 root root 1M Apr 11 2018 yp
Enjoy this 🙂