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
0 votes
0 answers
44 views

How can I generate a spreadsheet of a folder structure on my computer with folder sizes included?

I'd like to make a spreadsheet of a folder structure in my filesystem. Given a parent folder or volume as the input, the output should include: Subfolders to the nth level (user-specified) A clean/...
user avatar
  • 169
0 votes
1 answer
33 views

How can I change ZSH history to always use the -i option?

I want the output of history in ZSH on MacOS to always use the -i option to show timestamps. Can I set an option or alias to make it do that?
user avatar
  • 636
2 votes
2 answers
205 views

"Unsupported OS" when using `open` command on M1 Pro

The open command on macOS usually opens files in their default application. On my new M1 Pro though it just always says "Unsupported OS" ❯ open test.txt Opening 'test.txt' ... Unsupported OS....
user avatar
  • 123
1 vote
2 answers
41 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 ...
user avatar
  • 21
1 vote
1 answer
92 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 ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
0 votes
2 answers
47 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 ...
user avatar
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 ?
user avatar
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 ...
user avatar
  • 1,110
0 votes
1 answer
53 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:...
user avatar
0 votes
2 answers
143 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 ...
user avatar
2 votes
2 answers
107 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, ...
user avatar
  • 6,347
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 ...
user avatar
  • 7,575
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 ...
user avatar
0 votes
0 answers
127 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 ...
user avatar
0 votes
0 answers
50 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. ...
user avatar
  • 121
