Ok, firstly, I want you to imagine (if you will) Darth Vader saying the title of this blog post: “The Power of the Command-Line”. Good, good (– The Emperor).
I suppose I’d better go and explain that now… the title, that is, not Darth Vader. I just thought it would be cool if Darth Vader said it. Anyway. I was thinking the other night how cool Linux was. I was downloading a relatively large file, and I wanted to go to bed. Some download managers interface with the Operating System which gives you the option of turning the computer off once you’ve finished downloading, but I was using Firefox which doesn’t have that option. If I’d been using Windows, my options would have been (1) staying up until the file had downloaded, (2) leaving the computer on all night. Neither of which were particularly desirable.
Thanks to Linux, I had a third option: use the ‘at’ command to turn the computer off at a specified time. I just dropped to a terminal window (basically a command line interface) and typed in:
[phill@dibber ~]$ su Password: [root@dibber phill]# at midnight at> shutdown -h now
I could then walk away from the computer, in the knowledge that my computer would shut itself down at midnight, after the file had finished downloading! Ok, so, there was a small chance the file wouldn’t have finished downloading (if it suddenly went really, really slow) — but still. That’s the kind of power which you have from the command-line in Linux 🙂 There probably is a way of getting it to shutdown once the file has completed downloading, I just haven’t figured it out yet.
‘at’ sets up a ‘job’ to run once… ‘cron’ sets up jobs to run repeating. I’ve already mentioned this in a previous blog post, but you can use it to keep your machine up to date. Can you use Windows Update from the command-line? I’ve never seen it!
This is why Linux suits itself so perfectly to servers – you can set it up to basically maintain itself! Although Microsoft have done a great job in Windows of making it easy to use, I think it does require a lot of user input. Even with Windows Server 2003, I’ll login to a machine and see messages saying that Windows has downloaded updates for the computer which require a reboot… why should we have to reboot the machine? It’s just symptomatic of the cowboy attitude Microsoft have taken to security and patching in the past which… (Phill wanders off into the sunset, ranting under his breath)
Leave a Reply