Roshan Book

My Tech Notebook

ubuntu terminal commands


Restart Apache              : sudo /etc/init.d/apache2 restart

Starting Apache :sudo /etc/init.d/apache2 start

Stopping Apache          : sudo /etc/init.d/apache2 stop

Copy A File

sudo cp /home/manishroshan/backups/123.tar.gz /var/www/downloads
Copies a file from one directory to another directory. (in this case the file1 23.tar.gz was copied to the /var/www/downloads directory).
If you don’t want to copy but move the file, change cp to mv.

Downloading a file from a url


Execute multiple commands

command 1 && command 2

File Browsing

Into the directory :  cd directoryName

Outside directory : cd

Making a folder writable

sudo chmod 777 -R /opt


IP Config : ifconfig

Ping         : ping

Installing a Package

sudo apt-get install PackageName

Installing ZF tool with auto configuration with one command

sudo apt-get install zend-framework-bin

Listening to port and killing a program

netstat -natp | grep LISTEN

kill pidNo

Terminal Shortcuts

Up Arrow or ctrl+p Scrolls through the commands you’ve entered previously.
Down Arrow or ctrl+n Takes you back to a more recent command.
Enter When you have the command you want.
tab A very useful feature. It autocompletes any commands or filenames, if there’s only one option, or else gives you a list of options.
ctrl+r Searches for commands you’ve already typed. When you have entered a very long, complex command and need to repeat it, using this key combination and then typing a portion of the command will search through your command history. When you find it, simply press Enter.
History The history command shows a very long list of commands that you have typed. Each command is displayed next to a number. You can type !x to execute a previously typed command from the list (replace the X with a number). If you history output is too long, then use history | less for a scrollable list.


tar -zxfv filename.gz



9 responses to “ubuntu terminal commands

  1. google August 24, 2011 at 6:32 am

    I liked your article is an interesting technology
    thanks to google I found you

  2. virtual servers September 19, 2011 at 2:44 pm

    It is possible to conserve time and keep the end users effective and happy with desktop virtualisation.

  3. Replica Chanel Handbags December 1, 2011 at 2:56 pm

    I like your blog so considerably that I feel I have to wish you. Happy New Year in advance. Have a good and prosperous year ahead

  4. Louis Vuitton Knockoffs Handbags December 2, 2011 at 10:21 am

    I’m a big lover of your blog! Check out my web page, You can analyze your blog here!

  5. Louis Vuitton Bags Outlet December 5, 2011 at 10:19 am

    I’m so glad this internet thing performs and your post honestly helped me. May take you up on that home assistance you

  6. Louis Vuitton Belt December 5, 2011 at 8:44 pm

    Rather interesting blog post. Your current web presence is fairly quickly turning into among my top picks.

  7. LV Handbags On Sale December 6, 2011 at 10:15 am

    Especially amazing post. I just stumbled upon your blog and wanted to mention that I’ve truly enjoyed browsing your weblog posts. In any case I will be subscribing for your rss feed and I hope you write again incredibly soon!

  8. nada goose jacket December 10, 2011 at 10:52 pm

    There is some validity nevertheless normally takes hold opinion until I consider it further. Good article , thanks and that we want more! Added to FeedBu??

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: