Archive for the ‘Linux Tips’ Category

Linux Tip #4: Simple sort with the sort command

You can easily sort your outputs in Linux using the “sort” command. Simply pipe “|” your output to a “sort” command and you should see the sorted results. See sample usage below. This is just to start off, I’ve cover more in future posts. [root@hantu ~]# cat numbers 5 4 3 2 1 0 6 [...]

Linux Tip #3: System uptime with uptime

Want to know how long your Linux box has been up for? Simple, just run the “uptime” command and you will be rewarded with the answer plus a bit more. 8:58pm  up  19:54,  1 user,  load average: 0.47, 0.62, 0.35 Above is the typical reply from uptime. On the left is the current time, followed [...]

Linux Tip #2: Get your PID with $$

“$$” is a useful Linux variable you could use in your script to get it’s PID. The “$$” variable always holds the PID of the executing process. Why do you need it? Maybe to check if the script is already running? This is what I normally use it for. Sample Script; #!/bin/bash echo “My PID [...]

Linux Tip #1: Live monitoring with tail

This is something every Linux admin or Linux superuser probably already knows and uses everyday. The “tail -f” command monitors a file and tracks any changes to it. As changes are made to the monitored file the “tail” command will print them on screen. Live monitoring basically….. tail -f [log file] Sample output; [root@keke ~]# [...]

Page 2 of 2«12
© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox