Showing directory sizes in Linux

7 07 2009

If there is no VNC Server available to manage your server with GUI Facility, then terminal is the fastest way to solve it.

Command for showing directory sizes in Linux:

$user@machine /home/gibran>du -h
This will show you each subdirectory sizes in directory /home/gibran with human readable ( -h ) fiturs, something like this:
48K ./images
328K ./language
15M ./captcha
48K ./templates/default
52K ./templates
15M .

If you want to summarize your current active directory, here they are:
$user@machine /home/gibran> du -sh

This will show you summarize ( -S) all files and directory in /home/gibran, like this one:
15MB .
in above examples, we can see that /home/gibran has 15MB totals directory and files.





Terima kasih OpenSource

17 06 2009

Terima kasih PHP,
Karenamulah Facebook,wordpress, dan Wikipedia menjadi wujud

Terima kasih PHP,
Karena kamu sangat mudah dipelajari

Terima kasih PHP,
Karena kamu muncul jutaan software untuk memudahkan kehidupan

Terima kasih PHP,
karenamu Jutaan orang di Bumi ini mendapat sumber penghidupan

Terima kasih OpenSource,
Karenamulah hidup ini menjadi semakin indah.





Remove spaces in file names recursively using Linux Commands

26 11 2008

Cool stuff for removing space in your file and folders names.This command will remove a whitespace and change it to underscore character “_” . Open your terminal.  Changes path to your working folders. Caution, this command will affect all of your files and folders recursively. Then do this command :

a. Remove spaces in current folders:
user@machine~>rename -v 's/\ /\_/g' *

b. Remove spaces in all files and one sub folder:
user@machine~>rename -v 's/\ /\_/g' */*

note:
*        -> in current folders only (ex : folder1)
*/*        -> in current and sub folders (ex: folder1/folder2)
*/*/*    -> in current, sub folders, sub folders (ex: folder1/folder2/folder3)

Just simply changes */* with your folder depth needs.