Wednesday, July 4, 2012

Linux: Find your public IP from CLI

It's needed from time to time


Linux: Change user group membership on

Use the following command to add user to another group.
#sudo usermod -G asterisk root

Display folder size on linux

Use this command to find folder size on linux. Output will be in KB, MB, and GB respectively.

#sudo du -h /var

56K     /var/log/apt
4.0K    /var/log/apparmor
54M     /var/log
4.0K    /var/spool/asterisk/tmp
4.0K    /var/spool/asterisk/voicemail/default/1150/INBOX
16K     /var/spool/asterisk/voicemail/default/1150
20K     /var/spool/asterisk/voicemail/default
28K     /var/spool/asterisk/voicemail
15G     /var/spool/asterisk/backup/MIGRATED_Dailybackup
15G     /var/spool/asterisk/backup
15G     /var/spool/asterisk
8.0K    /var/spool/cron/crontabs
4.0K    /var/spool/plymouth
15G     /var/spool
4.0K    /var/tftpboot/SoundPointIPLocalization
44K     /var/tftpboot/logs
4.0K    /var/tftpboot/overrides
4.0K    /var/tftpboot/licenses
8.0K    /var/tftpboot/contacts
4.0K    /var/tftpboot/languages
16M     /var/tftpboot

Resize Linux File System using (LVM)

To resize a linux partition on LVM volume that has a file system on it, run these commands. 

lvm> lvextend -L +40G /dev/mapper/system-var
lvm> quit 

#resize2fs /dev/mapper/system-var