Monday 4 November 2013

Simple things in live

I love Linux, In this first post here I'm going to show you two simple ticks that you will love if you do not know them already, and if you do know them I guess that you still love them.

No permission running command. For example you like to reboot in 10 minutes

$ shutdown -r 10
shutdown: Need to be root
You might be the one who repeats the command starting with "sudo" for root privileges, that's ok for short commands, but you might even want to use the really short one.
$ sudo !!
This will repeat your latest command as root.

The second trick is for same purpose with in the Vim editor. How often have you opened file for edit and when you try to save you find out tha you have no permission to save.
There is a sulution.
:w !sudo tee %
Quite simple and it works.