Questions tagged [zsh]

Zsh is a shell designed for interactive use, although it is also a powerful scripting language.

Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

1453 questions
298
votes
5 answers

Zsh not hitting ~/.profile

I've just installed zsh on my Ubuntu system. It seems zsh isn't executing ~/.profile on init. To my best understanding, this should be an automatic behavior. What am I missing?
shmichael
  • 3,343
244
votes
3 answers

Why are tar.xz files 15x smaller when using Python's tar library compared to macOS tar?

Context I'm compressing ~1.3 GB folders each filled with 1440 JSON files and find that there's a 15-fold difference between using the tar command and Python's built-in tarfile library on macOS or Raspbian 10 (Buster) Minimal working example This…
234
votes
13 answers

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh). How can I force it to use zsh?
re5et
  • 2,453
188
votes
5 answers

Where is the .zshrc file on Mac?

I’m using iTerm and wanted to customize the look of my terminal window using Oh My ZSH!. And according to the documentation I need to change the ~/.zshrc file and add a ZSH_THEME value: Once you find a theme that you want to use, you will need to…
Leon Gaban
  • 2,855
166
votes
10 answers

How can I do a recursive find and replace from the command line?

Using a shell like bash or zshell, how can I do a recursive 'find and replace'? In other words, I want to replace every occurrence of 'foo' with 'bar' in all files in this directory and its subdirectories.
Nathan Long
  • 27,435
139
votes
5 answers

ZSH - output whole history?

I recently switched from bash to zsh. In bash, one way (besides recursive search) that I used to find previously-run commands was history | grep whatever, where whatever is the bit of command I remember. In zsh, this isn't working. history returns…
Nathan Long
  • 27,435
129
votes
2 answers

How to fix and recover a "corrupt history file" in zsh?

After a reboot, I started seeing a message when loading the shell: zsh: corrupt history file /home/myusername/.zsh_history How can I recover from this situation and potentially recover some of the history?
gak
  • 9,047
113
votes
6 answers

scp with zsh : no matches found

when I try scp over zsh, I get scp hostA:Descargas/debian-6.0.4-* user@192.168.1.154:Escritorio/Software/ zsh: no matches found: hostA:Descargas/debian-6.0.4-* the same command work in bash
juanpablo
  • 7,424
112
votes
3 answers

What exactly is <() in bash (and =() in zsh)?

I'm pretty comfortable with bash, but recently I ended up in a substitution I didn't know. What exactly is <(command) in bash? How does it compare to the =(command) in zsh? I understand that this has something to do with default file descriptors. In…
102
votes
16 answers

zsh starts incredibly slowly

ZSH takes about a second and a half from creating a new terminal window to being ready. I'm pretty sure that the culprit is compinit. I haven't been able to find good documentation on compinit, but it looks like it should be caching all of the…
Eli
  • 1,123
  • 2
  • 8
  • 5
85
votes
2 answers

How to prevent a command in the zshell from being saved into history?

In Bash I know putting a space before a command prevents it from being kept in the history, what is the equivalent for the zshell?
bneil
  • 2,137
82
votes
3 answers

ZSH: Read command fails within bash function "read:1: -p: no coprocess"

Edit: Seems to work within bash. It appears the problem is related to zsh. If there is a better site to post this issue on let me know. I am writing a simple script that creates a series of directories. I want the user to give a confirmation…
Nick Tomlin
  • 1,157
78
votes
3 answers

Zsh says "no matches found" when trying to download video with youtube-dl

I downloaded youtube-dl using pip on CrunchBang (a Debian Wheezy distro). When I run youtube-dl {video URL} I get zsh: no matches found: {video URL} I guess it has something to do with zsh, because I found some users on Arch forums complaining…
Lynob
  • 5,550
  • 23
  • 66
  • 96
67
votes
3 answers

iTerm/zsh not reading .bashrc OR .bash_profile

In ~/.bash_profile I have : if [ -f ~/.bashrc ]; then source ~/.bashrc fi In ~/.bashrc I have some aliases When I load a new iTerm window, my aliases do not work. If I source ~/.bashrc they work. If I source ~.bash_profile they work. Isn't at…
Damon
  • 2,789
  • 6
  • 28
  • 29
67
votes
9 answers

Change iTerm2 window and tab titles in zsh

I want to label the window tabs of terminal sessions. I'm using the zshell in iterm2 on OSX. Is it possible to change the label of a window tab dynamically in the terminal?
bneil
  • 2,137
1
2 3
96 97