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
2
votes
1answer
77 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
1answer
27 views

How to change this terminal customization tutorial for usage in zsh rather than bash?

This tutorial gives instructions on how to customize the look of macOS's Terminal application. I followed the instructions but used zsh where it said bash in hopes that it would work, but it didn't. I ...
2
votes
1answer
64 views

How do I use a glob with parentheses in Zsh?

This: cp ./hb_(lys|gln|thr|glu|ace|nhe)*_aacH*.ptraj ./ Works just as intended when executed in the terminal. However, putting the same line in an executable script does not work as I receive a ...
1
vote
0answers
9 views

Control key not working in Kitty or Alacritty but it works in iterm2

I'm using zsh with iterm2 but I wanted to switch to another emulator like kitty or alacritty and I have a problem which I cannot figure ot: In iterm2 Control based combinations work but in kitty or ...
1
vote
1answer
43 views

Zsh syntax question

I am using a script on my iMac (Automator) that I found on macmost.com that contains the following lines: #/bin/zsh for f in "$@" do filedate=$(mdls $f | grep kMDItemContentCreationDate ...
0
votes
0answers
8 views

iTerm2 captured output with watch script

iTerm's Captured Output is a great feature: I can run a build and open any files with problems, focused on the troublesome line in whatever editor I choose. The one problem I've had with it is running ...
0
votes
3answers
78 views

Why is bash unavailable even though installed?

My goal is to run a script, where the shebang line causes bash to be used. Somehow running bash always runs zsh for me, even though I installed bash 5 using Homebrew and Mac (10.15) comes with bash 3. ...
0
votes
1answer
48 views

“Command not found” lines on terminal startup

Whenever I open my terminal, these lines are displayed: /Users/USERNAME/.zprofile:2: command not found: bin /Users/USERNAME/.zprofile:4: command not found: bin /Users/USERNAME/.zprofile:6: command not ...
0
votes
0answers
12 views

/usr/bin symlink [duplicate]

I was testing a Unix CVE-2021-3156 on my mac, but macs don't have sudoedit. I heard that symlinking /usr/bin/sudoedit to /usr/bin/sudo would cause the same error, but testing that gave this: ln: /usr/...
1
vote
1answer
22 views

ssh-keygen -R saying (wrongly) no matches found

I've come across the not-uncommon issue where ssh keys on a host have changed, so they don't match what's saved in my ~/.ssh/known_hosts file. When I connect (in this case via an Ansible playbook), it ...
1
vote
1answer
112 views

Make a sound in zsh when a command is not found

How can I get zsh to play a sound when the command is not found? Ex: I have the alias vpn to open my VPN from the terminal (zsh). If sometimes by mistake I type cpn instead of vpn, I get the following ...
0
votes
0answers
70 views

“locate” returns relative instead of absolute paths

I have the following entry in root's crontab: 0 */4 * * * cd /private/var/root && ./locate.updatedb I have an alias for locate in ~/.zshrc: alias locate='locate -d /var/db/locate.database' ...
1
vote
2answers
64 views

Cloning a directory in terminal, using ZSH

I'm trying to clone a directory which holds a git repo. i.e., I have /Users/me/someFolder - someFolder has ALOT of files, like over 250k. It's also a git repo, with a .git directory, and many other ...
3
votes
1answer
223 views

Does MacOS on M1 prioritise arm binaries later on path?

I'm trying to nix my new M1 Mac with home-manager and I'm thinking I might wanna skip xcode devtools altogether. I've installed nix and home-manager and built a generation with git, but: viktor@...
1
vote
0answers
37 views

Terminal adds too much whitespace when there are surrogate-pair emoji in the prompt

I've set my prompt using this: PROMPT='👨🏻‍💻 %1d: ' but now terminal puts the cursor quite far behind the colon. When I type text, the text does appear where I'd expect it to, but the cursor shows ...
3
votes
1answer
5k views

Big Sur switched to zsh terminal but still uses .bash_profile

I've upgraded to Big Sur and noticed my user was still using bash shell, so I changed Users → Advanced Options → Login shell to /bin/zsh and restarted. The shell that starts appears to be zsh insofar ...
0
votes
0answers
8 views

Terminal display name is changed after a Time Machine Backup restore [duplicate]

I recently restored a Time Machine backup. After that the display name in Terminal.app is changed. MyName@M2004J19C-Redmi9 ~ %. Why M2004J19C-Redmi9?? Terminal works properly but why MacBookPro-etc. ...
2
votes
1answer
74 views

Why does Terminal not honor preferences?

Sometime in the last week my Terminal stopped honoring the "New tabs open with: Same Working Directory" setting. Testing with "New windows ..." gave the same result. My shell is ...
10
votes
1answer
9k 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
1answer
36 views

How do I revert Mac locations?

Hi! I was hoping someone could help with my issue. Basically my Locations has changed on my Mac. I can't remember exactly what it was before, possibly my name but now it is showing bazooka. I think ...
8
votes
5answers
3k views

I accidentally used “touch ..” , is there a way to safely delete this document?

I am using zsh, macOS 11.0.1 (Big Sur), was working on a project and for some stupid reason I decided to write touch ... A file was created in the Desktop so I don't think that it will affect the ...
0
votes
1answer
40 views

inconsistent results for basename?

In the following, why is the third instance of basename including the file's enclosing directory? WGroleau@MBP Music % basename Korean/kr_audio.tbz kr_audio.tbz WGroleau@MBP Music % basename ./Korean/...
1
vote
1answer
107 views

Creating an alias for Python in bash/zsh

I have often seen people recommending to setup an alias in one's .bash_profile or .zshrc along the lines of alias python='python3' This seems like a convenient idea, however, as far as I understand, ...
4
votes
2answers
452 views

How do I use zsh to pipe results from one command to another (while in a loop)?

macOS 10.14.6 zsh 5.8 jq 1.6 I have a situation where I have a bunch of .vital files, which are JSON files in disguise. I want to extract one piece of information from each file, and I have worked ...
1
vote
1answer
38 views

How should paths in /etc/paths.d get added to $PATH?

None of the paths I have in the /etc/paths.d directory are being added to $PATH in any of the shells on my High Sierra system. Presumably there’s supposed to be something in some file that says to ...
0
votes
1answer
106 views

How copy text into Terminal command line zsh?

Somehow something seems to have been changed with my Zsh configuration or Terminal settings under macOS Catalina (10.15.7). If I copy some text, say from a TextEdit window, the usual paste command and ...
-1
votes
1answer
391 views

curl not bring installed to /usr/local/bin with homebrew

I'm trying to install the latest version of curl with homebrew, but it doesn't seem to be working. I installed it with the following command and it seems to happen successfully: $ brew install curl ...
1
vote
1answer
44 views

How to extend PATH of LaunchAgents in ~/Library/LaunchAgents?

I noticed that ~/.zshrc is not loaded... I need to add /usr/local/bin to PATH.
1
vote
1answer
93 views

weird ZSH issue (resolving environment variable)

using ZSH mac latest. In .zshrc I have: export ZSH="~/.oh-my-zsh" that directory exists: cd ~/.oh-my-zsh me@Imac-Retina-2 .oh-my-zsh % ls CODE_OF_CONDUCT.md README.md lib/ ...
0
votes
1answer
42 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
2answers
94 views

Way to keep track of successful commands on command line?

Usually I just copy/paste successful actions I do on the command line into a text file. That's a bit of an error prone and cumbersome process and I sometimes forget to do it. Do you know of a way to ...
0
votes
1answer
111 views

How to run a shell command inside a zsh-theme with Oh My Zsh

So, I have Oh My Zsh up and running, and I'm creating my own new zsh-theme. In it, I wish to grab the external IP address from https://api.myip.com - and I'm using curl & grep to grab it. Works ...
1
vote
1answer
1k views

zsh comment character

Many bash scripts invoke the #character to indicate a comment. Catalina migrated to zsh. The command: # Comments should elicit no response returns zsh: command not found: # I find useful command ...
1
vote
1answer
36 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
1answer
52 views

why does find / rm tells me it doesn't find a folder after it found it?

I'm trying to remove some folders recursively: find . -name bin -type d -exec rm -r {} \; when I run it, I get an output like this: find: ./Services/BinanceConnector/bin: No such file or directory ...
0
votes
1answer
57 views

Make username@machine bold in Terminal's ZSH shell but not the command's output

How can I make Terminal, using ZSH shell, display username@machine current_folder % in bold? I know it has to do with editing PS1 variable in zshrc file located in /etc folder. I have tried that, I ...
1
vote
2answers
235 views

Command in shell script to minimize particular window of an open app? [duplicate]

How can I include in a (zsh) shell script a command that will minimize one particular window among several windows open in a specified app? I already know how to include a command that opens an app ...
3
votes
2answers
605 views

How can I convert this Bash prompt to zsh?

I have the following configuration for Bash: # Change Prompt # ------------------------------------------------------------ export PS1="...
0
votes
0answers
120 views

Cannot find my Miniconda Python installation after switching from bash to zsh

Recently after upgrading to Catalina, the terminal changed from bash to zsh, and I lost my Python installation. My Python was installed with Miniconda, but now I can't find it anymore, I can only see ...
1
vote
2answers
207 views

Why does my zsh program run fine in terminal, but not as an automator app? [duplicate]

I got a mac last week and am trying to learn the basics by coding a few projects I came up with. I've been creating a few apps I can place on the dock that automate simple functions that I use often. ...
6
votes
2answers
754 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/...
0
votes
1answer
736 views

zsh: command not found: msfconsole

Installed Metasploit on my macOS Catalina from the rapid7 website - pkg installation. When trying to run the command msfconsole the terminal displays the following error: zsh: command not found: ...
1
vote
1answer
56 views

Any other Terminal / shell based options to strip all ACLs and extended attributes from a folder?

I'm having some trouble deleting some folders that contain nothing and have no processes or kexts utilizing them (lsof | grep path_element). When I try to delete them (as root) I get: root@hostname /#...
2
votes
1answer
1k 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 ...
1
vote
1answer
173 views

how dangerous is it to give zsh full disk access?

I have a shell script that runs a few (Duplicacy) backup commands. It works fine when I manually run the script from terminal (cd to the directory where it is and then ./backup.sh). To make it run ...
2
votes
1answer
98 views

Vim frozen and unresponsive on startup

I am using zsh on macOS. When I type vim, it opens, but it is completely frozen: Anything I press on the keyboard does not display or change the window. In order to exit, I have to terminate the ...
1
vote
5answers
434 views

How to identify the largest files in a directory including in its subdirectories?

I have a directory with a lot of files and subdirectories. I know there are a small number of large files contained somewhere within. What is a quick/easy way to identify one or more large files in a ...
1
vote
1answer
48 views

Launchd/Launchctl - pre and post scripting

Is there any way with ld/lctrl to execute pre/post commands similar to systemd's ExecStartPre/ ExecStopPost?
1
vote
2answers
136 views

grep ^\. not working as expected in Mac terminal

if I run the following command in my mac terminal: ls -al | grep ^\. or ls -al | grep '^\.' or ls -al | grep "^\." I get no results back even though there are several files in my home ...
3
votes
2answers
607 views

MacOS Catalina terminal tab doesn't remember its own previous commands

I upgraded from El Capitan to Catalina recently; when I click ↑ in any terminal tab it used to toggle previous commands executed within that specific tab only, but now it will show commands for all ...

1
2 3 4 5