Shell tip: change to a directory having very long name

by on June 6, 2007 · 3 comments· LAST UPDATED June 6, 2007

in , ,

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

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

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 3 comments… read them below or add one }

1 MickZA June 6, 2007 at 2:39 pm

I recommend appending the last letter as well:


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-


2 nixCraft June 6, 2007 at 4:09 pm


Good example.

Appreciate your post!


3 arman December 22, 2014 at 8:25 pm

I was looking for this.
very useful
thank you


Leave a Comment

Previous post:

Next post: