About nixCraft

Topics

Shell tip: change to a directory having very long name

Posted by Vivek Gite [Last updated: June 6, 2007]

Let us say your have a long directory name called "A_VERY_ VERY LONG_ DIRECTORY_NAME_TO_ TYPE _ A _ B _C"...

So how do you change to a directory, which is having very long name without typing full name?

Simply use a wildcard character called * as follows
$ cd A_VERY_VERY*

Or type cd A_VERY and hit tab key to complete a directory name :)
$ cd A_VERY_VERY (hit tab key)

E-mail this to a friend      Printable version

You may also be interested in other helpful articles:

Discussion on This Article:

  1. MickZA Says:

    I recommend appending the last letter as well:

    $ cd A_VERY_VERY*C

    Better example:

    $ cd /usr/lib/fire*10/plugins

    or for total brevity:

    $ cd /us*/li*/fir*10/pl* gets you to same place

    namely /usr/lib/firefox-1.5.0.10/plugins

  2. vivek Says:

    MickZA,

    Good example.

    Appreciate your post!

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.