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)
E-mail this to a friend
Printable version
You may also be interested in other helpful articles:
- nixCraft FAQ Roundup
- Tutorial: Working with UNIX and Linux Shell
- Temporary memory files and shell scripts
- BASH Shell Frequently Asked Questions
- BASH shell scripting tip: Set default values for variable
Discussion on This Article:
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!


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
MickZA,
Good example.
Appreciate your post!