General :: Tab-Completion In Bash Indexing System Folders?
Nov 15, 2010
tab-completion indexes system folders (like /usr/bin, /usr/local/bin)! so say i'm in a folder that has two files, 'text' and 'myprog', i type in an 'm' then tab, and i get hundreds of results including 'mysql', 'mysqlconfig', and others as im sure you can imagine. is there a way to set it to default or something else that will only make it index the current folder?
i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem. using 'unset PATH', of course, removes everything from PATH, which meant that functions (like 'ls') in /usr/bin and /usr/local/bin can't be found. obviously i want those to be found, but i would rather not tab through them!
View 2 Replies
ADVERTISEMENT
Jun 2, 2010
I switched to zsh, but I dislike the completion. If I have 20 files, each with a shared prefix, on pressing tab, zsh will fully complete the first file, then continue going through the list with each press of tab. If I want one near the end, I would have to press tab many times.
In bash, this was simple - press tab and I would get the prefix. If I continued typing (and pressing tab), bash would complete as far as it could be certain of. I find this behavior to be much more intuitive but prefer the other features of zsh to bash.
Is there a way to get this style of completion? Google suggested setopt bash_autolist, but this had no effect for me (and no error message was printed upon starting my shell).
View 1 Replies
View Related
May 26, 2011
Is there any other short/easier and smarter way to do the following in Linux? code...
I need to use crontab to create folders every day and every month inside /home/abcd/dammi, /home/abcd/harrami, /home/wxyz/dammi and /home/wxyz/harrami. Can anyone help me with this?
View 2 Replies
View Related
Dec 15, 2010
I wondered if theres a way to do rotational style completion in bash similar to the behavoir on cmd.exe, I've found it speeds me up in regard to entering commands
View 2 Replies
View Related
Feb 16, 2010
I am writing completion function for one PHP framework called symfony. It has command line interface with syntax:
Code:
symfony [options] [namespace:]action
I want to make action be autocompletable. The function is simplest so far:
Code:
function _symfony_commands()
{
[ -r "cache/completion/.sf" ] && cat cache/completion/.sf
}
[code]....
But, if there is : symbol which separate namespace from action problems coming:
symfony doct[TAB]
will be completed to
symfony doctrine:
But nothing happens if you want complete after : symbol. I've found out that for readline there is three words because it splits line with $COMP_WORDBREAKS
Code:
$ echo $COMP_WORDBREAKS
"'><=;|&(:
I played with $COMP_WORDS array and tried every thought I had to make it work, but failed.
What I should do to escape colon and make readline consider it as one word? Or there is way perhaps to workaround it?
View 2 Replies
View Related
Feb 27, 2011
Is there a way to get colored output when using tab completion in a terminal? My colors are fine everywhere else so I know that I've enabled a color terminal successfully. Using bash in Ubuntu (10.10).
View 1 Replies
View Related
Dec 10, 2009
New Fedora 12 install - I installed the bash_completion package, but it's not filling in knowhosts for ssh. It worked fine in Fedora 11. Is there something I've done wrong, or is this missing in F12?
View 6 Replies
View Related
Apr 29, 2010
Just installed 10.04 64bit and in gnome-terminal i have no bash completion when sudo is used.For example:apt- gives apt-getbut sudo apt- does nothing, i get no suggestions from the terminal.
View 6 Replies
View Related
Mar 28, 2011
I have disabled root ssh logins for security. When I am logged in as a normal user over SSH and do a su into root the tab-completion stops working with apt. It still works when doing normal file-browsing, on the original user1, and it has worked previously when logged directly into root. How do I make it autocomplete again? I am using Debian Stable on a headless homeserver.
View 3 Replies
View Related
Jul 12, 2011
Can fedora do bash completion of package names in yum?
View 4 Replies
View Related
Jul 17, 2010
Out of the box, Bash in 10.04 is configured such that it won't expand/complete parameters when there's a single match for a parameter with a leading wildcard. For example, if I have the following files in a directory:
Code:
ABC.bin
DEF.bin
GHI.bin
...and I type cp *E*, I expect to be able to press TAB and have Bash expand *E* to DEF.bin, since that's the only file in the directory with a capital E in its name.
(Note: if I actually submit the command with the wildcards in place, the correct file will be used then, but I don't get to see it beforehand.) I imagine there's something in /etc/bash_completion that's preventing this from working properly. Does anyone know what it is?
View 1 Replies
View Related
Aug 26, 2010
[URL]
Code:
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
What versions of Ubuntu have this commented out? Every version I have used always has this uncommented.
View 1 Replies
View Related
Nov 25, 2009
According to the Bash man pages, Quote: HOSTFILE Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, bash adds the contents of the new file to the existing list. If HOSTFILE is set, but has no value, bash attempts to read /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset, the hostname list is cleared.
Here's the line in my .bashrc where HOSTFILE is set:
Code:
export HOSTFILE="~/.hosts"
I opened a new bash session, created ~/.hosts, filled it with the names of servers that I wanted to expand using tab completion. then typed
Code:
ssh p<tab><tab>
expecting to get a lists of all of the hosts in ~/.hosts starting with 'p'. Bash simply beeped at me twice.
I tried
Code:
$ shopt hostcomplete
hostcomplete on
Code:
ssh bchittenden@p<tab><tab>
same results.
[code].....
View 2 Replies
View Related
Feb 16, 2011
/etc/bash_completion.d/slapt has a syntax error that causes x to fail to load. I had to move the file to be able to run x. Here is the offending file:
[URL]
View 12 Replies
View Related
May 27, 2011
I've spent some time searching for answers to this and I haven't found much at all.Please feel free to post pointers to other threads that discuss this particular problem, if you find any.The problem is that in bash I want to mount an iso file to inspect the contents with the command:Code:sudo mount myCD.iso CDMount -o loopThe command works fine, but pressing tab to complete either the iso filename or the CDMount directory does not work. The completion suggestions I get are existing mountpoints which The completion suggestions should include the files and directories in the current directory. This worked with Ubuntu 10.04 and not with 11.04.
View 1 Replies
View Related
Jan 20, 2011
I have a bash script that checks for contents in a folder every 15 seconds and then acts on it's contents. This works great for the average size file however on very large files it starts acting on the file before it's completely written. Is there a facility in bash shell to get a file complete signal or such? here is trigger to launch a larger script.
Code:
#!/bin/sh
while true
do
$HOME/bin/hpgl.sh >/dev/null 2>&1 &
[code].....
View 10 Replies
View Related
Sep 18, 2010
How would I go about finding all the folders in a directory than contain less than x number of .flac files?
View 2 Replies
View Related
Sep 14, 2011
Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
View 3 Replies
View Related
Oct 10, 2010
Any script to categorize folders with similar name into one directory. For example: There are 4 directories named LinuxFedora, LinuxUbuntu, WindowsXP and Windows7. The script should be able to create two folder named Linux and Windows wheree respective directories are moved.
Next example: If there are many folder as below:
DevLys 010
DevLys 010
[code]...
View 1 Replies
View Related
Feb 15, 2011
I am administrating a lab in a university and every semester we need to delete all the home folders of the accounts for the next semester. I would like to make a bash script that does this automatically and having trouble with it. Note that I am writing my very first bash script. What I need to do is make a script to delete the following:
Delete everything in /home/$exp$num/$dir
when "exp" could be either "rt", "ic" or "sp".
"num" could run from 1(single digit) to 45 and dir is "profile" and "work".
This is what I tried to write:
Code:
#!/bin/sh
cd /home
for exp in "rt ic sp"
do
[code]....
What seems to be the problem is the reading of "$exp$num" as a joint expression.
View 4 Replies
View Related
Dec 2, 2010
I am looking for a script/advice or guidance on how to write a script so that when I use the 'del' command it removes/sends the files/folders to a I specify for example 'dustbin
View 13 Replies
View Related
Nov 28, 2010
I have a computer running Ubuntu 10.10 32-bit with Gnome and another computer running Windows 7 64-bit. How can I share folders between these? I can use Samba to view my Windows shares, if I specify the IP address by going to the "Connect to Server..." option in the Places menu. Going to "Network" in Nautilus and trying to open "Windows Network" fails because it could not retrieve the share list from the server.
MY question, though, is how can I set up Samba (or some other software) such that my Windows box will be able to see my shared folders? And also, what is the difference between Samba and Samba4 (because both are in the repositories).
View 1 Replies
View Related
Jul 8, 2010
i have a centos 5.4 without desktop environment. i can only access certain system settings via browser (and of course console). i would like to encrypt some folders. but these folders are used by the system. can i encrypt them? will the system still be able to access these folders? if yes, how can i encrypt only through console or is there something web based software for this?
View 12 Replies
View Related
Oct 7, 2010
I'm looking for a script to run that will be run from my linux box to copy folders from a windows server at a certain time on a daily basis.
View 2 Replies
View Related
Feb 21, 2011
Is there any way to share folders in linux machine to windows machine except samba and ftp..
samba is blocking by the hosting company.
View 3 Replies
View Related
Apr 9, 2010
I need to organise an external HDD such that there is no more than 500 folders on it.
Ubuntu's "Properties" pane shows only the file count, not the folder count.
Is there a simple CLI line that will tell me the number of subdirectories?
View 3 Replies
View Related
Sep 17, 2009
I am new to Linux.I have installed dual boot, XP(NTFS) and Enterprise Linux Server on same desktop.Now how can I access windows files & folders from Enterprise Linux Server?
View 4 Replies
View Related
Jul 28, 2010
Is it possible to use TAB completion in a script. For example I have a folder (A) that contain only one folder (B) and the script file.
Quote:
mahmood@localhost:A$ ls
B
script.sh
How can I send TAB key code in script?
View 2 Replies
View Related
Dec 1, 2009
how I sould do the following?
I have a folder called "Downloads" and among its contents there are a bunch of files with "flv" extension.
If I do
Code:
ls path/to/Downloads/*flv
I will get something like this:
[Code]....
(The reason I want something like that has to do with a small script I'm trying to write).
View 5 Replies
View Related
Aug 4, 2010
Are there shell versions that have a more intelligent tab completion? I'd like to be able to type cd foo-<TAB> Then it would show me the possible completions along with numbers that I can type to select one of them:
cd foo-<TAB>
(1) foo-bar1 (2) foo-bar2 (3) foo-bad
So, after <TAB> I would type 3 and it would take me to foo-bad. Alternatively, using the arrow keys instead of typing the number would be fine.
View 2 Replies
View Related