0 votes
1 answer
70 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:+($...
user avatar
0 votes
3 answers
938 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 ...
user avatar
0 votes
0 answers
97 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 ...
user avatar
0 votes
0 answers
32 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 ...
user avatar
0 votes
0 answers
155 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 ...
user avatar
0 votes
1 answer
75 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 ...
user avatar
3 votes
2 answers
457 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 ...
user avatar
0 votes
0 answers
29 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/...
user avatar
0 votes
1 answer
26 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 ...
user avatar
0 votes
2 answers
95 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 ...
user avatar
  • 103
1 vote
2 answers
410 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 ....
user avatar
0 votes
1 answer
411 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 ...
user avatar
  • 1
1 vote
2 answers
544 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 ...
user avatar
  • 11
1 vote
2 answers
291 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/...
user avatar
  • 111
1 vote
2 answers
83 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 ...
user avatar
  • 3,360
5 votes
1 answer
390 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 > ...
user avatar
  • 161
0 votes
0 answers
452 views

Missing files from ZSH config

Have been experiencing some issues after installing NVM and was/ still am getting errors related to oh-my-zsh and powerlevel10k. At first, I was getting the following from pl10k: [WARNING]: Console ...
user avatar
-2 votes
2 answers
104 views

Why does globbing not work on X* or x*?

Due to a bug in Monterey, TextEdit quarantines any file it changes. xattr can fix it, and since I didn't know where such might be, I tried to do xattr -rc ~ But something in ~/Library prevents that ...
user avatar
  • 3,360
2 votes
1 answer
582 views

zsh does not find script in PATH while bash does (echo $PATH is the same)

I am trying to execute a script using just its name. So naturally I added it to the PATH variable. But it seems zsh does not care. If I switch to bash everything works fine. The following terminal ...
user avatar
  • 245
1 vote
1 answer
528 views

How to upgrade ssh on OS X 10.9 Mavericks without OS upgrade?

The ssh version 6.2 of OS X 10.9 (Mavericks) supports dsa and rsa, but not the newer Ed25519 keys. Ed25519 is there since OpenSSH version 6.5. As well as the old ssh-agent returns SHA-1 instead of SHA-...
user avatar
  • 3,546
0 votes
0 answers
33 views

problem with ls in ~/Downloads directory [duplicate]

How can I fix the broken ls command in the ~/Download directory in macOS? ~/Downloads  ls  ✔  at 02:01:06 PM ls: .: Operation not permitted
user avatar
2 votes
1 answer
122 views

Can't test whether key exists in associative zsh array

This is my script (zsh 5.8): # Consider parameter expansion of an unset variable to be an error set -u # Define and populate associative array typeset -A arr arr=(x xxx y yyy) echo $arr[x] # ...
user avatar
3 votes
1 answer
858 views

How to disable .zsh_history & .zsh_sessions on macOS?

By default in macOS zsh stores the history and sessions in the ~/.zsh_history & ~/.zsh_sessions files. However for one of my computers I want no Terminal/zsh history or session to be stored what ...
user avatar
3 votes
1 answer
85 views

I typed () in terminal and got a prompt. What is it for?

I typed () in Terminal and got a prompt: function> I can't find any zsh documentation about it (or if it is even related to zsh). I realized I can type any gibberish anygibberish() and also get ...
user avatar
  • 183
1 vote
1 answer
3k views

Command not found: /usr/local/bin/zsh

I uninstall homebrew on a Mac Mini M1 to reinstall it. After opening a terminal to run the install shell script, the terminal produces the following output and becomes unusable. [Command not found: /...
user avatar
  • 113
3 votes
2 answers
1k views

Convert PS1 prompt from bash to zsh for colour customisation

The macOS Monterey system uses zsh shell instead of bash, and I want to convert this bash command which you'd normally store in a .bash_profile file export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[...
user avatar
  • 61
0 votes
0 answers
76 views

In iTerm2, I can't run `ls` with both -a and -w flags. When I just run `ls`, I get columns, but when I run `ls -a`, it's all just in a single column

I'm transferring from Terminal to iTerm2 and am trying to set up my shortcuts. The problem is that when I run ls -a, everything is in one column whereas if I just run ls, it shows up in several ...
user avatar
  • 101
1 vote
1 answer
328 views

Use LS_COLORS (not LSCOLORS) on Mac OS

LSCOLORS does not give a lot of options or control for directory listings. I've tried several ways to use LS_COLORS (the standard method for such things) without success. Is it possible to bypass ...
user avatar
  • 171
0 votes
1 answer
514 views

Why does the shell run the incorrect Python?

I am coming from an Ubuntu environment, and since you can set Python 3 to be the first-class Python in Ubuntu (as in, you call python and you get Python 3), I wanted to do the same on the Mac I've ...
user avatar
  • 101
1 vote
1 answer
629 views

Homebrew PATH set in .zshenv is overridden

Following this answer about best practices for configuring Zsh, I wanted to move my Homebrew PATH initialization to the ~/.zshenv file: eval "$(/opt/homebrew/bin/brew shellenv)" This ...
user avatar
  • 267
1 vote
1 answer
24 views

ImageMagick Convert single frame = file not found

I am trying to extract the fist frame of a video convert ./video.mp4[0] ./sample.jpg I get file not found if I put [0] it works without [0] but this is not what I want All examples on the net suggest ...
user avatar
1 vote
0 answers
12 views

Mac Terminal changed from @username-MacBook-Pro to @username-MBP, why? [duplicate]

I was using my macOS terminal and I realised that after doing a factory reset my terminal name went from username@Username-MacBook-Pro to username@Username-MBP. Nothing else really changed but I want ...
user avatar
  • 11
0 votes
1 answer
142 views

zsh compinit errors

I have errors with the zsh shell: zsh compinit: insecure directories and files, run compaudit for list the files listed with errors are /usr/local/share/zsh/site-functions /usr/local/share/zsh /usr/...
user avatar
0 votes
0 answers
452 views

Can't add PATH entry for PHP to ~/.zshrc: "permission denied"

I have installed PHP 7.4 on my Mac using brew. Now I want to be able to have it in my PATH variable. I need to run: echo 'export PATH="/opt/homebrew/opt/php@7.4/bin:$PATH"' >> ~/.zshrc ...
user avatar
  • 1

1
2 3 4 5
7