Posts Tagged: linux

Changing hostname on Linux server to FQD

Posted by & filed under Linux.

OK, this is straightforward, just see http://www.cyberciti.biz/faq/linux-change-hostname/ On Unbuntu, simple edit /etc/hostname BUT Don’t forget to restart the hostname script daemon, otherwise the new domain will not show up with you type ‘hostname’… /etc/init.d/hostname restart ALSO You might want update you reverse IP to the new hostname. All done.

Removing orphaned virtfs mounts

Posted by & filed under Linux.

Shows who is logged in: # who Anybody running a virtfs, or any orphaned virtfs users? cat /proc/mounts | grep virtfs Unmount them! for i in `cat /proc/mounts |grep virtfs |grep user_name_here |awk ‘{print$2}’`; do umount $i; done

Linux directory size

Posted by & filed under Linux.

To display the size of directory, including sub directories, eg, for /backup: du /backup -ch | grep total See http://www.codecoffee.com/tipsforlinux/articles/22.html

Finding large files in linux

Posted by & filed under Linux.

Here’s a bash script to do it: #!/bin/bash # if nothing is passed to the script, show usage and exit [[ -n “$1” ]] || { echo “Usage: findlarge [PATHNAME]“; exit 0 ; } # simple using find, $1 is the first variable passed to the script find $1 -type f -size +100000k -exec ls… Read more »