Red Hat NETSCAPE MANAGEMENT SYSTEM 6.0 - COMMAND-LINE Manuale Utente Pagina 4

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 60
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 3
4
Directory Size
How to find - Size of a directory & Free disk space
This article explains 2 simple commands that most people want to know
when they start using Linux. They are finding the size of a directory and
finding the amount of free disk space that exists on your machine. The
command you would use to find the directory size is ' du '. And to find
the free disk space you could use ' df '.
All the information present in this article is available in the man pages
for du and df. In case you get bored reading the man pages and you
want to get your work done quickly, then this article is for you.
-
'du' - Finding the size of a directory
$ du
Typing the above at the prompt gives you a list of directories that exist
in the current directory along with their sizes. The last line of the output
gives you the total size of the current directory including its
subdirectories. The size given includes the sizes of the files and the
directories that exist in the current directory as well as all of its
subdirectories. Note that by default the sizes given are in kilobytes.
$ du /home/david
The above command would give you the directory size of the directory
/home/david
$ du -h
This command gives you a better output than the default one. The
option '-h' stands for human readable format. So the sizes of the files /
directories are this time suffixed with a 'k' if its kilobytes and 'M' if its
Megabytes and 'G' if its Gigabytes.
$ du -ah
This command would display in its output, not only the directories but
also all the files that are present in the current directory. Note that 'du'
always counts all files and directories while giving the final size in the
last line. But the '-a' displays the filenames along with the directory
names in the output. '-h' is once again human readable format.
$ du -c
This gives you a grand total as the last line of the output. So if your
directory occupies 30MB the last 2 lines of the output would be
30M .
30M total
Vedere la pagina 3
1 2 3 4 5 6 7 8 9 ... 59 60

Commenti su questo manuale

Nessun commento