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 [...]
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 [...]
“$$” 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 [...]
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 ~]# [...]