uniway
Posts: 3
Joined: Tue Mar 26, 2013 5:40 am

How to check the free space of SD card

Tue Mar 26, 2013 5:47 am

Hello all
I'm pretty happy with my newly arrived Pi. Could you please tell me how to check the free space on my SD card? Also, is it possible to check the system status via web UI?

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: How to check the free space of SD card

Tue Mar 26, 2013 8:03 am

In a terminal type:

df -Bm

To check free space on the file system.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How to check the free space of SD card

Tue Mar 26, 2013 8:13 am

or even just

Code: Select all

df
Its a lot easier to remember, especially since everyone familiar with df likes different options.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

pjc123
Posts: 913
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: How to check the free space of SD card

Tue Mar 26, 2013 11:06 am

OK, now my preference. df -h (human readable) will give you an easier to read output (Kilobytes, Megabytes, Gigabytes), assuming you don't need one of the other specialized formats.
My Raspberry Pi Project Page:
https://www.flaminghellmet.com/launch/

klricks
Posts: 5835
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How to check the free space of SD card

Tue Mar 26, 2013 1:16 pm

uniway wrote:Hello all
I'm pretty happy with my newly arrived Pi. Could you please tell me how to check the free space on my SD card? Also, is it possible to check the system status via web UI?
If you have the GUI running then the file-manager shows used / total space.
Don't know about web UI but you can always log in with SSH or remote desktop and have full control.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: How to check the free space of SD card

Tue Mar 26, 2013 2:43 pm

I like "df" myself with the -BM flag. I can't understand why the hell it dosn't automatically present the user with a readable format. Do I really care how many bytes there are? Why not display bits instead? Once a value greater than 1024 is reached it should convert to a bigger unit, and then suffix with a unit designator.

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: How to check the free space of SD card

Tue Mar 26, 2013 7:16 pm

new_user wrote:Hello all
I'm pretty happy with my newly arrived Pi. Could you please tell me several different ways to check the free space on my SD card?, and begin a typical neo_Linux_Geek wanger-measuring competition about it, then moan about the tool that does it, even though it works perfectly and is easily configurable?
Why yes...

Yes we can...

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:

uniway
Posts: 3
Joined: Tue Mar 26, 2013 5:40 am

Re: How to check the free space of SD card

Wed Mar 27, 2013 5:38 am

Got it, thanks, Pi serves as my torrent downloader now :)

User avatar
jojopi
Posts: 3041
Joined: Tue Oct 11, 2011 8:38 pm

Re: How to check the free space of SD card

Wed Mar 27, 2013 6:57 am

Jessie wrote:I can't understand why the hell it dosn't automatically present the user with a readable format.
It could be worse. POSIX actually requires df to default to units of half-a-kibibyte. That is so daft that GNU df will comply only if you really ask it to:

Code: Select all

[email protected] ~ $ LC_ALL=C POSIXLY_CORRECT=1 df -P
Filesystem     512-blocks    Used Available Capacity Mounted on
rootfs           11365552 7785304   3049832      72% /
/dev/mmcblk0p1     114576   37936     76640      34% /boot
As for picking units automatically, or using suffixes, that would cause havoc to scripts that parse the output and compare values numerically.

I cannot understand why such behaviour is called "human readable" either. The normal rules of tabular data require units to be consistent for an entire column. And displayed in the column header, not on each line. I want to be able to see by the number of digits which values are big and small, not have to think about "800K" versus "1.3G".

Incidentally, "df -m" or "df -B1M" will allow the use of 1MiB blocks without the ugly "M" suffixes.

tilaprimera
Posts: 1
Joined: Mon Feb 24, 2014 12:37 pm

Re: How to check the free space of SD card

Fri Mar 14, 2014 7:13 am

I use

Code: Select all

df -h 
and it is pretty neat in showing the tags like G, M for the bytes available and used on the SD card. Here's a sample output.

Code: Select all

Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                   19G   12G  6.1G  66% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   387M  816K  386M   1% /run
/dev/disk/by-uuid/392338f6-005d-4a59-9bb0-ba15d7124355   19G   12G  6.1G  66% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   968M  988K  967M   1% /run/shm
/dev/sda7                                                79G   25G   50G  34% /home

Ceppetto
Posts: 3
Joined: Fri Jul 27, 2018 5:40 pm

Re: How to check the free space of SD card

Fri Jul 27, 2018 5:49 pm

You type in the terminal "df" and it shows a bunch a numbers and we cannot understand you need to type "df -h" and gives it in gb

Return to “General discussion”

Who is online

Users browsing this forum: mfa298 and 42 guests