Questions tagged [zsh]

Zsh or Z Shell is the default Unix shell used by Terminal in macOS since 10.15

Filter by
Sorted by
Tagged with
5 votes
2 answers
4k views

How can I change my shell language localization on the macOS command line?

I have a Mountain Lion macbook and it's default locale is english, it's keyboard is english (US) as well. I need to change the language that the terminal replies to Swedish. For example, Instead of ...
1 vote
2 answers
466 views

ZSH shell setting up paths

I'm trying to install and set up the following program on my Mac Big Sur. https://bondxray.org/software/aline.html I unpacked it on /Applications. However, my knowledge is quite limited and I can't ...
15 votes
4 answers
10k views

How do I switch tabs when using iTerm2 with Z shell

How do I switch tabs when using Z shell on iTerm2? I have already tried all the possible key combinations. Here is an image of my current setup: OS: macOS Mojave 10.14.4 (18E226) iTerm2: Build 3.3....
3 votes
2 answers
355 views

Why I do I see these lines in Terminal and how can I remove them?

Last login: Fri Mar 26 00:39:29 on console export HOMEBREW_PREFIX="/opt/homebrew"; export HOMEBREW_CELLAR="/opt/homebrew/Cellar"; export HOMEBREW_REPOSITORY="/opt/homebrew&...
1 vote
2 answers
36 views

list of characters that have to be escaped in passwords for "mount -t smbfs //username:password@..."

I am trying to mount a share with the macOS CLI using zsh as my shell. mount -t smbfs //user:password@host/share /share Mounting the share without specifying the password works. But then I have to ...
1 vote
1 answer
86 views

how can I copy paths in the $PATH environment from bash to zsh?

How can I copy all the the command paths from the bash environment $PATH variable to the zsh environment? I'm on macOS 11.6.1 (and about to install 11.6.6). Many of the commands I used in bash don't ...
0 votes
0 answers
17 views

opt out telemetry .NET

I got this message when first launching .NET "The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can ...
3 votes
2 answers
9k views

How can I set oh my zsh to be my default shell?

I'm using Hyper as my terminal application and I just installed Oh My Zsh via curl. I'd like it to be my default shell environment but for some reason whenever I restart Hyper I have to run the zsh ...
0 votes
2 answers
122 views

Most homebrew installed commands outputs "zsh: killed"

When I type brew, I get the output: zsh: killed brew Writing out the whole path still gives the same output, so it doesn't seem like a path problem. Furthermore, running /bin/bash gives the ...
0 votes
2 answers
46 views

python shell becomes unusable after suspend (ctrl-Z) and 'fg' command

When I suspend python with ctrl+Z and try to get it back with fg, I cannot use the python interactive command prompt anymore. Pressing the Enter key produces ^M on the screen, Esc produces ^[ and even ...
2 votes
2 answers
7k views

zsh can't see and doesn't load the ~/.zshrc startup file

After upgrading to Catalina and encountering the zsh upgrade reminder when launching Terminal, I've decided to switch to zsh. The default interactive shell is now zsh. To update your account to use ...
0 votes
0 answers
16 views

Automator save POSIX path from folder action as a variable in shell script

I want to save POSIX path of the file(which triggers the folder action while being copied to that folder) as a variable in the automator. I have attempted but failed. Can anyone please help ?
8 votes
1 answer
6k views

Is it possible .zshrc is not available in ~?

I can’t find the file .zshrc in my user home folder, is it possible it doesn’t exist and I have to create it as a new file? I use zsh as default shell on macOS 11.2.3
1 vote
1 answer
24 views

need to turn separate zsh script into a function inside a master script

I'm trying to turn 6 scripts into one script, so that instead of the enduser needing to download 6 scripts, do chmod +x mess to them etc, and then run the master script, they'd only need one script ...
1 vote
2 answers
745 views

Every time I start my terminal, I get ".zshrc:source:18: no such file or directory: /sourceme.sh"?

I've been trying to download some softwares. I've deleted those files, but now, I think my zsh file keeps wanting to source a file that's no longer there. Because of that, I get the following message ...
0 votes
1 answer
52 views

How to use input variable in .zshrc alias?

I'm trying to create this alias: alias mrc="php artisan make:controller $(user_input) --resource" so that I can just type mrc ControllerName in the terminal to produce: php artisan make:...
2 votes
1 answer
112 views

Terminal cd .. TAB does not add slash

When using the terminal to navigate through my files I was used to be able to type cd .. TAB where the TAB would add the / at the end of the .. and I could just continue typing. Now, on big sur, this ...
2 votes
2 answers
103 views

In Terminal, using the "touch" command to mass create consecutive files with leading zero's, with bash, produces different results than zsh

In Terminal, I prefer to use bash as my default shell. Issuing the command touch File_{01..10}.txt produces these results: File_1.txt, File_10.txt, File_2.txt, File_3.txt, File_4.txt, File_5.txt, ...
5 votes
1 answer
434 views

Separate zsh histories after restart (iTerm2)

I am running iTerm2 (v 3.2.9) and zsh (v 5.7.1). I normally have 3-4 iTerm tabs opened at the same time and each tab has its own history thanks to the following settings in my .zshrc file SAVEHIST=...
29 votes
4 answers
38k views

Change default shell from bash to zsh

I've tried to switch my default shell to zsh, using chsh: chsh -s /bin/zsh and: chsh -s `which zsh` Both commands ended with: Changing shell for adamatan. Password for adamatan: chsh: Operation ...
0 votes
1 answer
16 views

Is it possible to set a per-profile HISTFILE in iTerm2?

Let's say I have a "Work" profile in iTerm2 and want to set a different HISTFILE for this profile, called .zsh_history_work, so that I don't see my work commands showing up in my regular ...
0 votes
0 answers
29 views

Why does setting my MAC address take two attempts?

I'm new to SE so I'm not sure if this is the correct site, but I am trying to change my MAC address to a fixed value on startup of macOS using zshell (bash should be similar or the same ). I oddly ...
32 votes
1 answer
164k views

How to uninstall zsh

I'm new to Mac. A friend installed all kinds of additional software including zsh which I would like to uninstall. So how can I uninstall zsh?
1 vote
0 answers
891 views

After updating oh-my-zsh prompt is weird on startup [closed]

I have been using the default installation of oh-my-zsh (robbyrussell theme) without issues. I just did a 'git pull' and now on startup I see a weird prompt. As soon as I press any key the prompt ...
4 votes
1 answer
3k views

tmux jump words as with zsh

I moved from just using zsh to using zsh inside tmux. As my terminal is iTerm2 for both combinations. I have the following lines in my .zshrc to enable jumping words on a bare zsh command line using ...
1 vote
1 answer
741 views

iTerm2, zsh and .zshhistory - how to have separate zsh history

I installed iTerm2 on Catalina 10.15.6 on a MacBook Pro bought in early 2020 and have two profiles - Default and MyUser. For MyUser, I set a custom location of /Users/john-doe/iTerm2/zsh (copy of zsh ...
0 votes
3 answers
830 views

zsh: command not found

I created a script , tried putting it in ~/.local/bin/script.sh and /usr/local/bin/script.sh but I get zsh: command not found: script This is my .zshrc file: cat .zshrc # If you come from bash you ...
0 votes
0 answers
115 views

zsh: command not found (some modules)

I used bash and installed different packages. But when i install zsh, some modules are missing, for example (angular cli, nvm - node version manager), but detected npm and node js. Why is this ...
0 votes
0 answers
47 views

Debugging phantom zsh process

Every once in a while (once a week?) I noticed that my mac's fans are spinning full speed. When I investigate my processes on activity monitor I notice a zsh process consuming near 100% on the cpu. ...
0 votes
1 answer
68 views

Customizing PS1 for two rows similar to zsh Kali

I was hoping someone might be able to help me figure out how I can customize my PS1 on macOS zsh to look like Kali zsh. Here is $PS1 from Kali zsh: %F{%(#.blue.green)}┌──${debian_chroot:+($...
0 votes
1 answer
71 views

Tab key no longer lists directory contents in zsh

Tab used to run an ls locally and in ssh sessions to offer suggestions, but this no longer works. It worked on my old Intel Mac, but now no longer works on my M1 MacBook. I've tried adding some ...
1 vote
1 answer
123 views

I can't get the zsh-theme to update all the inner shell scripting with each "return" on the terminal

Here is my new oh-my-zsh zsh-theme, updated with an escape character before each code block within $()'s which allows it to update every time the prompt is displayed (works with setopt prompt_subst: ...
1 vote
2 answers
5k views

npm command not found in zsh but found in bash

I installed npm with nvm and the first time it went all great, now I tried to check npm version on Mac terminal an it shows: % npm --version zsh: command not found: npm But using VSCode terminal with ...
0 votes
0 answers
91 views

Parameterized ZSH alias

Hello I'm trying to make an alias in zsh for the following command: gcloud compute instances delete CONTAINER_NAME --zone=x --quiet How can I make an alias that would fit my parameter in the ...
0 votes
0 answers
31 views

~/.ssh/rc is not executed when using ssh

I'm in the situation of having to connect to various systems via ssh to do some quick work and then leave without a trace. Before I do any work, however, I would like to set up some aliases to save ...
0 votes
0 answers
150 views

oh-my-zsh syntax-highlighting the tab completion when doing cd

Been struggling some time now and can't seem to figure out why I can't get the tab completion to highlight the folders I 'tab' into My zshrc files looks like this # Enable Powerlevel10k instant ...
3 votes
2 answers
414 views

How do I debug zsh when startup performance is slow?

I'm using Z shell inside iTerm2 every time I open up a new window or a new tab it takes around 8 - 9 seconds to load. I found some information on how to debug zsh. I came across this Speeding Up My ...
45 votes
2 answers
80k views

zsh: bad CPU type in executable

I am using the terminal on an Apple M1 MacBook. I try to use a cli tool that is not build for aarm64, so I get this error message in the terminal: zsh: bad CPU type in executable Is there anything I ...
0 votes
0 answers
28 views

Launchd unable to view contents of connected USB device

When I connect my USB device, I can open a terminal and run a script which returns a directory listing to a file in my home directory called ls.txt. It works and the contents of the script are: #!/bin/...
6 votes
1 answer
3k views

What does the time command do on zsh Mac terminal? And what is the output of "children"?

This is what I got from the terminal command "time". shell 0.32s user 0.08s system 0% cpu 6:09.64 total children 0.10s user 0.16s system 0% cpu 6:09.64 total What is children?
65 votes
7 answers
145k views

How to add permanent environment variable in zsh

I have been scouring the internet, and cannot seem to find a solution to permanently adding an environment variable, specifically when my OS is macOS Mojave (10.14). It seems there are a lot of ...
0 votes
1 answer
25 views

I'd like to change the shell script instruction to the one available in the terminal

do shell script "bless -mount /Volumes/BOOTCAMP/ -legacy -setBoot -nextonly" password "0000" with administrator privileges tell application "System Events" restart ...
1 vote
2 answers
356 views

How to remove new line from Terminal on launch?

When I launch terminal, it always puts a new line at the beginning first. I am using zsh and did install ohmyzsh, but I can't seem to find anything that would cause this behaviour. Please see ...
0 votes
2 answers
91 views

Where to put a bash script that I want to run only from my user? [duplicate]

I am a new macOS user and I want to create a bash script that I can add to the PATH and run as a "normal" command (cd for example). I'm the only user of the Mac and so I'll be forever, but ...
0 votes
1 answer
393 views

oh-my-zsh startup failure: __git_prompt_git status blocks

I have been installed iTerm2 and brew. In the process, I have some problems with my terminal. It doesn't show anything whatever I command it. That's all I can do is /bin/bash to return to bash. There ...
1 vote
2 answers
369 views

What's the correct file to store environmental variables for zsh?

I'm a bit confused as to how all of this works. Seemingly every tutorial tells me something different. So far there's about 4 different files I can add environmental variables to: .zshrc .profile ....
7 votes
3 answers
1k views

$PATH vs. $path

I can't remember why, but a long time ago, I found that for some reason, I needed to set both of these variables. It caused no problems in bash, but now in zsh, when I put export PATH=~/bin:/opt/...
1 vote
2 answers
284 views

sudo ownership and permission changed and shows `sudo: /usr/local/bin/sudo must be owned by uid 0 and have the setuid bit set`

I made another admin account in my MacOS Monterey for my programming job. Then I had to change ownership of Homebrew directories to make it work. sudo chown -R $(whoami) /usr/local/Homebrew/ /usr/...
1 vote
2 answers
82 views

How to tell what shell is running from command line?

If I do sudo zsh, I can tell I am in zsh by examining ps -ef Is there an easier way? echo $SHELL says it's /bin/sh, because $SHELL is always the default shell, not necessarily the shell that's ...
5 votes
1 answer
368 views

Tail terminal command is extremely slow when processing files with long lines

The tail command has become unusably slow for large files (e.g. 1 GB text file). EXAMPLE: $ tail -265000 file.txt > last_265000.txt takes 10+ minutes, whereas $ head -265000 file.txt > ...

1
2 3 4 5
7