Skip to Content

TU Wien Fakultät für Informatik KBS Knowledge-Based Systems Group
Top-level Navigation: Current-level Navigation:

Path: KBS > Services > Unix Tutorial >

Tools: Drucken

KBS Unix Tutorial Six

Other useful UNIX commands


The df command reports on the space left on the file system. For example, to find out how much space is left on the fileserver, type

% df .


The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone over quota and you want to find out which directory has the most files. In your home-directory, type

% du


This reduces the size of a file, thus freeing valuable disk space. For example, type

% ls -l science.txt

and note the size of the file. Then to compress science.txt, type

% compress science.txt

This will compress the file and place it in a file called science.txt.Z

To see the change in size, type ls -l again.

To uncomress the file, use the uncompress command.

% uncompress science.txt.Z


This also compresses a file, and is more efficient than compress. For example, to zip science.txt, type

% gzip science.txt

This will zip the file and place it in a file called science.txt.gz

To unzip the file, use the gunzip command.

% gunzip science.txt.gz


file classifies the named files according to the type of data they contain, for example ascii (text), pictures, compressed data, etc.. To report on all files in your home directory, type

% file *
© 9th October 2000

Home / Kontakt / Webmaster / Offenlegung gemäß § 25 Mediengesetz: Inhaber der Website ist die Fakultät für Informatik an der Technischen Universität Wien, 1040 Wien. Die TU Wien distanziert sich von den Inhalten aller extern gelinkten Seiten und übernimmt diesbezüglich keine Haftung. / Disclaimer.