LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-30-2010, 11:25 PM   #16
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946

There's also a seemingly little-known shopt option called autocd. From the man page:

Code:
autocd  If  set, a command name that is the name of a directory
	is executed as if it were the argument to the cd command.
	This option is  only used by interactive shells.
 
Old 06-30-2010, 11:59 PM   #17
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,071

Original Poster
Rep: Reputation: 45
I did not realize shopt was a builtin command.

Last edited by stf92; 07-01-2010 at 12:09 AM.
 
Old 07-01-2010, 12:05 AM   #18
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 109Reputation: 109
wow, I should read the bash manual, autocd and cdspell seem to be very useful... But it appears that my function solution also allows for the user typing a partial directory name and hitting enter. If the DIRLIST is crafted well enough with the most important directories listed first, then your option will be a few <enter> keys away...

Then again, if you install the bash-completion scripts, they probably allow you to tab complete a prefix if it's in your CDPATH.
 
Old 07-01-2010, 06:51 AM   #20
sebas2
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 1
autojump

Hi,
I've never tried it, but I grabbed this URL sometime ago, and it seems to do what you want :
http://wiki.github.com/joelthelion/autojump/
Regards
 
1 members found this post helpful.
Old 07-01-2010, 10:49 AM   #21
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,071

Original Poster
Rep: Reputation: 45
@sebas2: most useful your link. Autojump is tiny and fast. Regards.
@JZL240I-U: thanks for the plentiful documentation. Cheers.
 
Old 07-08-2010, 10:10 PM   #22
axobeauvi
Member
 
Registered: Apr 2003
Posts: 128

Rep: Reputation: 16
this is a bit off of what you're asking, but the tab key is the auto complete.
if you want to change dir or whatever type the command then the first few characters then hit tab, it will work up/down the directory tree
 
Old 07-08-2010, 11:13 PM   #23
allanf
Member
 
Registered: Sep 2008
Location: MN
Distribution: Gentoo, Fedora, Suse, Slackware, Debian, CentOS
Posts: 97
Blog Entries: 1

Rep: Reputation: 19
Quote:
Originally Posted by stf92 View Post
Linux kernel 2.6, GNU (Slackware 12.0).

Hi:

In the old days of M$-DOS, there was the NCD (Norton Change Directory) utility. Anything of the sort in Linux? Explanatory note: you typed out the name of the directory you wanted to go to, that is, last element of the dir path.
And you were, ipso facto, in that dir. If that was the only one by that name, good. When not, and if that wasn't the intended dir, you typed the same command again and you were in a second dir of that name. If this was the intended dir, good. And so on.
It simply maintained a data base with the whole tree, and updated it when invoked from a newly created dir o by means of an option, NCD/R.

Regards.
In the even before M$-DOS days there was Unix (of which the Linux system is a Unix flavor and Unix had its X-Window System since 1984 and with colors since 1985).
 
Old 07-08-2010, 11:14 PM   #24
allanf
Member
 
Registered: Sep 2008
Location: MN
Distribution: Gentoo, Fedora, Suse, Slackware, Debian, CentOS
Posts: 97
Blog Entries: 1

Rep: Reputation: 19
Quote:
Originally Posted by sebas2 View Post
Hi,
I've never tried it, but I grabbed this URL sometime ago, and it seems to do what you want :
http://wiki.github.com/joelthelion/autojump/
Regards
Bash and vim already have tab completion. Why another tool???
 
  


Reply

Tags
bashrc, directory


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change KDE 4 effects from CLI??? jmite Linux - Newbie 3 11-18-2008 01:52 PM
can only change network with GUI, not CLI learnfast Linux - Newbie 2 05-03-2005 06:30 AM
How do I change my monitor via cli? TheBelush Linux - Newbie 2 03-29-2005 11:07 PM
How can I copy a directory and it's contents with CLI? CyberLord_7 Linux - General 2 03-30-2004 11:35 AM
Change cli login prompt? ipslave Slackware 1 05-06-2003 07:42 AM


All times are GMT -5. The time now is 08:26 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration