Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
191 views
Bash equivalent of tcsh M-$?
Way back while studying I used tcsh as my main shell and it had this nifty feature of being able to correct a misspelled command name by pressing Escape - $ which would change e.g. `bsah` to `bash` Now I needed it (apparently kustomize is not keyboard friendly) but could not recall ever having seen...
Way back while studying I used tcsh as my main shell and it had this nifty feature of being able to correct a misspelled command name by pressing Escape-$ which would change e.g. bsah to bash Now I needed it (apparently kustomize is not keyboard friendly) but could not recall ever having seen this in bash. Can bash do this and if so how?
Thorbjørn Ravn Andersen (1064 rep)
May 19, 2023, 01:11 PM • Last activity: Apr 15, 2025, 01:38 AM
4 votes
1 answers
143 views
Make ZSH autocorrect `les` to `less` and not `ls`?
I'd like to change this behavior: ❯ les file.txt zsh: correct 'les' to 'ls' [nyae]? To this: ❯ les file.txt zsh: correct 'les' to 'less' [nyae]? What's the simplest way to do this? I'm looking to retain the autocorrection but revise it a bit, so `alias les=less` is not the kind of solution I seek.
I'd like to change this behavior: ❯ les file.txt zsh: correct 'les' to 'ls' [nyae]? To this: ❯ les file.txt zsh: correct 'les' to 'less' [nyae]? What's the simplest way to do this? I'm looking to retain the autocorrection but revise it a bit, so alias les=less is not the kind of solution I seek.
Allen Luce (165 rep)
Dec 30, 2023, 01:50 AM • Last activity: Jan 6, 2024, 09:29 PM
3 votes
1 answers
741 views
prevent bash to make suggestions for unknown commands (similar commands or apt packages)
On some Linux installations, there is a 'feature' in which bash automatically suggests similar commands or apt packages when you type a command which is not found on the path. I find it very annoying, as this takes several seconds and blocks the terminal. Where is this configured (bash, Ubuntu)? Whe...
On some Linux installations, there is a 'feature' in which bash automatically suggests similar commands or apt packages when you type a command which is not found on the path. I find it very annoying, as this takes several seconds and blocks the terminal. Where is this configured (bash, Ubuntu)? Where can I change/disable this? I just want the errormessage of an unknown command and nothing more. Cannot find anything inside ~/.bashrc . This is the output (takes 10 seconds) on my corporate machine, shortened: > eco 'hello world' Command 'eco' not found, did you mean: command 'ecj' from deb ecj (3.16.0-1) command 'ecc' from deb ecere-dev (0.44.15-1build3) [...] command 'co' from deb rcs (5.9.4-6) command 'ico' from deb x11-apps (7.7+8) command 'peco' from deb peco (0.5.1-1) command 'ecm' from deb gmp-ecm (7.0.4+ds-5) Try: apt install >
Blindleistung (133 rep)
Mar 13, 2023, 03:38 PM • Last activity: Mar 14, 2023, 12:02 AM
2 votes
1 answers
449 views
Text prediction in Linux while typing like on Android, iOS and Windows
I have noticed the utility of this feature while typing on Android devices (notably with Gboard virtual keyboard) [![enter image description here][1]][1] The same is available on iOS, in iPhones and iPads. I don't mean the use of a virtual keyboard on Linux, but the presence of a "suggestion strip"...
I have noticed the utility of this feature while typing on Android devices (notably with Gboard virtual keyboard) enter image description here The same is available on iOS, in iPhones and iPads. I don't mean the use of a virtual keyboard on Linux, but the presence of a "suggestion strip" on the screen, as it is called in Gboard, while typing in Linux, no matter the virtual or physical character of the keyboard. Is this possible to have that with any text editor or at least some of them? Windows 10 already has that it seems . enter image description here
cipricus (1779 rep)
Feb 15, 2021, 02:38 PM • Last activity: Nov 1, 2022, 09:47 PM
3 votes
1 answers
1178 views
Automatically correct simple spelling mistakes in zsh?
How do I tell zsh to correct simple spelling mistakes automatically? For example: I want `lsbkl` to automatically be corrected to `lsblk`, after hitting Enter , without showing `zsh: correct 'lsbkl' to 'lsblk' [nyae]?`. Is this possible to achieve?
How do I tell zsh to correct simple spelling mistakes automatically? For example: I want lsbkl to automatically be corrected to lsblk, after hitting Enter, without showing zsh: correct 'lsbkl' to 'lsblk' [nyae]?. Is this possible to achieve?
weisbrja (251 rep)
Apr 19, 2021, 07:16 AM • Last activity: Jun 12, 2021, 06:08 PM
29 votes
2 answers
4857 views
How to make the zsh "correct" functionality remember my spell-correction decisions
I have enabled correction (I wouldn't call it *autocorrection* specifically because of this issue) in zsh by enabling `setopt correct` in my `.zshrc`. Now, when I type `dtae` in a terminal, I get: dtae zsh: correct 'dtae' to 'date' [nyae]? y Tue Mar 31 11:39:31 CEST 2015 At this point I would like z...
I have enabled correction (I wouldn't call it *autocorrection* specifically because of this issue) in zsh by enabling setopt correct in my .zshrc. Now, when I type dtae in a terminal, I get: dtae zsh: correct 'dtae' to 'date' [nyae]? y Tue Mar 31 11:39:31 CEST 2015 At this point I would like zsh to remember my decision. So the next time I type dtae it should automatically correct to date . However, this does not happen, and zsh is again asking me what to do: dtae zsh: correct 'dtae' to 'date' [nyae]? Unless, of course, if at that time there exists an actual dtae command or alias. **Update:** I have managed to modify the zsh source code (file utils.c, function spckword) to create a custom file containing the aliases automatically created with the invocation of zsh's "correct" functionality: original: if (x == 'y' || x == ' ' || x == '\t') { *s = dupstring(best); if (hist) hwrep(best); } modified: if (x == 'y' || x == ' ' || x == '\t') { char *aliaspath = getenv("HOME"); strcat(aliaspath, "/.zsh_correct_aliases"); FILE *out = fopen(aliaspath, "ab+"); fprintf(out, "alias %s=\'", *s); *s = dupstring(best); fprintf(out, "%s\'\n", *s); fclose(out); if (hist) hwrep(best); } Upon executing dtae, the following line is added to the file ~/.zsh_correct_aliases: alias dtae='date' However, I don't know how to source the newly modified ~/.zsh_correct_aliases file in-place.
shrx (445 rep)
Mar 31, 2015, 09:43 AM • Last activity: May 11, 2021, 01:19 PM
5 votes
1 answers
1330 views
How to teach zsh when not do autocorrect?
I love the autocorrection feature of ZSH, but sometimes it gets in the way: - If I have a `cli` directory, it will be suggested when I try to run `npm run ci`. - When running the Docker command `docker run -v /some/dir:/var/www` it will try to autocorrect to `/some/dir/var/www` - ... and many more N...
I love the autocorrection feature of ZSH, but sometimes it gets in the way: - If I have a cli directory, it will be suggested when I try to run npm run ci. - When running the Docker command docker run -v /some/dir:/var/www it will try to autocorrect to /some/dir/var/www - ... and many more Now I **don't** want to turn off autocorrection or prefix the command with nocorrect. What I would like is more of a "learning" autocorrection that wraps around the normal suggestions, counts how many times I said "no" to a suggestion and does not suggest it any more if I've said "no" for 3 times. I something like this possible?
chiborg (231 rep)
Mar 18, 2017, 10:49 AM • Last activity: Oct 29, 2020, 08:46 AM
0 votes
0 answers
138 views
Why does Zsh correct ssh User@ip1 to User@ip2, and how to stop it?
On Mac OS X 10.9 and `zsh` version 5.0.2 (x86_64-apple-darwin13.0) the `ssh user@192.168.13.2` command traps a correct to `ssh User@192.168.12.2 [nyae]`. I don't want to disable zsh correction on the ssh command completely. How figure out why zsh wants to make this correct, and prevent it from occur...
On Mac OS X 10.9 and zsh version 5.0.2 (x86_64-apple-darwin13.0) the ssh user@192.168.13.2 command traps a correct to ssh User@192.168.12.2 [nyae]. I don't want to disable zsh correction on the ssh command completely. How figure out why zsh wants to make this correct, and prevent it from occurring? Regression: * ssh User@192.168.13.3 also zsh correct to User@192.168.12.2 * ssh 192.168.13.2 does not trap the zsh correct to ssh 192.168.12.2 * ssh User@192.168.13.4 does not zsh correct to User@192.168.12.2 * there is a .zsh_history file of 2013 while zsh is configured for a maximum history of 2000 commands * removing all occurences of ssh User@192.168.12.2 from .zsh_history doesn't improve * both 192.168.13.2 and 192.168.12.2 list as host on tab completion
$ cat .zshrc
setopt correctall
Pro Backup (5114 rep)
Aug 12, 2020, 11:37 AM • Last activity: Aug 20, 2020, 03:59 PM
2 votes
1 answers
174 views
How to fix path typos?
When typing quickly, I often mistype `cd ~/myfiles` as `cd ~?myfiles`, resulting in: zsh: no matches found: ~?myfiles Is there a way ZSH can autocorrect such mistakes?
When typing quickly, I often mistype cd ~/myfiles as cd ~?myfiles, resulting in: zsh: no matches found: ~?myfiles Is there a way ZSH can autocorrect such mistakes?
Flux (3238 rep)
Feb 12, 2020, 11:32 PM • Last activity: Jun 18, 2020, 09:36 AM
3 votes
1 answers
653 views
Don't try to correct a command that, now, exists
I like zsh's autocorrect for commands. It has an annoying feature, however: sometimes I try to run a command, notice it doesn't exist, install it, then try to run it again, and zsh still wants to make the same correction. Zsh does this because keeps a hash of command paths, and it doesn't go beyond...
I like zsh's autocorrect for commands. It has an annoying feature, however: sometimes I try to run a command, notice it doesn't exist, install it, then try to run it again, and zsh still wants to make the same correction. Zsh does this because keeps a hash of command paths, and it doesn't go beyond the hash when doing autocorrection. If I say n to the correction after installing the command, the command does run, but I have to say n again each time I want to run the command, or update the command hash in each running instance by calling the hash builtin. I do want zsh to keep a hash of command paths, and I want to keep autocorrection (i.e. I type a command name and press Enter as usual, and zsh suggests a correction if the command does not exist). However, I want “the command does not exist” to mean that the command is not on $path at this point in time, not that the command is does not exist. Steps to reproduce: $ mkdir /tmp/test $ cp /bin/true /tmp/test/wibble $ PATH=/tmp/test:/bin zsh -f -o correct darkstar% wobble zsh: correct 'wobble' to 'wibble' [nyae]? a darkstar% cp /tmp/test/{wibble,wobble} darkstar% wobble zsh: correct 'wobble' to 'wibble' [nyae]? n Desired behavior: when wobble exists, don't prompt to correct it. How can I do this?
Gilles 'SO- stop being evil' (862422 rep)
May 19, 2018, 06:50 PM • Last activity: Oct 26, 2019, 09:45 PM
0 votes
1 answers
360 views
Disable command name autocorrection
I would like to disable a feature. However Zsh is ignoring the settings I am inputting: > bind zsh: correct 'bind' to 'find' [nyae]? n zsh: command not found: bind > setopt nocorrectall > bind zsh: correct 'bind' to 'find' [nyae]? n zsh: command not found: bind > unsetopt correctall > bind zsh: corr...
I would like to disable a feature. However Zsh is ignoring the settings I am inputting: > bind zsh: correct 'bind' to 'find' [nyae]? n zsh: command not found: bind > setopt nocorrectall > bind zsh: correct 'bind' to 'find' [nyae]? n zsh: command not found: bind > unsetopt correctall > bind zsh: correct 'bind' to 'find' [nyae]? n zsh: command not found: bind How are these properly used?
user327359
May 3, 2019, 11:24 PM • Last activity: May 4, 2019, 11:22 PM
2 votes
3 answers
1407 views
Did you mean this command instead? (how to reply to this)
Suppose I entered the following thing into terminal: `wgets "link"` I will get the response: > No command 'wgets' found, did you mean: Command 'wget' from package 'wget' (main) I made a mistake, and the terminal warned me. Is there a command that I can type after the terminal warned me, so that then...
Suppose I entered the following thing into terminal: wgets "link" I will get the response: > No command 'wgets' found, did you mean: Command 'wget' from package 'wget' (main) I made a mistake, and the terminal warned me. Is there a command that I can type after the terminal warned me, so that then it will execute the command above with what it thought it was? For example: ->wgets "link" ->No command 'wgets' found, did you mean: Command 'wget' from package 'wget' (main) ->yes (this command I am looking for ... is there one?) -> executing wget "link"
K Split X (1803 rep)
Jun 23, 2017, 08:27 PM • Last activity: Jan 17, 2019, 12:20 PM
6 votes
1 answers
1806 views
Stop ZSH from trying to correct ssh to .ssh as an argument
This isn't exactly a duplicate, as I want correct_all still active. I do mess up arguments from time to time and ZSH is happy to help me. The rub happens when I am in my home directory and I want to manage sshd with something like `systemctl reload ssh` or `service ssh start` it always asks me if I...
This isn't exactly a duplicate, as I want correct_all still active. I do mess up arguments from time to time and ZSH is happy to help me. The rub happens when I am in my home directory and I want to manage sshd with something like systemctl reload ssh or service ssh start it always asks me if I want to correct to .ssh. I usually perform my work in $HOME so this gets rather annoying. I have already tried alias ssh='nocorrect ssh' and alias ssh='nocorrectall ssh' (which I don't think does anything). Any ideas on how to solve this?
user52470 (260 rep)
Feb 7, 2018, 03:51 AM • Last activity: Feb 7, 2018, 07:39 AM
1 votes
1 answers
148 views
mispelled command in UNIX?
I don't remember a UNIX command that allowed you to remember how to write correctly a command. Let's supose that the command that I say is called MISPELL So running MISPELL will produce the following output: $ MISPELL chlmod Output: chmod
I don't remember a UNIX command that allowed you to remember how to write correctly a command. Let's supose that the command that I say is called MISPELL So running MISPELL will produce the following output: $ MISPELL chlmod Output: chmod
Joshua Salazar (385 rep)
Nov 11, 2016, 04:02 AM • Last activity: Nov 11, 2016, 11:27 PM
0 votes
1 answers
5244 views
zsh Command Auto correction
I've seen and read about zsh offering auto correction of a command input. Eg- if I type sl, it should ask me something like "did you mean ls?" But, in my zsh, this does not happen. It just gives an error. Is there a reason for this, some settings maybe? (And yes, I'm sure that I'm running zsh and no...
I've seen and read about zsh offering auto correction of a command input. Eg- if I type sl, it should ask me something like "did you mean ls?" But, in my zsh, this does not happen. It just gives an error. Is there a reason for this, some settings maybe? (And yes, I'm sure that I'm running zsh and not bash or something)
Tulsi Kanodia (129 rep)
Aug 29, 2016, 04:51 PM • Last activity: Aug 29, 2016, 04:59 PM
1 votes
0 answers
68 views
highlighting of zsh correction
When zsh's autocorrection suggests a change in long filename, it may be hard to spot which change is actually suggested: [![artificial example][1]][1] The example is of cause artificial as tab completion would've done the job (and I can blindly accept the correction w/o proofreading). But there may...
When zsh's autocorrection suggests a change in long filename, it may be hard to spot which change is actually suggested: artificial example The example is of cause artificial as tab completion would've done the job (and I can blindly accept the correction w/o proofreading). But there may be other cases where I really want to proofread the suggestion and would appreciate if the suggested change (i.e. only the added 0 in the example) was highlighted in boldface. EDIT: It's also discussed [on zsh-workers](http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=38538) and [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting/issues/323)
pseyfert (890 rep)
Feb 28, 2016, 01:27 PM • Last activity: Jun 10, 2016, 07:06 AM
17 votes
1 answers
706 views
Is it standard behaviour for cd to automatically choose when given an incomplete directory name?
I have three folders called `ProjectA`, `ProjectB` and `ProjectC`. When I `tab`-complete `cd` to `cd Project` and press Enter , it chooses `ProjectC`. I've found this is also the case with other similar cases; it defaults to the last in lexicographic order (but this may also be most recently changed...
I have three folders called ProjectA, ProjectB and ProjectC. When I tab-complete cd to cd Project and press Enter, it chooses ProjectC. I've found this is also the case with other similar cases; it defaults to the last in lexicographic order (but this may also be most recently changed/added). Is this expected default behaviour for cd, or have I set something by accident here? I'm running OSX 10.10.3, with bash 4.3.
Rob Holt (173 rep)
May 26, 2015, 06:00 AM • Last activity: May 26, 2015, 06:30 AM
5 votes
2 answers
350 views
Display possible corrections but do not apply them automatically
I have the following completion: zstyle ':completion:*' completer _complete _approximate As a result if I type something incorrectly and hit TAB I will see a list with corrected propositions (what I like) and at the same time misspelled word will be changed automatically at command line with first p...
I have the following completion: zstyle ':completion:*' completer _complete _approximate As a result if I type something incorrectly and hit TAB I will see a list with corrected propositions (what I like) and at the same time misspelled word will be changed automatically at command line with first proposition (what I do not like). So how to get rid of this in-line automatic correction? I just want list of possible correction but command line should stick with original text.
WeSenseASoulInSearchOfAnswers (567 rep)
Aug 18, 2014, 02:44 PM • Last activity: Aug 19, 2014, 02:46 PM
7 votes
1 answers
1887 views
can you make zsh autocorrect smarter?
I like `zsh` autocorrect, but it keeps asking me about things that don't need correcting. dzil build zsh: correct 'build' to '.build' [nyae]? % `.build` is a directory created by the `build` (or any other commands that run that action so `dzil .build` is always wrong, and `dzil build` is always righ...
I like zsh autocorrect, but it keeps asking me about things that don't need correcting. dzil build zsh: correct 'build' to '.build' [nyae]? % .build is a directory created by the build (or any other commands that run that action so dzil .build is always wrong, and dzil build is always right. Is there any way I can communicate this to the autocorrect system?
xenoterracide (61213 rep)
Aug 2, 2013, 05:14 AM • Last activity: Aug 6, 2013, 02:14 AM
4 votes
2 answers
682 views
Is there a (preferably non-kludgey) way to avoid spelling corrections when using zsh's `mv` command
Although I love zsh, and find its spelling correction useful, it is annoying that it corrects things that ***obviously*** should not be corrected. For instance, I just executed mv iso_ iso and it replied zsh: correct 'iso' to 'iso_' [nyae]? Think about it. Correcting 'iso' to 'iso_' would mean I was...
Although I love zsh, and find its spelling correction useful, it is annoying that it corrects things that ***obviously*** should not be corrected. For instance, I just executed mv iso_ iso and it replied zsh: correct 'iso' to 'iso_' [nyae]? Think about it. Correcting 'iso' to 'iso_' would mean I was trying to execute mv iso_ iso_ which would NEVER make sense. Therefore this is really a design flaw in zsh, and should be corrected across the board. But, given that it hasn't been (at least in the version I'm using) and it isn't likely to be, is there some setting to correct it? I would prefer a non-kludgey way of fixing it. Aliases for mv, for example, are kludgey.
iconoclast (9402 rep)
Jul 17, 2012, 04:08 PM • Last activity: Nov 16, 2012, 02:28 PM
Showing page 1 of 20 total questions