Sep 18, 2013

How to write inline or single line shell script?

for i in {1..10}; do echo $i; done

for i in {1..10}; do echo $i:"$(ls |wc -l)"; done

Jul 18, 2013

How to change the `hostname` in the Linux?

>hostname
localhost

>cat /etc/HOSTNAME
localhost


Change the /etc/HOSTNAME file content and restart the machine.