Skip to navigation
   
Andrew Miller's Blog

Forgetting to Sudo

By Andrew Miller in Editorial

Posted in Linux on August 19, 2008 at 9:08 pm

Permalink | Author Profile

I’m not going to start my first blog post with an excessive introduction to who I am and why you should listen to what I have to say - this is the Google generation after all, go find out for yourself. My blog posts will be once a week and primarily focussed on Linux.

I did originally write a rather long winded piece as a reply to an Inquirer editorial that questioned the consumer readiness of Linux. Although I use Linux full-time on my clients and servers, I am by no means a Linux evangelist and I felt a balanced argument on this topic might solidify my standing from day one. Writing the piece ended up as several thousand words and I still don’t think I did the topic justice.

Although I’m happy to get dirty in the console writing scripts that aid my every day doings, I don’t believe in compiling anything from source. I see this as a real step backwards for computer usability and management. Many people consider editing a config file too difficult, after all.

Anyone who has found themselves stuck in the Ubuntu console for a while, will know how irritating it is to type in a command and forget to have the “sudo” at the beginning, which tells the machine to the run the command elevated as the “root” user. For example.


# rm tmp
rm: cannot remove 'tmp':Permission Denied
# sudo rm tmp
#

The obvious solution is to press the up arrow to go through your history, then press home, then type in sudo. If you are on a laptop, the home key is not always particularly accessible, so I found myself holding down the left key until I reached the end. After looking into this today, there are a number of other alternatives to speed up this regular annoyance.

Firstly, in a bash console, pressing CTRL+A will simulate the home key. Secondly, a slightly easier approach is to type “sudo !!”. The explanation marks will be replaced with the last command run and your command will run as root. Now there’s a time saver!

12345
Rated: 66.67% (3 votes)
Loading ... Loading ...

| Next Post

 
 
Comments

Comment by Sharon Jackson - September 19, 2008 on 2:53 pm

I’ve done that a couple of times - thanks for the tip. As a newbie linux user I need all the tips I can get lol

Make a comment

* required

* required

We stop spam using reCaptcha.
Type the words below and click Submit Comment.

Advertisement
Advertisement
Advertisement