Minority Opinions

Not everyone can be mainstream, after all.

Polite Bash Trick

leave a comment »

Inspired by a comment on StackOverflow, I added a “please” alias to my shell:

> alias please='sudo $(history 2 | head -n 1 | cut -f2- -d" ")'
> ls -a /root/
ls: cannot open directory /root/: Permission denied
> please
.  ..  .aptitude  .bash_history  .bashrc  .config  .profile  .synaptic

It saves me one whole character over sudo !!

Advertisements

Written by eswald

28 Jun 2010 at 11:11 am

Posted in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s