TOPIC: DU
How much space is that folder taking up on your disk?
23rd July 2008On Windows, it's a matter of right-clicking on the folder and looking in its properties. I am sure that there is a better way of doing it in that ever pervasive operating system but, in the worlds of Linux and UNIX, the command line comes to the rescue as it is wont to do. What follows is the command that I use:
du -sh foldername
The s
option makes it present the total space taken up; leaving it out gets you a breakdown of how much space the subfolders are taking up as well. The h
makes the sizes output more friendly to human eyes with things like 10K, 79M and 51G littering what you get. The command itself is a much shorter way of saying "print disk usage". It's all quick and easy when you know it, and very useful in this age of ever-increasing data volumes.
UNIX Process Management
1st June 2007Here are a few UNIX commands that I have recently encountered that help with process management and are particularly useful when jobs are running in the background. Here they are:
nohup
It's short for no hang up and stops termination of a job when a user logs off. Another result is that all console messages being directed to a file called nohup.out
in the directory current to the job being run, or in the user's home directory, where write access to the current working directory is unavailable.
ps
This returns a list of processes, their ID's and their statuses. By default, this is for your own processes, but you can look beyond this with the myriad of options that can be passed. For instance, the -U switch allows you to look at a job for other users while the -f one shows more information than the standard call and this even includes the commands submitted to start the ongoing processes.
kill
The name says it all, and it's far quicker than the rigmarole that you have to endure with the Windows task manager; I wonder if there is a command line approach to process termination on Windows.