Skip to content

How To: Linux File Count, Directory List and Disk Usage Commands

by Jon on October 27th, 2009

It is common for a linux admin to have to go into a server and do file counts, directory listings and disk space usage. For admin that are not familiar without using a GUI it can be difficult to do. Here are a few commands that I find myself using often enough to share with everyone else. These are very useful when trying to find a specific file in a directory or see how much disk space is available. There is also a web based tool named WebMin that you could use to do the same thing but I prefer not to install a lot of web tools on my servers. Here are a few command that could be useful or just fyi.

See disk space usage(in bytes): df -l
See disk space usage(in human terms): df -h
Show files within directory in list format: ls -l
Count files within directory: ls -l | wc -l
Count specific files within directory: ls -l *.wav | wc -l
Look for a partial file name within directory(with details): ls -ld *file_name*

This gives a few examples of commands to work within a non GUI linux directory, there are plenty of more examples this just helps with a few if you have any questions post a comment and I will help you out.

From → Linux

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

%d bloggers like this: