Ubuntu command line hints

Posted in Quick Tips, default | 7 comments
Tags: , , , ,

Just type the following in Gnome Terminal:

sudo apt-get install fortunes-ubuntu-server -y

Now execute below command several times to get really useful Ubuntu command line tips:

ubuntu-server-tip

Here are some examples:

Use lsof to find out which process has open handles for a file. ‘lsof +D /path’ will find all processes for the given path. This is useful for unmounting media.

If you know you typed a command or password wrong, you can use ctrl + u to delete the whole line or ctrl + w to delete just a word.

If you are using a PostgreSQL database, use “ptop” to monitor real time usage. Btw, export of PostgreSQL to file is easy.

Browse the command line history with ctrl-r and then type a few characters that you know are part of the command you are looking for.

A for loop in bash syntax: ‘for i in * ; do echo $i ; done’.

To make a backup without typing the full path twice: ‘cp /long/path/to/file/name{,.orig}’ to create a copy with the suffix .orig

Follow @Ubuntuka on Twitter!
RSSComments

shan

Posted on September 27, 2011 at 4:33 pm

thank you for this nice tips

shan

Posted on October 26, 2011 at 12:45 pm

any idea whether it should work on Oneiric it seems

CTRL+r only brings up the first letter rendering it pretty useful as a tool

Is there something i need to do to update it

thanx shan

Pass

Posted on May 16, 2012 at 6:56 pm

thanx shan

Peter Rhone

Posted on November 29, 2012 at 8:39 am

This is nice. To make it even better, add ubuntu-server-tip to the end of .bashrc, so when you log-in or open a terminal, you will your “tip of the day”!

Vaughn

Posted on March 8, 2013 at 7:40 pm

What’s up i am kavin, its my first occasion to commenting anywhere, when i read this post i thought i could also make comment due to this brilliant post.

guest

Posted on April 23, 2013 at 9:02 pm

nice, thanks!

What women want

Posted on May 3, 2013 at 3:52 am

I blog frequently and I seriously thank you
for your information. The article has truly peaked my interest.
I will book mark your site and keep checking for new details about
once per week. I opted in for your RSS feed as well.

Post a comment

Hello guest, care to post a comment?