Search for a previous command with the same prefix when I press Up at a shell prompt
Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd
in the terminal and push the "up" arrow you can browse all the commands in the history starting with cd
which makes you gain a lot time.
I don't know how to enable this feature in Linux Debian or CentOS which force me to type the whole, could someone please help.
bash shell zsh command-history tcsh
add a comment |
Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd
in the terminal and push the "up" arrow you can browse all the commands in the history starting with cd
which makes you gain a lot time.
I don't know how to enable this feature in Linux Debian or CentOS which force me to type the whole, could someone please help.
bash shell zsh command-history tcsh
7
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
2
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by puttingbindkey -k (up|down) history-search-(back|for)ward
in my.tcshrc
as described here. Cool!
– Garrett Albright
Oct 17 '13 at 20:27
add a comment |
Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd
in the terminal and push the "up" arrow you can browse all the commands in the history starting with cd
which makes you gain a lot time.
I don't know how to enable this feature in Linux Debian or CentOS which force me to type the whole, could someone please help.
bash shell zsh command-history tcsh
Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd
in the terminal and push the "up" arrow you can browse all the commands in the history starting with cd
which makes you gain a lot time.
I don't know how to enable this feature in Linux Debian or CentOS which force me to type the whole, could someone please help.
bash shell zsh command-history tcsh
bash shell zsh command-history tcsh
edited Oct 17 '13 at 22:12
Gilles
528k12810571583
528k12810571583
asked Oct 17 '13 at 17:10
Abdelilah Benaou
11527
11527
7
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
2
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by puttingbindkey -k (up|down) history-search-(back|for)ward
in my.tcshrc
as described here. Cool!
– Garrett Albright
Oct 17 '13 at 20:27
add a comment |
7
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
2
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by puttingbindkey -k (up|down) history-search-(back|for)ward
in my.tcshrc
as described here. Cool!
– Garrett Albright
Oct 17 '13 at 20:27
7
7
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
2
2
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by putting
bindkey -k (up|down) history-search-(back|for)ward
in my .tcshrc
as described here. Cool!– Garrett Albright
Oct 17 '13 at 20:27
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by putting
bindkey -k (up|down) history-search-(back|for)ward
in my .tcshrc
as described here. Cool!– Garrett Albright
Oct 17 '13 at 20:27
add a comment |
5 Answers
5
active
oldest
votes
Add to the following to ~/.inputrc
:
# Press up-arrow for previous matching command
"e[A":history-search-backward
# Press down-arrow for next matching command
"e[B":history-search-forward
Explanation
~/.inputrc
is the configuration file for GNU readline. Many shells, including bash
and tcsh
use readline for command line editing. The two lines above will tell readline to invoke its history search functionality when the escape sequences for the up-arrow key (e[A
) and down-arrow key (e[B
) are encountered.
I like to add F12 to put last word of the last line onto end of current command.Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start.~/.inputrc
is a handy tool.
– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
add a comment |
What's happening is that FreeBSD and Linux use different shells by default. FreeBSD defaults to tcsh, which had better interactive features than bash in the past (but bash has caught up) but markedly worse scripting features.
The most straightforward way to get the environment you're used to would be to switch your shell to tcsh on Linux. Provided that tcsh is installed system-wide (if it isn't, ask your system administrator to install it), run chsh -s tcsh
to change your default shell.
Alternatively, you can set up bash to have this command you're used to. By default, the Up and Down arrows navigate among all the commands in the history, not just the ones that start with the prefix you've typed. To change this to the behavior you're used to, put the following lines in bash's initialization file, which is .bashrc
in your home directory. Either run . ~/.bashrc
or start a new shell to re-read the initialization file.
bind '"eOA": history-search-backward'
bind '"e[A": history-search-backward'
bind '"eOB": history-search-forward'
bind '"e[B": history-search-forward'
The escape sequences are what your terminal sends to the shell when you press an arrow key. Up may be eOA
(escape, O
, A
) or e[A
depending on your terminal, and similarly for Down.
By default, bash offers different key bindings to search the command history. You can press Ctrl+R, then enter some characters to search for a command containing this substring anywhere on the line. Press Ctrl+S to go forward instead of backward. The search is incremental (i.e. as-you-type); Alt+P and Alt+N give you a non-incremental search.
Instead of bash and tcsh, you could switch to zsh, which has some neat features not found in other shells. Zsh has Ctrl+R and
Ctrl+S by default just like bash. To get Up and Down like you had in tcsh, put the following lines in ~/.zshrc
:
bindkey 'eOA' history-beginning-search-backward
bindkey 'e[A' history-beginning-search-backward
bindkey 'eOB' history-beginning-search-forward
bindkey 'e[B' history-beginning-search-forward
If you'd like to use the same shell everywhere, you can use bash or zsh on FreeBSD too, provided that the port is installed (again, ask your system administrator).
add a comment |
tcsh
is available for most Linux distributions. Try installing the tcsh
package, then running chsh -s /bin/tcsh
to make it your default shell.
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
add a comment |
Other answers tackle it, but if you want more, take a look at https://github.com/zsh-users/zsh-history-substring-search
Prezto (https://github.com/sorin-ionescu/prezto) is also full of zsh goodies.
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
add a comment |
If I start typing in my terminal, i.e. cd <press up arrow>
and then if i wanna go back to just cd
by pressing Down Arrow
it won't take me just cd
but rather the last search from history of cd
, is it possible to go back to just cd
instead of the cd last search
? cheers
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96510%2fsearch-for-a-previous-command-with-the-same-prefix-when-i-press-up-at-a-shell-pr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add to the following to ~/.inputrc
:
# Press up-arrow for previous matching command
"e[A":history-search-backward
# Press down-arrow for next matching command
"e[B":history-search-forward
Explanation
~/.inputrc
is the configuration file for GNU readline. Many shells, including bash
and tcsh
use readline for command line editing. The two lines above will tell readline to invoke its history search functionality when the escape sequences for the up-arrow key (e[A
) and down-arrow key (e[B
) are encountered.
I like to add F12 to put last word of the last line onto end of current command.Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start.~/.inputrc
is a handy tool.
– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
add a comment |
Add to the following to ~/.inputrc
:
# Press up-arrow for previous matching command
"e[A":history-search-backward
# Press down-arrow for next matching command
"e[B":history-search-forward
Explanation
~/.inputrc
is the configuration file for GNU readline. Many shells, including bash
and tcsh
use readline for command line editing. The two lines above will tell readline to invoke its history search functionality when the escape sequences for the up-arrow key (e[A
) and down-arrow key (e[B
) are encountered.
I like to add F12 to put last word of the last line onto end of current command.Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start.~/.inputrc
is a handy tool.
– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
add a comment |
Add to the following to ~/.inputrc
:
# Press up-arrow for previous matching command
"e[A":history-search-backward
# Press down-arrow for next matching command
"e[B":history-search-forward
Explanation
~/.inputrc
is the configuration file for GNU readline. Many shells, including bash
and tcsh
use readline for command line editing. The two lines above will tell readline to invoke its history search functionality when the escape sequences for the up-arrow key (e[A
) and down-arrow key (e[B
) are encountered.
Add to the following to ~/.inputrc
:
# Press up-arrow for previous matching command
"e[A":history-search-backward
# Press down-arrow for next matching command
"e[B":history-search-forward
Explanation
~/.inputrc
is the configuration file for GNU readline. Many shells, including bash
and tcsh
use readline for command line editing. The two lines above will tell readline to invoke its history search functionality when the escape sequences for the up-arrow key (e[A
) and down-arrow key (e[B
) are encountered.
edited Oct 17 '13 at 17:33
answered Oct 17 '13 at 17:16
Thomas Nyman
20k74969
20k74969
I like to add F12 to put last word of the last line onto end of current command.Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start.~/.inputrc
is a handy tool.
– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
add a comment |
I like to add F12 to put last word of the last line onto end of current command.Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start.~/.inputrc
is a handy tool.
– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
I like to add F12 to put last word of the last line onto end of current command.
Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start. ~/.inputrc
is a handy tool.– jalanb
Dec 8 '15 at 3:11
I like to add F12 to put last word of the last line onto end of current command.
Last word
is often a path which I want try out in various arcane clichés. And Shift F12 to put me back editting the whole last line from the start. ~/.inputrc
is a handy tool.– jalanb
Dec 8 '15 at 3:11
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
The Shift F12 one requires vi mode.
– jalanb
Dec 8 '15 at 3:20
add a comment |
What's happening is that FreeBSD and Linux use different shells by default. FreeBSD defaults to tcsh, which had better interactive features than bash in the past (but bash has caught up) but markedly worse scripting features.
The most straightforward way to get the environment you're used to would be to switch your shell to tcsh on Linux. Provided that tcsh is installed system-wide (if it isn't, ask your system administrator to install it), run chsh -s tcsh
to change your default shell.
Alternatively, you can set up bash to have this command you're used to. By default, the Up and Down arrows navigate among all the commands in the history, not just the ones that start with the prefix you've typed. To change this to the behavior you're used to, put the following lines in bash's initialization file, which is .bashrc
in your home directory. Either run . ~/.bashrc
or start a new shell to re-read the initialization file.
bind '"eOA": history-search-backward'
bind '"e[A": history-search-backward'
bind '"eOB": history-search-forward'
bind '"e[B": history-search-forward'
The escape sequences are what your terminal sends to the shell when you press an arrow key. Up may be eOA
(escape, O
, A
) or e[A
depending on your terminal, and similarly for Down.
By default, bash offers different key bindings to search the command history. You can press Ctrl+R, then enter some characters to search for a command containing this substring anywhere on the line. Press Ctrl+S to go forward instead of backward. The search is incremental (i.e. as-you-type); Alt+P and Alt+N give you a non-incremental search.
Instead of bash and tcsh, you could switch to zsh, which has some neat features not found in other shells. Zsh has Ctrl+R and
Ctrl+S by default just like bash. To get Up and Down like you had in tcsh, put the following lines in ~/.zshrc
:
bindkey 'eOA' history-beginning-search-backward
bindkey 'e[A' history-beginning-search-backward
bindkey 'eOB' history-beginning-search-forward
bindkey 'e[B' history-beginning-search-forward
If you'd like to use the same shell everywhere, you can use bash or zsh on FreeBSD too, provided that the port is installed (again, ask your system administrator).
add a comment |
What's happening is that FreeBSD and Linux use different shells by default. FreeBSD defaults to tcsh, which had better interactive features than bash in the past (but bash has caught up) but markedly worse scripting features.
The most straightforward way to get the environment you're used to would be to switch your shell to tcsh on Linux. Provided that tcsh is installed system-wide (if it isn't, ask your system administrator to install it), run chsh -s tcsh
to change your default shell.
Alternatively, you can set up bash to have this command you're used to. By default, the Up and Down arrows navigate among all the commands in the history, not just the ones that start with the prefix you've typed. To change this to the behavior you're used to, put the following lines in bash's initialization file, which is .bashrc
in your home directory. Either run . ~/.bashrc
or start a new shell to re-read the initialization file.
bind '"eOA": history-search-backward'
bind '"e[A": history-search-backward'
bind '"eOB": history-search-forward'
bind '"e[B": history-search-forward'
The escape sequences are what your terminal sends to the shell when you press an arrow key. Up may be eOA
(escape, O
, A
) or e[A
depending on your terminal, and similarly for Down.
By default, bash offers different key bindings to search the command history. You can press Ctrl+R, then enter some characters to search for a command containing this substring anywhere on the line. Press Ctrl+S to go forward instead of backward. The search is incremental (i.e. as-you-type); Alt+P and Alt+N give you a non-incremental search.
Instead of bash and tcsh, you could switch to zsh, which has some neat features not found in other shells. Zsh has Ctrl+R and
Ctrl+S by default just like bash. To get Up and Down like you had in tcsh, put the following lines in ~/.zshrc
:
bindkey 'eOA' history-beginning-search-backward
bindkey 'e[A' history-beginning-search-backward
bindkey 'eOB' history-beginning-search-forward
bindkey 'e[B' history-beginning-search-forward
If you'd like to use the same shell everywhere, you can use bash or zsh on FreeBSD too, provided that the port is installed (again, ask your system administrator).
add a comment |
What's happening is that FreeBSD and Linux use different shells by default. FreeBSD defaults to tcsh, which had better interactive features than bash in the past (but bash has caught up) but markedly worse scripting features.
The most straightforward way to get the environment you're used to would be to switch your shell to tcsh on Linux. Provided that tcsh is installed system-wide (if it isn't, ask your system administrator to install it), run chsh -s tcsh
to change your default shell.
Alternatively, you can set up bash to have this command you're used to. By default, the Up and Down arrows navigate among all the commands in the history, not just the ones that start with the prefix you've typed. To change this to the behavior you're used to, put the following lines in bash's initialization file, which is .bashrc
in your home directory. Either run . ~/.bashrc
or start a new shell to re-read the initialization file.
bind '"eOA": history-search-backward'
bind '"e[A": history-search-backward'
bind '"eOB": history-search-forward'
bind '"e[B": history-search-forward'
The escape sequences are what your terminal sends to the shell when you press an arrow key. Up may be eOA
(escape, O
, A
) or e[A
depending on your terminal, and similarly for Down.
By default, bash offers different key bindings to search the command history. You can press Ctrl+R, then enter some characters to search for a command containing this substring anywhere on the line. Press Ctrl+S to go forward instead of backward. The search is incremental (i.e. as-you-type); Alt+P and Alt+N give you a non-incremental search.
Instead of bash and tcsh, you could switch to zsh, which has some neat features not found in other shells. Zsh has Ctrl+R and
Ctrl+S by default just like bash. To get Up and Down like you had in tcsh, put the following lines in ~/.zshrc
:
bindkey 'eOA' history-beginning-search-backward
bindkey 'e[A' history-beginning-search-backward
bindkey 'eOB' history-beginning-search-forward
bindkey 'e[B' history-beginning-search-forward
If you'd like to use the same shell everywhere, you can use bash or zsh on FreeBSD too, provided that the port is installed (again, ask your system administrator).
What's happening is that FreeBSD and Linux use different shells by default. FreeBSD defaults to tcsh, which had better interactive features than bash in the past (but bash has caught up) but markedly worse scripting features.
The most straightforward way to get the environment you're used to would be to switch your shell to tcsh on Linux. Provided that tcsh is installed system-wide (if it isn't, ask your system administrator to install it), run chsh -s tcsh
to change your default shell.
Alternatively, you can set up bash to have this command you're used to. By default, the Up and Down arrows navigate among all the commands in the history, not just the ones that start with the prefix you've typed. To change this to the behavior you're used to, put the following lines in bash's initialization file, which is .bashrc
in your home directory. Either run . ~/.bashrc
or start a new shell to re-read the initialization file.
bind '"eOA": history-search-backward'
bind '"e[A": history-search-backward'
bind '"eOB": history-search-forward'
bind '"e[B": history-search-forward'
The escape sequences are what your terminal sends to the shell when you press an arrow key. Up may be eOA
(escape, O
, A
) or e[A
depending on your terminal, and similarly for Down.
By default, bash offers different key bindings to search the command history. You can press Ctrl+R, then enter some characters to search for a command containing this substring anywhere on the line. Press Ctrl+S to go forward instead of backward. The search is incremental (i.e. as-you-type); Alt+P and Alt+N give you a non-incremental search.
Instead of bash and tcsh, you could switch to zsh, which has some neat features not found in other shells. Zsh has Ctrl+R and
Ctrl+S by default just like bash. To get Up and Down like you had in tcsh, put the following lines in ~/.zshrc
:
bindkey 'eOA' history-beginning-search-backward
bindkey 'e[A' history-beginning-search-backward
bindkey 'eOB' history-beginning-search-forward
bindkey 'e[B' history-beginning-search-forward
If you'd like to use the same shell everywhere, you can use bash or zsh on FreeBSD too, provided that the port is installed (again, ask your system administrator).
edited Apr 13 '17 at 12:37
Community♦
1
1
answered Oct 17 '13 at 23:39
Gilles
528k12810571583
528k12810571583
add a comment |
add a comment |
tcsh
is available for most Linux distributions. Try installing the tcsh
package, then running chsh -s /bin/tcsh
to make it your default shell.
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
add a comment |
tcsh
is available for most Linux distributions. Try installing the tcsh
package, then running chsh -s /bin/tcsh
to make it your default shell.
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
add a comment |
tcsh
is available for most Linux distributions. Try installing the tcsh
package, then running chsh -s /bin/tcsh
to make it your default shell.
tcsh
is available for most Linux distributions. Try installing the tcsh
package, then running chsh -s /bin/tcsh
to make it your default shell.
answered Oct 17 '13 at 17:47
cjm
20.3k57073
20.3k57073
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
add a comment |
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
1
1
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
Or you might consider switching to bash (I did).
– Keith Thompson
Oct 17 '13 at 19:47
add a comment |
Other answers tackle it, but if you want more, take a look at https://github.com/zsh-users/zsh-history-substring-search
Prezto (https://github.com/sorin-ionescu/prezto) is also full of zsh goodies.
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
add a comment |
Other answers tackle it, but if you want more, take a look at https://github.com/zsh-users/zsh-history-substring-search
Prezto (https://github.com/sorin-ionescu/prezto) is also full of zsh goodies.
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
add a comment |
Other answers tackle it, but if you want more, take a look at https://github.com/zsh-users/zsh-history-substring-search
Prezto (https://github.com/sorin-ionescu/prezto) is also full of zsh goodies.
Other answers tackle it, but if you want more, take a look at https://github.com/zsh-users/zsh-history-substring-search
Prezto (https://github.com/sorin-ionescu/prezto) is also full of zsh goodies.
answered Oct 21 '13 at 23:23
Fuad Saud
1493
1493
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
add a comment |
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
Thank you for your answer, by the way I still don't see what benefits have zsh over bash or tcsh ?
– Abdelilah Benaou
Oct 22 '13 at 14:46
1
1
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
Hum, you can do pretty much every basic stuff in all these shells. I use zsh because of pretty well maintained prezto bundle (probably the big game changer), right prompt (which is exclusive feature) and because it feels more polished than bash (consiguration and stuff).
– Fuad Saud
Oct 22 '13 at 20:22
add a comment |
If I start typing in my terminal, i.e. cd <press up arrow>
and then if i wanna go back to just cd
by pressing Down Arrow
it won't take me just cd
but rather the last search from history of cd
, is it possible to go back to just cd
instead of the cd last search
? cheers
add a comment |
If I start typing in my terminal, i.e. cd <press up arrow>
and then if i wanna go back to just cd
by pressing Down Arrow
it won't take me just cd
but rather the last search from history of cd
, is it possible to go back to just cd
instead of the cd last search
? cheers
add a comment |
If I start typing in my terminal, i.e. cd <press up arrow>
and then if i wanna go back to just cd
by pressing Down Arrow
it won't take me just cd
but rather the last search from history of cd
, is it possible to go back to just cd
instead of the cd last search
? cheers
If I start typing in my terminal, i.e. cd <press up arrow>
and then if i wanna go back to just cd
by pressing Down Arrow
it won't take me just cd
but rather the last search from history of cd
, is it possible to go back to just cd
instead of the cd last search
? cheers
answered 1 hour ago
J. Madani
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96510%2fsearch-for-a-previous-command-with-the-same-prefix-when-i-press-up-at-a-shell-pr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
7
That's a function of the shell, not the terminal. What shell are you using in FreeBSD? You may be able to get the same (or similar) shell for Linux.
– cjm
Oct 17 '13 at 17:20
I am using the tcsh shell.
– Abdelilah Benaou
Oct 17 '13 at 17:29
2
I'm using tcsh under OS X and didn't have this handy-looking behavior… After some searching, I found I could enable it by putting
bindkey -k (up|down) history-search-(back|for)ward
in my.tcshrc
as described here. Cool!– Garrett Albright
Oct 17 '13 at 20:27