Monday, 26 January 2015

Disabling the password prompt for sudo users


Often, GNU/Linux users come across the sudo utility. But on executing any command with sudo requests, users have to provide their own passwords once, which can then be used afterwards.

$ sudo vim /etc/sudoers
[sudo] password for tom:

To disable this sudo password prompt, edit the /etc/sudoers file as follows:

sudo vim /etc/sudoers

and change...

%sudo ALL=(ALL:ALL) ALL

...to

%sudo ALL=(ALL:ALL) NOPASSWD: ALL

Save the file and check for the changes. You are now free to execute anything without entering passwords.

Tuesday, 6 January 2015

Command line shortcuts

Here goes some tips to speed up our work.

cmd1;cmd2

The above command will run cmd1 and then execute cmd2.

cmd1 && cmd2

This will execute cmd2 if cmd1 is successful.

cmd1 || cmd2

The above sequence will run cmd2 if cmd1 is not successful.

Ctrl+a

This will move the control to the beginning of the line in CLI.

Ctr+e

The above command will move the control to the end of the line in CLI.

!ser :p

The above command will print the last command starting with 'ser'.