LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags , , , ,

Reply
 
Thread Tools
Old 06-20-2009, 03:37 PM   #1
Captain Morgan
LQ Newbie
 
Registered: Jun 2005
Posts: 4
Thanked: 0
'pwd' question


[Log in to get rid of this advertisement]
Hi all,

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".

Thanks
Captain Morgan is offline  
Tag This Post , , , ,
Reply With Quote
Old 06-20-2009, 04:23 PM   #2
Andy Alkaline
Member
 
Registered: Jun 2004
Location: Minnesota
Distribution: Slackware 12.2
Posts: 78
Thanked: 2
bash completion

You might need a package called bash-completion.

http://www.debian-administration.org/articles/316
Quote:
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.
Andy Alkaline is offline     Reply With Quote
Old 08-19-2009, 04:59 AM   #3
mufy
Member
 
Registered: Oct 2004
Location: Kuwait
Distribution: Currently RHEL 4 ES, FC 10, AIX
Posts: 136
Thanked: 0
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.
mufy is offline     Reply With Quote
Old 08-19-2009, 05:02 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Ubuntu Karmic, CentOS 5.4
Posts: 2,500
Thanked: 158
Which version of Ubuntu are you using? Hardy and Jaunty at least have this completion facility by default. You do not need to install the package.
linuxlover.chaitanya is offline     Reply With Quote
Old 08-19-2009, 05:21 AM   #5
catkin
Senior Member
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.0
Posts: 1,850
Blog Entries: 6
Thanked: 226
Check whether /etc/bash_completion exists and is sourced in at least one of /etc/bash.bashrc, /etc/profile and ~/.bashrc
catkin is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the dirname only from pwd? EmLS Linux - General 3 04-21-2006 02:22 AM
question about putting pwd in $PATH nadroj Linux - Newbie 5 05-30-2005 05:34 PM
reset pwd to root's current pwd? ataraktos2 Linux - General 10 04-26-2005 05:13 AM
PWD question : Current dir not full path facets Programming 2 06-09-2004 05:58 AM
pwd Penguin666 Linux - General 1 11-19-2003 08:54 PM


All times are GMT -5. The time now is 06:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration