Tag Archives: linux
Linux / Windows: How to Retrieve Serial Number of Server
Sometimes I would need to retrieve the serial numbers of servers remotely – HP ProLiant and Dell PowerEdge servers to be precise. The normal way is to make a trip down to the server room and write down the serial numbers found on a sticker pasted on the server chassis. The other lazy (and smart) way is to retrieve the information from the command line!
How to Catch Ctrl-C in Shell Script
There are times when you do not want users to stop a running shell script abruptly by sending the Ctrl-C key combination. There is no way to prevent users from doing that, but there is a way to catch or trap Ctrl-C key combinations in a shell script.
Find Number of Hops Using Ping
In the computer networking field, traceroute is a diagnostic tool for displaying the hops and the round-trip time for each hop. Ping, on the other hand, computes round-trip times only from the destination point. But if you are just interested in finding out the number of hops to a destination and not the round-trip times, ping is an alternative utility to traceroute.
How to Get Linux Boot Time
Linux uptime command will show how long the system has been running. But if you want to find out the boot time of the system instead, you will have to perform a bit of arithmetic – subtract the output of the uptime command from the current time. Sounds too troublesome? There’s an easier way to do it using the Linux proc filesystem.
Shell Script: Week Numbers in Unix / Linux
If you need to run scripts on specific weeks on a UNIX machine, then there is a easy way to determine this.