[unix] What is the unix command to see how much disk space there is and how much is remaining?

I'm looking for the equivalent of right clicking on the drive in windows and seeing the disk space used and remaining info.

This question is related to unix aix diskspace

The answer is


If you want to see how much space each folder ocuppes:

du -sh *

  • s – summarize
  • h – human readable
  • * – list of folders

I love doing du -sh * | sort -nr | less to sort by the largest files first


Use the df command:

df -h


If you want to see how much space each folder ocuppes:

du -sh *

  • s – summarize
  • h – human readable
  • * – list of folders

df -tk

for Disk Free size in 1024 byte blocks


Note: The original question was answered already, but I would just like to expand on it with some extras that are relevant to the topic.

Your AIX installation would first be put into volume groups. This is done upon installation.

It will first create rootvg (as in root volume group). This is kinda like your actual hard drive mapped.

This would be equivalent to Disc Management in Windows. AIX wont use up all of that space for its file systems like we tend to do it in consumer Windows machines. Instead there will be a good bit of unallocated space.

To check how much space your rootvg would have you use the following command.

lsvg rootvg

That would stand for list volume group rootvg. This will give you information like the size of physical partitions (PP), Total PPs assigned to the volume group, Free PPs in the volume group, etc. Regardless, the output should be fairly comprehensive.

Next thing you may be interested in, is the file systems on the volume group. Each file system would have certain amount of space given within the volume group it belongs to.

To check what file systems you got on your volume group you use the following command.

lsvgfs rootvg

As in list volume group file systems for rootvg.

You can check how much space each file system has using the following command.

df

I personally like to refine it with flags like -m and -g (in megabytes and gigabytes respectively)

If you have free space available in your volume group, you can assign it to your file systems using the following command.

chfs -a size=+1G /home

As in change file system attribute size by adding 1 G where file system is /home. use man chfs for more instructions. This is a powerful tool. This example is for adjusting size, however you can do more with this command than that.

Sources: http://www.ibm.com/developerworks/aix/library/au-rootvg/ + My own experience working with AIX.


du -sm * => RULLLLLEZ


All these answers are superficially correct. However, the proper answer is

 apropos disk   # And pray your admin maintains the whatis database

because asking questions the answers of which lay at your fingertips in the manual wastes everybody's time.


I love doing du -sh * | sort -nr | less to sort by the largest files first


All these answers are superficially correct. However, the proper answer is

 apropos disk   # And pray your admin maintains the whatis database

because asking questions the answers of which lay at your fingertips in the manual wastes everybody's time.


Use the df command:

df -h


If you want to see how much space each folder ocuppes:

du -sh *

  • s – summarize
  • h – human readable
  • * – list of folders

df -tk

for Disk Free size in 1024 byte blocks


Note: The original question was answered already, but I would just like to expand on it with some extras that are relevant to the topic.

Your AIX installation would first be put into volume groups. This is done upon installation.

It will first create rootvg (as in root volume group). This is kinda like your actual hard drive mapped.

This would be equivalent to Disc Management in Windows. AIX wont use up all of that space for its file systems like we tend to do it in consumer Windows machines. Instead there will be a good bit of unallocated space.

To check how much space your rootvg would have you use the following command.

lsvg rootvg

That would stand for list volume group rootvg. This will give you information like the size of physical partitions (PP), Total PPs assigned to the volume group, Free PPs in the volume group, etc. Regardless, the output should be fairly comprehensive.

Next thing you may be interested in, is the file systems on the volume group. Each file system would have certain amount of space given within the volume group it belongs to.

To check what file systems you got on your volume group you use the following command.

lsvgfs rootvg

As in list volume group file systems for rootvg.

You can check how much space each file system has using the following command.

df

I personally like to refine it with flags like -m and -g (in megabytes and gigabytes respectively)

If you have free space available in your volume group, you can assign it to your file systems using the following command.

chfs -a size=+1G /home

As in change file system attribute size by adding 1 G where file system is /home. use man chfs for more instructions. This is a powerful tool. This example is for adjusting size, however you can do more with this command than that.

Sources: http://www.ibm.com/developerworks/aix/library/au-rootvg/ + My own experience working with AIX.


I love doing du -sh * | sort -nr | less to sort by the largest files first


df -g .

Option g for Size in GBs Block and . for current working directory.


If you want to see how much space each folder ocuppes:

du -sh *

  • s – summarize
  • h – human readable
  • * – list of folders

I love doing du -sh * | sort -nr | less to sort by the largest files first


su -sm ./*

You can see every file and folder size (-sm=Mb ; -sk=Kb) in the current directory like a list. This way runs in all Unix/Linux environment.


su -sm ./*

You can see every file and folder size (-sm=Mb ; -sk=Kb) in the current directory like a list. This way runs in all Unix/Linux environment.


Use the df command:

df -h


df -g .

Option g for Size in GBs Block and . for current working directory.


Use the df command:

df -h


du -sm * => RULLLLLEZ


Examples related to unix

Docker CE on RHEL - Requires: container-selinux >= 2.9 What does `set -x` do? How to find files modified in last x minutes (find -mmin does not work as expected) sudo: npm: command not found How to sort a file in-place How to read a .properties file which contains keys that have a period character using Shell script gpg decryption fails with no secret key error Loop through a comma-separated shell variable Best way to find os name and version in Unix/Linux platform Resource u'tokenizers/punkt/english.pickle' not found

Examples related to aix

Changing an AIX password via script? Find files in created between a date range How to ignore conflicts in rpm installs Create a copy of a table within the same database DB2 ORA-00060: deadlock detected while waiting for resource How to get the command line args passed to a running process on unix/linux systems? How to mkdir only if a directory does not already exist? What is the unix command to see how much disk space there is and how much is remaining?

Examples related to diskspace

MacOS Xcode CoreSimulator folder very big. Is it ok to delete content? Android SDK folder taking a lot of disk space. Do we need to keep all of the System Images? Find size and free space of the filesystem containing a given file Get free disk space What is the unix command to see how much disk space there is and how much is remaining? How do I monitor the computer's CPU, memory, and disk usage in Java?