Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not sure exactly how to describe this so bear with me. When I create a shortcut in CentOS for example, instead of typing the full path I can usually type ln -s `pwd`/ and then I press tab for it to print out the working directory before finishing the full path. In some distros I can't do this (use tab to complete) and I'm not sure what has to be set in the environment to make this work. In particular, I'm trying to do this in debian/ubuntu.
e.g.
If I'm currently in /usr/local/morgan and want to create a shortcut named blah to the folder called "test" I would type:
ln -s `pwd`/test *press tab* and then it would become:
ln -s /usr/local/morgan/test
so all I have to do is hit spacebar and type "blah".
One of the nicest facilities of the modern shell is the built in "completion" support. These facilities allow you to complete commands and their arguments easily. Read on for a brief introduction to adding your own command completions.
Most shells allow command completion, typically bound to the TAB key, which allow you to complete the names of commands stored upon your PATH, file names, or directory names. This is typically used like so:
I think it must be built into bash on some distros because I don't have it installed on my system, but the tab key auto-completes filenames and commands anyway, just having the bash package installed.
But I'd see if bash-completion is in the repository for your distro. If not, wait for someone else to answer.
In AIX, I use 'Esc' followed by '\' for auto completion. I must warn you though that this isn't as neat as the bash "tab" feature because:
1) You do not get to see all possible options by hitting tab twice for a
given sequence of characters.
2) If there are more than one possibility for a given sequence, the prompt
just refuses to budge unless you give the next few characters.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.