Shell tip: change to a directory having very long name

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)

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 2 comments… read them below or add one }

1 MickZA 06.06.07 at 2:39 pm

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 06.06.07 at 4:09 pm

MickZA,

Good example.

Appreciate your post!

Leave a Comment

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

Previous post: Linux kernel history and distribution time line

Next post: PHP, Perl, MySQL web programming tutorials, howtos for beginners and novice users