All Questions
223
questions
0
votes
0
answers
164
views
Shell script run by launchd in MacOS can't create at job
I'm using the privileges.app to grant users temp admin privileges.
Because I need to have password auth and justification enabled via config, I can't use the build-in feature to limit the duration of ...
0
votes
0
answers
122
views
I can't connect from Mac when I change the default shell to bash on Windows 11 SSH
I started an OpenSSH server on Windows and connected from a Mac terminal.
I was able to connect when the default shell was cmd.exe, PowerShell, or GitBash, but not when I changed to bash.
New-...
0
votes
0
answers
192
views
Deleting folders using rm -rf does not free up space
I am trying to re-install macOS on my iMac.
My iMac worked perfectly, before I upgraded macOS Ventura (It was a minor upgrade, I was already on Ventura). After I did a regular update, I logged into my ...
0
votes
0
answers
140
views
Command not found -bash error
I am noticing that after I did something with terminal attempting to install a program that some third party commands stopped working. For example, I tried installing miniconda with these two ...
0
votes
1
answer
97
views
What process controls two-finger zoom on Mac?
Every once in a while, plugging my Mac into my monitor when lots of processes are running will crash some of the display agents, like exposé, zoom and other trackpad functions. I figured out some bash ...
1
vote
2
answers
815
views
Shell script in Mac Automator won't work with folders
I am creating a service in Mac Automator which is basically a bash script to change some dcm files with dcmodify. Whenever I run it on a single file it works flawlessly, but when I try to run it over ...
0
votes
1
answer
2k
views
What is the difference between “base64 -b0” in macOS versions prior to macOS 13 (Ventura) and “base64 -i” in macOS 13 (Ventura)?
Up until I recently upgraded to macOS 13 (Ventura) I could run this Bash command to convert a JPEG image into a Base64 string in a script I occasionally use:
IMAGE_BASE64=$(base64 -b0 /path/to/image....
0
votes
1
answer
229
views
which -a bash shows same path multiple times
When I check for bash installation I get multiple bash shown:
➜ ~ which -a bash
/bin/bash
/opt/homebrew/bin/bash
/bin/bash
Why is the same path shown twice? Is there a way to remove one of the /bin/...
0
votes
0
answers
14
views
aliases for terminal commands not loading on session start [duplicate]
my ~/.bashrc and ~/.zshrc both files have following aliases
# exa to ls
alias l='exa'
alias la='exa -a'
alias ll='exa -lah'
alias ls='exa --grid --color=auto --icons'
# bat alias to cat
alias cat='...
2
votes
0
answers
2k
views
Can't change default login shell on OSX Monterey
I prefer to use bash on my Mac, but the version provided by Apple (GNU bash, version 3.2.57(1)) cannot glob files with accented characters, so using homebrew, I have installed a later version, 5.1.16, ...
0
votes
0
answers
510
views
The username in my terminal bash is not my name. How to fix it? Do I have security concern?
I ran a sklearn update last week, and today when I opened my terminal, the user name is not mine anymore (as shown in the screenshot, I have no idea who is Yakov).
Anybody has any idea why this ...
1
vote
2
answers
1k
views
arm64 mac: how to keep two shell environments (with and without rosetta) organized
I'm using an M1 macbook air for programming work. There are many tools that need rosetta emulation, while others work much faster and more stable natively.
To deal with this I've set up a copy of the ...
0
votes
1
answer
408
views
Find the most recent file of a type in terminal and then open it (mac os)
I found part of this question in 2 other posted questions, but I cant seem to get the last step working which is just "opening" the file:
How do I get files found by command-line 'find...
0
votes
1
answer
84
views
To deeply learn how my new Macbook works do I need to learn Unix? [closed]
I've been a Windows person since 1988 and I've bought my first Mac. Yeah thanks. I used to be tech support for Microsoft so it's horrible not knowing deeply how my new machine works.
I understand that ...
0
votes
0
answers
271
views
ssh known_hosts seems to be ignored if using ssh as a launchd agent on MacOS
I have a service that acquires data with ssh. This works on linux in systemd, but in trying to do the equivalent on mac, I don't think the ~/.ssh/known_hosts file is being respected, because an ...
7
votes
1
answer
7k
views
What is the correct Homebrew Installation command for an M1 Mac mini and Big Sur?
After reinstalling the whole M1 Mac mini, Big Sur and Migration Assistant for this morning's Time Machine's backup, I'm getting a new error when installing Homebrew:
/bin/bash: line 156: /usr/local/...
3
votes
1
answer
568
views
Is it possible to virtually dim the brightness of a single window/app?
So that apps with dark mode are unaffected but apps without darkmode can be virtually dimmed. I have apps that virtually dim the screen (I think they just apply a dark color filter/tint onto screen), ...
0
votes
1
answer
176
views
how to gather first part of second line of output in a bash script and set to variable
I have the following command I need to run from a script to create a droplet from digital ocean:
RG@iPhone-3 Projects % doctl compute droplet create testdroplet --image ubuntu-18-04-x64 --size s-1vcpu-...
0
votes
1
answer
198
views
Create new screen with correct environment and at pwd
It's been brought to my attention from my users that the screen command can be made a little easier to use. Initially, calling screen creates a fresh bash environment at the pwd of wherever the user ...
16
votes
2
answers
11k
views
Getting an “Operation not permitted” error when running commands after to SSHing from another machine to macOS
I try to SSH from MacBook A to another iMac (iMac B) with two external drives connected to it. SSH is successful but I cannot perform the ls and touch commands.
Although I set the full disk access to ...
0
votes
0
answers
605
views
Terminal on OSX stuck at login screen, 80x24 error
I did try all methods given in prior threads.
Problem: login, blank screen, 80x24 on Terminal
I cannot find any file called com.apple.Terminal... in Library/Preferences that I could delete, nor I ...
0
votes
0
answers
64
views
Mac Bash Open Chrome to one of the Chrome Settings Tabs
I'm trying to write a script that opens chrome://net-internals/#dns in a new window so people can clear their internal chrome dns cache. But I can't seem to get it to open. This is on a Mac. How can I ...
0
votes
1
answer
50
views
What sets default values for Mac env vars other than .bash_profile?
I amusing a Mac. My company used to host a proxy server at http://proxyA and I had my http_proxy & https_proxy vars set to that value in my .bash_profile.
Recently we changed to a new proxy (let'...
0
votes
0
answers
197
views
Can't launch Finder window from terminal on Mojave
open isn't behaving as expected on Mojave. Running
open /Library/
gives
LSOpenURLsWithRole() failed with error -600 for the file /Library.
This happens regardless of the opening location. I'm ...
0
votes
1
answer
168
views
Mac - new terminal takes an unexpectedly large amount of time to open
I have observed lately that my bash takes a large amount of time to open. It seems it is running some commands in the background. I am using Oh My ZSH framework for the terminal. On the new terminal ...
0
votes
1
answer
383
views
keyboard shortcut to change command and option keys on mac
I have a German MacBook, though for programming I largely use an external QWERTY-keyboard with the standard Windows keys. To not confuse my muscle memory I would like to have the command and option ...
0
votes
2
answers
199
views
Moving and renaming files recursively
I have the following file structure:
root
root/year
root/year/MM-Month
root/year/MM-Month/YYMMTT_Event
root/year/MM-Month/YYMMTT_Event/01 Photos/
root/year/MM-Month/YYMMTT_Event/01 Screenshots/
root/...
2
votes
0
answers
148
views
Mac Terminal or iTerm: Copy the current command (not including prompt)?
I am using Terminal or iTerm (iTerm2). Let's say I've typed in a command but haven't hit enter yet. Or maybe I used the up arrow to navigate through my command history. How do I copy the current ...
1
vote
1
answer
967
views
Replace a line containing special characters in all files recursively using SED MAC
I was trying to replace a line with another using SED on MAC OS X Terminal
I have a scenario where I need to replace a line in all files present in a directory with another line.
Both lines are ...
0
votes
2
answers
238
views
How to remotely tell a Mac to sleep without using SSH?
I am needing assistance in getting a Mac to go to sleep without the usage of SSH. Almost any other method is acceptable.
Backstory: Product Salesman and Project Manger sold a thing without asking ...
0
votes
1
answer
269
views
How to copy nested folders to multiple destinations? (unix, bash, mac)
Given a folder structure, such as:
/Parent-Folder
/Child-Folder
/Child-Child-Folder
...
How do I copy/paste all child folders to a list of destinations, such as:
Dest Folder/
Dest Folder2/
...
-1
votes
2
answers
496
views
Rename mp3 files to remove numeric extension [duplicate]
I have a bunch of mp3 files that iTunes copied over adding a numeric extension, that I want to remove. Is there a Mac bash command that will allow me to do that? Here is what the directory looks ...
0
votes
2
answers
3k
views
Terminal start-up stuck after upgrading to Mac OSX Catalina
I just upgraded my Mac operating system to 10.15.1 (Catalina), and I'm now unable to interact with my terminal properly. When I open the Terminal application (or iTerm), it outputs the last attempted ...
3
votes
1
answer
3k
views
Is it dangerous to have /usr/local/bin ahead of /usr/bin in one's PATH?
I was reading a Stack Exchange answer here about a connected topic, and part of the accepted answer said this:
never place user-writeable PATH elements ahead of those that can only be modified by ...
1
vote
0
answers
20
views
-bash export message when opening terminal on mac [duplicate]
I'm having the following message whenever I open my terminal on mac OS Mojave:
Last login: Sun Sep 22 20:35:33 on ttys000
-bash: export: =': not a valid identifier
-bash: export:/Users/MYNAME/.local/...
1
vote
1
answer
346
views
Different files with same extension colored differently in mac terminal using CLICOLOR=1
I'm coming from StackOverflow where I posted this question and got redirected here. Let me ask it here again :
I have been trying to add colors to my mac terminal but not every file is colored. ...
0
votes
1
answer
2k
views
macOS: Add VSCode to path
Despite the fact that I have taken care of this:
pkaramol@MacBook-Pro bin $ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/Visual Studio Code.app/Contents/Resources/app/bin/...
0
votes
1
answer
359
views
Restoring deleted files by rm -r
In Mac's terminal, while trying to delete an uncompressed file, I accidentally deleted most of my /usr/local/bin including bash. While searching for solutions to undo the damage, I found that most of ...
0
votes
1
answer
639
views
Installing v8 on mac: v8: command not found
I am trying to use v8 on mac and I have tried installing it using homebrew.
When i run:
brew install v8
I get:
Warning: v8 7.3.492.27 is already installed and up-to-date
But, when I run v8 ...
0
votes
1
answer
136
views
Terminal (Mac) isn't behaving as it should on startup
Apologies for this rookie question, but I have no idea what to do or who to ask to try and fix this.
While following a Codecademy course and trying to set up Git, I did something that I can't for ...
2
votes
1
answer
2k
views
Terminal is not responsive - `process completed`
Following on from my previous question ([echo $PATH results in /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/bin:/bin:/bin:/bin:/bin:) I have been commenting in bash_profile everything out and then I ...
3
votes
0
answers
2k
views
Why does this netcat pipeline work in macOS but not Linux?
I set up the following pipeline. This allows me to see the raw HTTP requests and responses that pass through the pipeline.
Note: I use BSD nc below (this is what comes with macOS and AmazonLinux), ...
1
vote
0
answers
260
views
prevent files from renaming themselves automatically
-using Mac OSX 10.14.3,
I have some script files such as this:
#!/opt/local/bin/bash
...do some commands in bash;
I use them a lot from the terminal, and want to give them short names without a .sh ...
1
vote
0
answers
25
views
How to combine Mac terminal find -name patterns? [duplicate]
I use Xcode. I want to use bash to batch modify the UI fonts.
Here is the code to ".xib" and ".storyboard":
xibd(){
cd "$(dirname "$1")/.." && pwd
find . -type f -name "*.xib" -...
7
votes
1
answer
65k
views
bash: service: command not found
I was having an issue running a mysql command and saw suggestions on a few issues online that suggested using the service command and it seemed to be that it was something that I should have by ...
0
votes
1
answer
253
views
How and where does Python modify my PATH variable
/Library/Frameworks/Python.framework/Versions/3.7/bin is in my PATH variable, and I didn't put it in. I don't want it in my Path. I have looked at these obscure files that might have added this in my ...
0
votes
1
answer
1k
views
How to make new files inherit permissions of parent directory in macOS?
I have a directory python-work for my python(3) work. I create a new file test.py. This file will simply print('hello world').
Trying to run the new file:
{mac name}:python-work user$ ./test.py
-...
1
vote
1
answer
2k
views
pbcopy/pbpaste not same behaviour as copy and paste Mac OS
Running the latest version of Mac OS Mojave. I do:
pbcopy < dir/sw7.s
pbpaste > dir/testpaste.mips.s
that copies the contents of sw7.s to testpaste, and the file size is exactly the same. ...
15
votes
1
answer
4k
views
I changed my "HOME" variable and now cannot find "~/.bash_profile" to change it back
I was messing around with environment variables on my Mac, trying to learn how to use them and I used the command nano ~/.bash_profile where I then added the line HOME=/Users/MyCompName/Desktop to ...
0
votes
0
answers
227
views
Permission Denied when try calling "sh -c SOMEALIAS" on mac terminal
On mac I made an alias to mitmdump and then I tried through terminal
sh -c fullpathto/mitmdump # works
sh -c fullpathto/mitmdump_alias # Permission Denied error
while double click of mitmdump_alias ...