What features are in zsh and missing from bash, or vice versa?
As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh.
As a bash user:
- What features will I miss?
- And what ones should I look out for?
bash zsh
add a comment |
As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh.
As a bash user:
- What features will I miss?
- And what ones should I look out for?
bash zsh
14
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
5
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30
add a comment |
As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh.
As a bash user:
- What features will I miss?
- And what ones should I look out for?
bash zsh
As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh.
As a bash user:
- What features will I miss?
- And what ones should I look out for?
bash zsh
bash zsh
edited Jul 31 '12 at 9:21
Kevdog777
2,107123359
2,107123359
asked Aug 21 '10 at 23:00
MachaMacha
1,63642434
1,63642434
14
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
5
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30
add a comment |
14
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
5
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30
14
14
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
5
5
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30
add a comment |
6 Answers
6
active
oldest
votes
There's already been quite a bit of activity on the topic on other Stack Exchange sites. My experience of switching from bash to zsh, as far as can remember (it was years ago²), is that I didn't miss a single thing. I gained a lot; here are what I think are the simple zsh-specific features that I use most:
The zsh feature I most miss when I occasionally use bash is autocd: in zsh, executing a directory means changing to it, provided you turn on the
autocd
option.⁴Another very useful feature is the fancy globbing. The
hieroglyphscharacters are a bit hard to remember but extremely convenient (as in, it's often faster to look them up than to write the equivalentfind
command). A few of the simpler examples:
foo*~*.bak
= all matches forfoo*
except those matching*.bak
foo*(.)
= only regular files matchingfoo*
foo*(/)
= only directories matchingfoo*
foo*(-@)
= only dangling symbolic links matchingfoo*
foo*(om[1,10])
= the 10 most recent files matchingfoo*
foo*(Lm+1)
= only files of size > 1MB
dir/**/foo*
=foo*
in the directorydir
and all its subdirectories, recursively⁴For fancy renames, the
zmv
builtin can be handy. For example, to copy everyfile
tofile.bak
:zmv -C '(*)(#q.)' '$1.bak'
Both bash and zsh have a decent completion system that needs to be turned on explicitly (
. /etc/bash_completion
orautoload -U compinit; compinit
). Zsh's is much more configurable and generally fancier.
If you run zsh without a .zshrc
, it starts an interactive menu that lets you choose configuration options. (Some distributions may disable this; in that case, run autoload zsh-newuser-install; zsh-newuser-install
.) I recommend enabling the recommended history options, turning on (“new-style”) completion, and turning on the “common shell options” except beep
. Later, configure more options as you discover them.
²At the time programmable completion was zsh's killer feature, but bash acquired it soon after.
⁴Features that bash acquired only in version 4 (so are still not available on many systems) are in smaller type.
5
Bash 4.0 now supports theautocd
feature you discuss above. Enable the feature using the commandshopt -s autocd
. Then the feature works as you've described.
– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-inwhere
command, not to be confused with thewhich
command.
– Sildoreth
Apr 17 '15 at 18:14
add a comment |
Also the default tab completion is better than bash... for example...
~/.e.d
TAB will expand to ~/.emacs.d/
in zsh, bash will just beep.
it didn't. what non-defaultsetopt
option do you use for that (if any) ?
– w17t
May 22 '18 at 18:44
I realized that I have_-.
set as a wildcard.zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660
– ocodo
4 hours ago
add a comment |
zsh
lets you edit a multi-line command (see zsh line editor), bash doesn't. If you try the same trick (Ctrl-p
), bash fetches the last command.
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
add a comment |
Bash has the feature of being able to open ports using
/dev/tcp/host/port
or
/dev/udp/host/port
However, it is disabled in Debian as it is seen as a hindrance (if the path actually exists) and outside the scope of what a shell should do. More information [debian mailing list]
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
add a comment |
Which - enhanced in zsh
The which
command in bash only reveals the location of a command.
In Zsh which
will reveal the definition of an alias
, the source for a function
and the location of a command.
Let's say we had a shell alias:
alias gg='git log'
In Bash if we asked: which gg
the result would be void
In Zsh: which gg
will give us...
gg: aliased to git log
Let's say we had a shell function:
hello() {
echo "Hello World"
}
In Bash if we asked: which hello
the result would be void.
In Zsh: which hello
will give us...
hello() {
echo "Hello World"
}
Bash provides the same functionality via thetype
(builtin) command. And just to nitpick:which
is an external command, not a bash builtin.
– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
add a comment |
zsh - a complete shell
there are many, reading through zshcontrib(1)
one can detect two versions of autoload
-able tetris
games (the other with ncurses
) in zsh
in competition with emacs
, for completeness (as described).
=
I'd like to mention the =
keyword, which can cause irritation with curl
(URL's usually have ?var=val
in them; but it is unsetopt
-able, I think):
q file =less
(gentoo
) resolves toq file $(which less)
=
expands to the full path of the command in question.
other goodies
other things, out of the mind, are the right prompt RPS1=%d
(to display $PWD
in style), Alt + H (run-help
ie. man
), Alt + ? (which-command
), vared
, and zed
(autoload
function), Emacs' minibuffer-like Alt + X to execute widgets without binding them, global and suffix aliases, extended history tracking command completion duration, -m
and -regex
matchers, shell emulation (eg. csh
, ksh
with emulate
) and autoload
run-help
with file snippets for the built-ins.
lamentations
I think most, if not all, of the features were implemented a long time ago, and reading through changelogs, there is no major changes and new feature additions, which is very sad (nothing to explore and discover anymore).
bash
seem to be more distributed in readline
(as opposed to zle
) and gnu history
in the linux spirit; e.g readline functions and keybindings can be applied globally (as kept in ~/.inputrc
and /etc/inputrc
) if not overriden by bash-specific bind
.
conclusion
I personally think emacs
(esp. from the prospect of (the current?) emacs-nox
flavor) being the inspiration for the exceptional software like zsh
and tmux
did a very good job in being an example in such an implementation; for the people appreciating its worth (to the level of not needing/depending on X
server). Unix shell is powerful enough, and its continuity and consistency is sufficient for a proper workflow and productivity (in overall computing).
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%2f983%2fwhat-features-are-in-zsh-and-missing-from-bash-or-vice-versa%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
There's already been quite a bit of activity on the topic on other Stack Exchange sites. My experience of switching from bash to zsh, as far as can remember (it was years ago²), is that I didn't miss a single thing. I gained a lot; here are what I think are the simple zsh-specific features that I use most:
The zsh feature I most miss when I occasionally use bash is autocd: in zsh, executing a directory means changing to it, provided you turn on the
autocd
option.⁴Another very useful feature is the fancy globbing. The
hieroglyphscharacters are a bit hard to remember but extremely convenient (as in, it's often faster to look them up than to write the equivalentfind
command). A few of the simpler examples:
foo*~*.bak
= all matches forfoo*
except those matching*.bak
foo*(.)
= only regular files matchingfoo*
foo*(/)
= only directories matchingfoo*
foo*(-@)
= only dangling symbolic links matchingfoo*
foo*(om[1,10])
= the 10 most recent files matchingfoo*
foo*(Lm+1)
= only files of size > 1MB
dir/**/foo*
=foo*
in the directorydir
and all its subdirectories, recursively⁴For fancy renames, the
zmv
builtin can be handy. For example, to copy everyfile
tofile.bak
:zmv -C '(*)(#q.)' '$1.bak'
Both bash and zsh have a decent completion system that needs to be turned on explicitly (
. /etc/bash_completion
orautoload -U compinit; compinit
). Zsh's is much more configurable and generally fancier.
If you run zsh without a .zshrc
, it starts an interactive menu that lets you choose configuration options. (Some distributions may disable this; in that case, run autoload zsh-newuser-install; zsh-newuser-install
.) I recommend enabling the recommended history options, turning on (“new-style”) completion, and turning on the “common shell options” except beep
. Later, configure more options as you discover them.
²At the time programmable completion was zsh's killer feature, but bash acquired it soon after.
⁴Features that bash acquired only in version 4 (so are still not available on many systems) are in smaller type.
5
Bash 4.0 now supports theautocd
feature you discuss above. Enable the feature using the commandshopt -s autocd
. Then the feature works as you've described.
– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-inwhere
command, not to be confused with thewhich
command.
– Sildoreth
Apr 17 '15 at 18:14
add a comment |
There's already been quite a bit of activity on the topic on other Stack Exchange sites. My experience of switching from bash to zsh, as far as can remember (it was years ago²), is that I didn't miss a single thing. I gained a lot; here are what I think are the simple zsh-specific features that I use most:
The zsh feature I most miss when I occasionally use bash is autocd: in zsh, executing a directory means changing to it, provided you turn on the
autocd
option.⁴Another very useful feature is the fancy globbing. The
hieroglyphscharacters are a bit hard to remember but extremely convenient (as in, it's often faster to look them up than to write the equivalentfind
command). A few of the simpler examples:
foo*~*.bak
= all matches forfoo*
except those matching*.bak
foo*(.)
= only regular files matchingfoo*
foo*(/)
= only directories matchingfoo*
foo*(-@)
= only dangling symbolic links matchingfoo*
foo*(om[1,10])
= the 10 most recent files matchingfoo*
foo*(Lm+1)
= only files of size > 1MB
dir/**/foo*
=foo*
in the directorydir
and all its subdirectories, recursively⁴For fancy renames, the
zmv
builtin can be handy. For example, to copy everyfile
tofile.bak
:zmv -C '(*)(#q.)' '$1.bak'
Both bash and zsh have a decent completion system that needs to be turned on explicitly (
. /etc/bash_completion
orautoload -U compinit; compinit
). Zsh's is much more configurable and generally fancier.
If you run zsh without a .zshrc
, it starts an interactive menu that lets you choose configuration options. (Some distributions may disable this; in that case, run autoload zsh-newuser-install; zsh-newuser-install
.) I recommend enabling the recommended history options, turning on (“new-style”) completion, and turning on the “common shell options” except beep
. Later, configure more options as you discover them.
²At the time programmable completion was zsh's killer feature, but bash acquired it soon after.
⁴Features that bash acquired only in version 4 (so are still not available on many systems) are in smaller type.
5
Bash 4.0 now supports theautocd
feature you discuss above. Enable the feature using the commandshopt -s autocd
. Then the feature works as you've described.
– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-inwhere
command, not to be confused with thewhich
command.
– Sildoreth
Apr 17 '15 at 18:14
add a comment |
There's already been quite a bit of activity on the topic on other Stack Exchange sites. My experience of switching from bash to zsh, as far as can remember (it was years ago²), is that I didn't miss a single thing. I gained a lot; here are what I think are the simple zsh-specific features that I use most:
The zsh feature I most miss when I occasionally use bash is autocd: in zsh, executing a directory means changing to it, provided you turn on the
autocd
option.⁴Another very useful feature is the fancy globbing. The
hieroglyphscharacters are a bit hard to remember but extremely convenient (as in, it's often faster to look them up than to write the equivalentfind
command). A few of the simpler examples:
foo*~*.bak
= all matches forfoo*
except those matching*.bak
foo*(.)
= only regular files matchingfoo*
foo*(/)
= only directories matchingfoo*
foo*(-@)
= only dangling symbolic links matchingfoo*
foo*(om[1,10])
= the 10 most recent files matchingfoo*
foo*(Lm+1)
= only files of size > 1MB
dir/**/foo*
=foo*
in the directorydir
and all its subdirectories, recursively⁴For fancy renames, the
zmv
builtin can be handy. For example, to copy everyfile
tofile.bak
:zmv -C '(*)(#q.)' '$1.bak'
Both bash and zsh have a decent completion system that needs to be turned on explicitly (
. /etc/bash_completion
orautoload -U compinit; compinit
). Zsh's is much more configurable and generally fancier.
If you run zsh without a .zshrc
, it starts an interactive menu that lets you choose configuration options. (Some distributions may disable this; in that case, run autoload zsh-newuser-install; zsh-newuser-install
.) I recommend enabling the recommended history options, turning on (“new-style”) completion, and turning on the “common shell options” except beep
. Later, configure more options as you discover them.
²At the time programmable completion was zsh's killer feature, but bash acquired it soon after.
⁴Features that bash acquired only in version 4 (so are still not available on many systems) are in smaller type.
There's already been quite a bit of activity on the topic on other Stack Exchange sites. My experience of switching from bash to zsh, as far as can remember (it was years ago²), is that I didn't miss a single thing. I gained a lot; here are what I think are the simple zsh-specific features that I use most:
The zsh feature I most miss when I occasionally use bash is autocd: in zsh, executing a directory means changing to it, provided you turn on the
autocd
option.⁴Another very useful feature is the fancy globbing. The
hieroglyphscharacters are a bit hard to remember but extremely convenient (as in, it's often faster to look them up than to write the equivalentfind
command). A few of the simpler examples:
foo*~*.bak
= all matches forfoo*
except those matching*.bak
foo*(.)
= only regular files matchingfoo*
foo*(/)
= only directories matchingfoo*
foo*(-@)
= only dangling symbolic links matchingfoo*
foo*(om[1,10])
= the 10 most recent files matchingfoo*
foo*(Lm+1)
= only files of size > 1MB
dir/**/foo*
=foo*
in the directorydir
and all its subdirectories, recursively⁴For fancy renames, the
zmv
builtin can be handy. For example, to copy everyfile
tofile.bak
:zmv -C '(*)(#q.)' '$1.bak'
Both bash and zsh have a decent completion system that needs to be turned on explicitly (
. /etc/bash_completion
orautoload -U compinit; compinit
). Zsh's is much more configurable and generally fancier.
If you run zsh without a .zshrc
, it starts an interactive menu that lets you choose configuration options. (Some distributions may disable this; in that case, run autoload zsh-newuser-install; zsh-newuser-install
.) I recommend enabling the recommended history options, turning on (“new-style”) completion, and turning on the “common shell options” except beep
. Later, configure more options as you discover them.
²At the time programmable completion was zsh's killer feature, but bash acquired it soon after.
⁴Features that bash acquired only in version 4 (so are still not available on many systems) are in smaller type.
edited Apr 17 '15 at 21:04
answered Aug 22 '10 at 1:02
GillesGilles
540k12810941609
540k12810941609
5
Bash 4.0 now supports theautocd
feature you discuss above. Enable the feature using the commandshopt -s autocd
. Then the feature works as you've described.
– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-inwhere
command, not to be confused with thewhich
command.
– Sildoreth
Apr 17 '15 at 18:14
add a comment |
5
Bash 4.0 now supports theautocd
feature you discuss above. Enable the feature using the commandshopt -s autocd
. Then the feature works as you've described.
– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-inwhere
command, not to be confused with thewhich
command.
– Sildoreth
Apr 17 '15 at 18:14
5
5
Bash 4.0 now supports the
autocd
feature you discuss above. Enable the feature using the command shopt -s autocd
. Then the feature works as you've described.– Philluminati
Dec 17 '12 at 1:28
Bash 4.0 now supports the
autocd
feature you discuss above. Enable the feature using the command shopt -s autocd
. Then the feature works as you've described.– Philluminati
Dec 17 '12 at 1:28
zsh also has the built-in
where
command, not to be confused with the which
command.– Sildoreth
Apr 17 '15 at 18:14
zsh also has the built-in
where
command, not to be confused with the which
command.– Sildoreth
Apr 17 '15 at 18:14
add a comment |
Also the default tab completion is better than bash... for example...
~/.e.d
TAB will expand to ~/.emacs.d/
in zsh, bash will just beep.
it didn't. what non-defaultsetopt
option do you use for that (if any) ?
– w17t
May 22 '18 at 18:44
I realized that I have_-.
set as a wildcard.zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660
– ocodo
4 hours ago
add a comment |
Also the default tab completion is better than bash... for example...
~/.e.d
TAB will expand to ~/.emacs.d/
in zsh, bash will just beep.
it didn't. what non-defaultsetopt
option do you use for that (if any) ?
– w17t
May 22 '18 at 18:44
I realized that I have_-.
set as a wildcard.zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660
– ocodo
4 hours ago
add a comment |
Also the default tab completion is better than bash... for example...
~/.e.d
TAB will expand to ~/.emacs.d/
in zsh, bash will just beep.
Also the default tab completion is better than bash... for example...
~/.e.d
TAB will expand to ~/.emacs.d/
in zsh, bash will just beep.
answered Sep 4 '10 at 1:18
ocodoocodo
33618
33618
it didn't. what non-defaultsetopt
option do you use for that (if any) ?
– w17t
May 22 '18 at 18:44
I realized that I have_-.
set as a wildcard.zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660
– ocodo
4 hours ago
add a comment |
it didn't. what non-defaultsetopt
option do you use for that (if any) ?
– w17t
May 22 '18 at 18:44
I realized that I have_-.
set as a wildcard.zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660
– ocodo
4 hours ago
it didn't. what non-default
setopt
option do you use for that (if any) ?– w17t
May 22 '18 at 18:44
it didn't. what non-default
setopt
option do you use for that (if any) ?– w17t
May 22 '18 at 18:44
I realized that I have
_-.
set as a wildcard. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660– ocodo
4 hours ago
I realized that I have
_-.
set as a wildcard. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
. See stackoverflow.com/q/7906078/311660– ocodo
4 hours ago
add a comment |
zsh
lets you edit a multi-line command (see zsh line editor), bash doesn't. If you try the same trick (Ctrl-p
), bash fetches the last command.
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
add a comment |
zsh
lets you edit a multi-line command (see zsh line editor), bash doesn't. If you try the same trick (Ctrl-p
), bash fetches the last command.
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
add a comment |
zsh
lets you edit a multi-line command (see zsh line editor), bash doesn't. If you try the same trick (Ctrl-p
), bash fetches the last command.
zsh
lets you edit a multi-line command (see zsh line editor), bash doesn't. If you try the same trick (Ctrl-p
), bash fetches the last command.
answered Aug 22 '10 at 0:04
Pedro SilvaPedro Silva
42436
42436
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
add a comment |
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
2
2
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
Bash does this, at least as of version 4.2.37; it replaces newlines by semicolons and gives you a single line to edit.
– Keith Thompson
Jan 24 '14 at 23:57
1
1
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
Still not as nice. (:
– SilverWolf
Jan 23 '18 at 19:56
add a comment |
Bash has the feature of being able to open ports using
/dev/tcp/host/port
or
/dev/udp/host/port
However, it is disabled in Debian as it is seen as a hindrance (if the path actually exists) and outside the scope of what a shell should do. More information [debian mailing list]
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
add a comment |
Bash has the feature of being able to open ports using
/dev/tcp/host/port
or
/dev/udp/host/port
However, it is disabled in Debian as it is seen as a hindrance (if the path actually exists) and outside the scope of what a shell should do. More information [debian mailing list]
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
add a comment |
Bash has the feature of being able to open ports using
/dev/tcp/host/port
or
/dev/udp/host/port
However, it is disabled in Debian as it is seen as a hindrance (if the path actually exists) and outside the scope of what a shell should do. More information [debian mailing list]
Bash has the feature of being able to open ports using
/dev/tcp/host/port
or
/dev/udp/host/port
However, it is disabled in Debian as it is seen as a hindrance (if the path actually exists) and outside the scope of what a shell should do. More information [debian mailing list]
answered Nov 7 '11 at 5:18
PortablejimPortablejim
31059
31059
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
add a comment |
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
5
5
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
zsh has the ztcp builtin though which has more capabilities than bash's /dev/tcp, doesn't have /dev/udp. I would rather use socat though.
– Stéphane Chazelas
Sep 10 '12 at 13:43
add a comment |
Which - enhanced in zsh
The which
command in bash only reveals the location of a command.
In Zsh which
will reveal the definition of an alias
, the source for a function
and the location of a command.
Let's say we had a shell alias:
alias gg='git log'
In Bash if we asked: which gg
the result would be void
In Zsh: which gg
will give us...
gg: aliased to git log
Let's say we had a shell function:
hello() {
echo "Hello World"
}
In Bash if we asked: which hello
the result would be void.
In Zsh: which hello
will give us...
hello() {
echo "Hello World"
}
Bash provides the same functionality via thetype
(builtin) command. And just to nitpick:which
is an external command, not a bash builtin.
– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
add a comment |
Which - enhanced in zsh
The which
command in bash only reveals the location of a command.
In Zsh which
will reveal the definition of an alias
, the source for a function
and the location of a command.
Let's say we had a shell alias:
alias gg='git log'
In Bash if we asked: which gg
the result would be void
In Zsh: which gg
will give us...
gg: aliased to git log
Let's say we had a shell function:
hello() {
echo "Hello World"
}
In Bash if we asked: which hello
the result would be void.
In Zsh: which hello
will give us...
hello() {
echo "Hello World"
}
Bash provides the same functionality via thetype
(builtin) command. And just to nitpick:which
is an external command, not a bash builtin.
– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
add a comment |
Which - enhanced in zsh
The which
command in bash only reveals the location of a command.
In Zsh which
will reveal the definition of an alias
, the source for a function
and the location of a command.
Let's say we had a shell alias:
alias gg='git log'
In Bash if we asked: which gg
the result would be void
In Zsh: which gg
will give us...
gg: aliased to git log
Let's say we had a shell function:
hello() {
echo "Hello World"
}
In Bash if we asked: which hello
the result would be void.
In Zsh: which hello
will give us...
hello() {
echo "Hello World"
}
Which - enhanced in zsh
The which
command in bash only reveals the location of a command.
In Zsh which
will reveal the definition of an alias
, the source for a function
and the location of a command.
Let's say we had a shell alias:
alias gg='git log'
In Bash if we asked: which gg
the result would be void
In Zsh: which gg
will give us...
gg: aliased to git log
Let's say we had a shell function:
hello() {
echo "Hello World"
}
In Bash if we asked: which hello
the result would be void.
In Zsh: which hello
will give us...
hello() {
echo "Hello World"
}
answered Apr 22 '18 at 2:31
ocodoocodo
33618
33618
Bash provides the same functionality via thetype
(builtin) command. And just to nitpick:which
is an external command, not a bash builtin.
– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
add a comment |
Bash provides the same functionality via thetype
(builtin) command. And just to nitpick:which
is an external command, not a bash builtin.
– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
Bash provides the same functionality via the
type
(builtin) command. And just to nitpick: which
is an external command, not a bash builtin.– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Bash provides the same functionality via the
type
(builtin) command. And just to nitpick: which
is an external command, not a bash builtin.– Torkel Bjørnson-Langen
Dec 22 '18 at 19:51
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
Relevant canonical question: Why not use “which”? What to use then?
– Anthony Geoghegan
12 hours ago
add a comment |
zsh - a complete shell
there are many, reading through zshcontrib(1)
one can detect two versions of autoload
-able tetris
games (the other with ncurses
) in zsh
in competition with emacs
, for completeness (as described).
=
I'd like to mention the =
keyword, which can cause irritation with curl
(URL's usually have ?var=val
in them; but it is unsetopt
-able, I think):
q file =less
(gentoo
) resolves toq file $(which less)
=
expands to the full path of the command in question.
other goodies
other things, out of the mind, are the right prompt RPS1=%d
(to display $PWD
in style), Alt + H (run-help
ie. man
), Alt + ? (which-command
), vared
, and zed
(autoload
function), Emacs' minibuffer-like Alt + X to execute widgets without binding them, global and suffix aliases, extended history tracking command completion duration, -m
and -regex
matchers, shell emulation (eg. csh
, ksh
with emulate
) and autoload
run-help
with file snippets for the built-ins.
lamentations
I think most, if not all, of the features were implemented a long time ago, and reading through changelogs, there is no major changes and new feature additions, which is very sad (nothing to explore and discover anymore).
bash
seem to be more distributed in readline
(as opposed to zle
) and gnu history
in the linux spirit; e.g readline functions and keybindings can be applied globally (as kept in ~/.inputrc
and /etc/inputrc
) if not overriden by bash-specific bind
.
conclusion
I personally think emacs
(esp. from the prospect of (the current?) emacs-nox
flavor) being the inspiration for the exceptional software like zsh
and tmux
did a very good job in being an example in such an implementation; for the people appreciating its worth (to the level of not needing/depending on X
server). Unix shell is powerful enough, and its continuity and consistency is sufficient for a proper workflow and productivity (in overall computing).
add a comment |
zsh - a complete shell
there are many, reading through zshcontrib(1)
one can detect two versions of autoload
-able tetris
games (the other with ncurses
) in zsh
in competition with emacs
, for completeness (as described).
=
I'd like to mention the =
keyword, which can cause irritation with curl
(URL's usually have ?var=val
in them; but it is unsetopt
-able, I think):
q file =less
(gentoo
) resolves toq file $(which less)
=
expands to the full path of the command in question.
other goodies
other things, out of the mind, are the right prompt RPS1=%d
(to display $PWD
in style), Alt + H (run-help
ie. man
), Alt + ? (which-command
), vared
, and zed
(autoload
function), Emacs' minibuffer-like Alt + X to execute widgets without binding them, global and suffix aliases, extended history tracking command completion duration, -m
and -regex
matchers, shell emulation (eg. csh
, ksh
with emulate
) and autoload
run-help
with file snippets for the built-ins.
lamentations
I think most, if not all, of the features were implemented a long time ago, and reading through changelogs, there is no major changes and new feature additions, which is very sad (nothing to explore and discover anymore).
bash
seem to be more distributed in readline
(as opposed to zle
) and gnu history
in the linux spirit; e.g readline functions and keybindings can be applied globally (as kept in ~/.inputrc
and /etc/inputrc
) if not overriden by bash-specific bind
.
conclusion
I personally think emacs
(esp. from the prospect of (the current?) emacs-nox
flavor) being the inspiration for the exceptional software like zsh
and tmux
did a very good job in being an example in such an implementation; for the people appreciating its worth (to the level of not needing/depending on X
server). Unix shell is powerful enough, and its continuity and consistency is sufficient for a proper workflow and productivity (in overall computing).
add a comment |
zsh - a complete shell
there are many, reading through zshcontrib(1)
one can detect two versions of autoload
-able tetris
games (the other with ncurses
) in zsh
in competition with emacs
, for completeness (as described).
=
I'd like to mention the =
keyword, which can cause irritation with curl
(URL's usually have ?var=val
in them; but it is unsetopt
-able, I think):
q file =less
(gentoo
) resolves toq file $(which less)
=
expands to the full path of the command in question.
other goodies
other things, out of the mind, are the right prompt RPS1=%d
(to display $PWD
in style), Alt + H (run-help
ie. man
), Alt + ? (which-command
), vared
, and zed
(autoload
function), Emacs' minibuffer-like Alt + X to execute widgets without binding them, global and suffix aliases, extended history tracking command completion duration, -m
and -regex
matchers, shell emulation (eg. csh
, ksh
with emulate
) and autoload
run-help
with file snippets for the built-ins.
lamentations
I think most, if not all, of the features were implemented a long time ago, and reading through changelogs, there is no major changes and new feature additions, which is very sad (nothing to explore and discover anymore).
bash
seem to be more distributed in readline
(as opposed to zle
) and gnu history
in the linux spirit; e.g readline functions and keybindings can be applied globally (as kept in ~/.inputrc
and /etc/inputrc
) if not overriden by bash-specific bind
.
conclusion
I personally think emacs
(esp. from the prospect of (the current?) emacs-nox
flavor) being the inspiration for the exceptional software like zsh
and tmux
did a very good job in being an example in such an implementation; for the people appreciating its worth (to the level of not needing/depending on X
server). Unix shell is powerful enough, and its continuity and consistency is sufficient for a proper workflow and productivity (in overall computing).
zsh - a complete shell
there are many, reading through zshcontrib(1)
one can detect two versions of autoload
-able tetris
games (the other with ncurses
) in zsh
in competition with emacs
, for completeness (as described).
=
I'd like to mention the =
keyword, which can cause irritation with curl
(URL's usually have ?var=val
in them; but it is unsetopt
-able, I think):
q file =less
(gentoo
) resolves toq file $(which less)
=
expands to the full path of the command in question.
other goodies
other things, out of the mind, are the right prompt RPS1=%d
(to display $PWD
in style), Alt + H (run-help
ie. man
), Alt + ? (which-command
), vared
, and zed
(autoload
function), Emacs' minibuffer-like Alt + X to execute widgets without binding them, global and suffix aliases, extended history tracking command completion duration, -m
and -regex
matchers, shell emulation (eg. csh
, ksh
with emulate
) and autoload
run-help
with file snippets for the built-ins.
lamentations
I think most, if not all, of the features were implemented a long time ago, and reading through changelogs, there is no major changes and new feature additions, which is very sad (nothing to explore and discover anymore).
bash
seem to be more distributed in readline
(as opposed to zle
) and gnu history
in the linux spirit; e.g readline functions and keybindings can be applied globally (as kept in ~/.inputrc
and /etc/inputrc
) if not overriden by bash-specific bind
.
conclusion
I personally think emacs
(esp. from the prospect of (the current?) emacs-nox
flavor) being the inspiration for the exceptional software like zsh
and tmux
did a very good job in being an example in such an implementation; for the people appreciating its worth (to the level of not needing/depending on X
server). Unix shell is powerful enough, and its continuity and consistency is sufficient for a proper workflow and productivity (in overall computing).
edited 55 mins ago
ocodo
33618
33618
answered May 22 '18 at 19:09
w17tw17t
695724
695724
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.
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%2f983%2fwhat-features-are-in-zsh-and-missing-from-bash-or-vice-versa%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
14
Similar questions on other SE sites: Worth switching to zsh for casual use? What's in your .zshrc? What zsh features do you use? Unique Features of bash compared to zsh Is there any reason to use bash over zsh? Moving from bash to zsh
– Gilles
Aug 22 '10 at 0:00
5
@Gilles someday it might be nice to have all those moved here... and merged
– xenoterracide
Aug 22 '10 at 8:22
Also askubuntu.com/questions/1577/moving-from-bash-to-zsh
– naught101
Sep 2 '14 at 1:30