Linux - prostor na disku - velikost datotek

PROSTOR NA DISKIH LINUX - kako (HOW Check Disk Space in Linux)
-------------------------------------------------------------


[zvicar@virga programi]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3               497861    255213    216944  55% /
/dev/sda1               101086     36964     58903  39% /boot
/dev/sda10           133056548  92455324  33842280  74% /db
/dev/sda11            39848300  27166072  10658040  72% /academa
/dev/sda6             10088552   9096304    479776  95% /home
none                   1031944         0   1031944   0% /dev/shm
/dev/sda5             20490272   9960852  10529420  49% /scratch
/dev/sda8               988244    696860    241184  75% /u1
/dev/sda7              4925556   2344380   2330964  51% /usr
/dev/sda9               988244    451856    486188  49% /var
[zvicar@virga programi]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             487M  250M  212M  55% /
/dev/sda1              99M   37M   58M  39% /boot
/dev/sda10            127G   89G   33G  74% /db
/dev/sda11             39G   26G   11G  72% /academa
/dev/sda6             9.7G  8.7G  469M  95% /home
none                 1008M     0 1008M   0% /dev/shm
/dev/sda5              20G  9.5G   11G  49% /scratch
/dev/sda8             966M  681M  236M  75% /u1
/dev/sda7             4.7G  2.3G  2.3G  51% /usr
/dev/sda9             966M  442M  475M  49% /var
[zvicar@virga programi]$

[zvicar@virga programi]$ df -h |grep sda10
/dev/sda10            127G   89G   33G  74% /db
-------------------------------------------------------------
[zvicar@virga programi]$ ./info.sh sda10
Partition: /dev/sda10
Total size: 127G
Used space: 89G
Free space: 33G
Used: 74%
mapa: /db

------
iz http://forevergeek.com/linux/check_disk_space_in_linux.php
[zvicar@virga programi]$ vi info.sh

#!/bin/sh
DISC=$1
PARTITION=`df -h |grep $DISC |awk '{print $1}'`
SIZE=`df -h |grep $DISC |awk '{print $2}'`
USED=`df -h |grep $DISC |awk '{print $3}'`
FREE=`df -h |grep $DISC |awk '{print $4}'`
PROC=`df -h |grep $DISC |awk '{print $5}'`
map=`df -h |grep $DISC |awk '{print $6}'`

echo "Partition: $PARTITION"
echo "Total size: $SIZE"
echo "Used space: $USED"
echo "Free space: $FREE"
echo "Used: $PROC"
echo "mapa: $map"
~
~
Nato Esc nato : in nato :x in nato Enter za izhod
Se pravica za izvajanje  +x, spodaj
# chmod +x info.sh


--------------------------------------------------------------------------
IZ - http://linux.about.com/library/cmd/blcmdl1_du.htm
du - estimate file space usage   

[base@virga base_home]$ du -ch
512     ./.mc/tmp
13K     ./.mc
5.8M    ./E99
4.5K    ./exe/RCS
129K    ./exe/rocno
8.5K    ./exe/vnos_klasika
777K    ./exe
615K    ./log/2002/200201
318K    ./log/2002/200202
.
.
.

du --exclude='*.o' 
[base@virga base_home]$ du /home/zvicar -ch
8.0K    /home/zvicar/.kde/Autostart
12K     /home/zvicar/.kde
du: cannot change to directory `/home/zvicar/.mc/tmp': Permission denied
20K     /home/zvicar/.mc
du: cannot change to directory `/home/zvicar/.ssh': Permission denied
64K     /home/zvicar/aceglar
392K    /home/zvicar/arhiv_papirnat
1.6M    /home/zvicar/arhiviranje
56K     /home/zvicar/baza
360K    /home/zvicar/depese

 du /home/zvicar -cha
92K     /home/zvicar/sapa_dump/oznake_opazovanj_.txt
108K    /home/zvicar/sapa_dump/evi_instrumentov.txt
2.5M    /home/zvicar/sapa_dump/evidencakon1.txt
301M    /home/zvicar/sapa_dump/klima.txt
419M    /home/zvicar/sapa_dump/klima_rdb.txt
124K    /home/zvicar/sapa_dump/oznake_opazovanj.txt
118M    /home/zvicar/sapa_dump/padavine.txt

-a, --all
write counts for all files, not just directories 
-B, --block-size=SIZE use SIZE-byte blocks 
-b, --bytes
print size in bytes 
-c, --total
produce a grand total 
-D, --dereference-args
dereference FILEs that are symbolic links 
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G) 
-H, --si
likewise, but use powers of 1000 not 1024 
-k
like --block-size=1K 
-l, --count-links
count sizes many times if hard linked 
-L, --dereference
dereference all symbolic links 
-S, --separate-dirs
do not include size of subdirectories 
-s, --summarize
display only a total for each argument 
-x, --one-file-system
skip directories on different filesystems 
-X FILE, --exclude-from=FILE
Exclude files that match any pattern in FILE. 
--exclude=PATTERN Exclude files that match PATTERN. 
--max-depth=N
print the total for a directory (or file, with --all) only if it is 
N or fewer levels below the command line argument; --max-depth=0 is 
the same as --summarize 
--help
display this help and exit 
--version
output version information and exit 
SIZE may be (or may be an integer optionally followed by) one of 
following: kB 1000, K 1024, MB 1,000,000, M 1,048,576, and so on 
for G, T, P, E, Z, Y.   


Nazaj na domačo stran.