[Linux] Some simple but useful commands


–> echo previous process id to file:

echo $! >> /path/to/pid-file/file.pid

–> Force reboot when reboot command does not work [this is a abrupt reboot and DOES NOT gracefully shutdown]:

echo 1 > /proc/sys/kernel/sysrq  // enable use of sysrq
echo b > /proc/sysrq-trigger     // reboot

–> List files/directories according to the datetime:

ls -lt

–> Check ram usage:

free -m

cat /proc/meminfo

–> Information of your Linux box:

uname -a  [shows you latest kernel version number and architecture (x86_64 or i386)]

cat /etc/redhat-release (redhat & centOS specific)

rpm -qa | grep kernel [check your kernel version]

Advertisement

About Dominic

J for JAVA more about me : http://about.me/dominicdsouza
This entry was posted in Thechy Stuff. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s