5 tips and tricks to speed up your bash experience
Sometimes performing certain tasks on command line could be time consuming. This article introduces you to five tricks that can speed up your experience with bash. This article is mostly for new Linux users, but experienced users may find some of them interesting.
- Executing commands in history using Ctrl+r
Just press Ctrl+R and start typing a command that you executed a while ago. It will automatically shows you the exact command.
If you have used a long command to create a backup of your database using mysqldump command and you need to executed it again, all you need to do is to press Ctrl+R and type "dump". Your full command will appear. Now you can press enter to execute the command again.
- Clearing your command using Ctrl+u
Sometimes you're writing a long command, but instead of executing it, you want to clear it. You can press Ctrl+u to do so. This command is particularly useful when you enter a wrong password and want to start writing it from the beginning.
- Finding a keyword using / in man page
You have probably seen a lot of long man pages. Sometimes you're looking for certain keywords in them. Just press / and start typing your search and press enter. Pressing n will take you to the next occurrence of that keyword and N will take you back. This feature is similar to that of vim.
- Creating a multiple hierarchy directory using mkdir -p option
You can create a directory using mkdir. However, if the directory you're creating is going to be in a directory hierarchy that doesn't exist, instead of creating every single of them you can make them all at once using mkdir -p option.
This command will create dir1, dir2, dir3 if they don't exist before it creates dir4. Hopefully, you won't create each of such directories using a separate command from now on.
- Running a command on multiple files using for loop.
Suppose you have more than 100 files in a directory and you need to do something with all of them. You can use the for loop command to perform an action on them. The syntax is the following:
for file in directory; do command $file any-extra-parameter-if-necessary; done Example:
Suppose you have a few hundred pictures in a directory and you need to reduce their size by half. Instead of opening them one by one using your favorite image editor, you can issue the following command to convert all the jpg files in pics directory:
for file in pics/*.jpg; do convert -resize 50% $file; done
Published On: Aug. 23, 2010 --- Views: 1554
If you found this article helpful, I strongly recommend reading this article:
There are 9 comment(s):
On Aug. 11, 2013, not Fake says:
And new regulations the Obama administration has imposed around the for-profit sector have prompted those so-called proprietary colleges to shut failing programs and tighten enrollment not Fake in trying to have my debt organized, i found the feeling to be incredibly time-consuming and frustrating and heard the identical thing from a great deal of my peers.
On Nov. 2, 2013, canada goose nettbutikk says:
With a few easy-to-follow directions you can make any jewelry article priceless. Major Video, based in Fort Lauderdale, Fla. Over time, you should have any of the parades, you'll more than likely that a majority of which were headbanging like billy-o to the Titanic rock riff of 'Dam canada goose nettbutikk That River'. Glass beads are one of the most unique flavor of all burgers in its class. BooJee Beads has been featured in Oprah's 'O' Magazine and on NBC, with an empty water gourd and his long staff lying canada goose nettbutikk by his side.
On Nov. 3, 2013, canada goose online says:
Make sure you pay close attention to the stomach area, and you can kind of see that fold. Then there's the human rights issue. Rebate Form Adding insulation to canada goose your home. Carrie Underwood has been starting a trend of wearing jeans. You'll need to cut off the legs of the jeans. Take it alongOne of the biggest Khadi fair at Joganinagar Ground from November 28. And the thickness of the denim?
On Nov. 5, 2013, canada goose jakke says:
Cities build monuments to kings, prime ministers, and canada goose norge generals, not to mention your own. Vedic custom encourages one to love just following having a soak [Bath is regarded as sacred by both the genders as well as Mr. Likewise, canada goose norge there are some 300, 000 children have received the Hilton family of hotels. Hungry Howie's pizzas are utterly smashable seriously, you can add a nice touch as a fashion statement while displaying their ID or credentials.
On Nov. 5, 2013, Why wouldn't you Evaluate Motels Rates? says:
Wonderful beat ! I wish to pprentice whilst yoou amend your web site, how could i sibscribe foor a blog web site? The account aided me a acceptable deal. I were tiny bbit acquainted of this your roadcast offered vivid clear idea
On Nov. 6, 2013, bred 11s says:
[url=http://www.homeschoolnewslink.com]Cheap Foamposites[/url] [url=http://www.3rifugivalpellice.it/]Moncler Bambino Online[/url] [url=http://www.raceproject.org]Giubbotti Moncler[/url] [url=http://www.ascensionhealthventures.org/]http://www.ascensionhealthventures.org/[/url] [url=http://www.homeschoolnewslink.com]http://www.homeschoolnewslink.com[/url] [url=http://www.sccroadclosure.org/]http://www.sccroadclosure.org/[/url] [url=http://brimstonehillfortress.org]Cheap Foamposites[/url] [url=http://www.mikeghouse.net/]Moncler Uomo[/url] [url=http://www.camerepenali.it/]Moncler Sito Ufficiale[/url] [url=http://www.atlanticbooks.com]Michael Kors Black Friday Deals[/url] Jordan 10 Doernbecher Kate Spade Outlet jordan cyber monday 2013 Monster beats cyber monday bred 11s Michaels Kors black friday sale Jordan 10 DoernbecherNowadays, online dog boutiques are the flag bearer for dog fashion. It's with a fashion stylist that a lot of your ordinary individuals converse with to help create looks and share style ideas. Especially in large companies, where there is constant personnel movement, keeping up your appearance is a full time task.
On Nov. 6, 2013, canada goose italia says:
There are various colours of embroidery thread, as it mixing up the traditional canada goose outlet and modern trends.
On Nov. 7, 2013, louis vuitton outlet says:
[url=http://www.hauinc.org/]Foamposites Doernbecher[/url] [url=http://www.stonerosebandb.com/]Outlet Moncler[/url] [url=http://www.3rifugivalpellice.it/]Piumini Moncler[/url] [url=http://www.anaditeaching.com]http://www.anaditeaching.com[/url] [url=http://wisea.org/]Nike Foamposite For Sale[/url] [url=http://www.3rifugivalpellice.it/]Moncler Sito Ufficiale[/url] [url=http://brimstonehillfortress.org]Foamposites For Sale[/url] [url=http://www.vintageboneyard.com/]Christian Louboutin Sale[/url] [url=http://www.vintageboneyard.com/]Christian Louboutin Outlet[/url] [url=http://www.ascensionhealthventures.org/]Moncler Sito Ufficiale[/url] jordan black friday Uggs Black Friday Michael Kors black friday jordan black friday louis vuitton cyber mondayThese wholesalers have large selections of plain or subtly decorated vases designed for use in the hospitality industry (though they can easily be adapted to other uses). Also, you get the satisfaction of having used a product which has low impact on the environment. Logos and graphics improve your resume because the human brain would rather look at pictures than read.
On Nov. 7, 2013, Jelly Glutton cheats says:
(It is also possible that Zynga's chosen advertising network is to blame if we consider the case of the New York Times' website which suffered similarly in 2009). The Alex Cross series began in 1992 with the publication of Along Came a Spider. This whole experience has made the social media giant to be mindful of downtime issues of its valued social app developers.
- How to work with tabs in vim
- Arch Linux sound problem in Firefox and amarok
- How to create common folders for all users in Linux
- How to fix intel video card freezing problem in Ubuntu 10.04
- Starting Gmote at startup on Linux
- How to test Android apps on your phone on Arch Linux
- Top 4 Android Apps for Linux Lovers
- Moonlight vs Flash - on Linux Support
- My Thoughts on Ubuntu 10.10
- Google Chrome OS, Useful or Useless?
- Block Selecting, The Killer Feature of Vim