New answers tagged command-line
1
vote
df difference in output of -H and -h
"Gi" or "GiB" is an abbreviation of "Gibibyte," 2^30 bytes. There are similar definitions for "Kibibyte," "Mebibyte," and so on, all based on powers ...
1
vote
Change mouse speed in terminal without restarting
After a fair bit of forehead-into-brick-wall effort, this is working for me in Sequoia 15.1.1:
on run (trackingValue)
--Open and activate System Preferences
tell application "System ...
1
vote
Some programs report "no route to host" connecting to servers when run without sudo
You are not alone!! I've got the same error trying to connect to a mac on my local network.
I can browse to it just fine: https://mymac.local:8581 for homebridge or https://mymac.local:631 for the ...
-1
votes
Mounting network afp volume from command line
This should work
sudo mkdir -p /Volumes/mount_point # only need to do this once
sudo /sbin/mount_afp 'afp://user:passwd@host/share' /Volumes/mount_point
0
votes
Does `open --arch ARCH` working on the wrong processor mean an ARM emulator is present for Intel machines running macOS?
No, the binary is fat (contains several build targets in an app wrapper) and the only code that can execute does. I would argue this is the correct behavior for open, but I suppose reasonable people ...
2
votes
How can I get the locate command to search into my home folder?
By default, the process to rebuild the locate database runs as user nobody. This prevents it from indexing the content of user directories (which would be a security risk on systems with more than one ...
0
votes
Some programs report "no route to host" connecting to servers when run without sudo
I compiled a build of telnet based on the latest available GNU inetutils v2.5 source code from https://ftp.gnu.org/gnu/inetutils. Since you said you're on a Mac Mini 2018, I built it for x86_64 ...
2
votes
Is there any way to grep a binary plist?
@nohillside's answer is certainly the canonical one. But, if you're willing to spare an additional 20ms or so of cpu time, this Python solution may also be useful:
https://github.com/luckman212/...
1
vote
On my Intel Mac, I upgraded brew and cannot use Terminal anymore
Run, without actually running, the Terminal program
Select "settings" in the menu and click on "general"
Specify "/bin/bash" as the full path, but it didn't work for me
...
-1
votes
How can I get the locate command to search into my home folder?
The update process runs as the unprivileged user nobody, even if you start it as root, so it only has access to the top of level of user home folders, unless the permissions have been hacked. This is ...
2
votes
On my Intel Mac, I upgraded brew and cannot use Terminal anymore
I assume you're running bash. From the Shell menu in Terminal, select New Command... and enter the following in the dialog that opens:
mkdir disabled_shell_files; mv .profile .bash_history ....
1
vote
Tor shows running on both port 9050 and 9150, but torsocks doesn't seem to be working at all
https://gitlab.torproject.org/tpo/core/torsocks/-/issues/40013 implies that torsocks doesn't work on Monterey and newer. The issue is open for two years now.
There is an alternative approach using tor ...
-1
votes
How uncompress tar.lz file
Simply extract all
tar --lzip -xf /Users/your_username_here/Downloads/your_file_name.tar.lz
tar invokes the command, the software utility.
--lzip specifies the compression method
x means extraction.
...
0
votes
How can I get the CPU temperature from the command line on Apple Silicon M1
We have several excellent TUI (Text-based User Interface) tools for monitoring various metrics on Apple Silicon Macs, including temperature data. These tools provide comprehensive system information ...
0
votes
Is there a way to preserve terminal tab history across computer restarts?
This worked for me:
Disable Settings:Desktop & Dock:"Close windows when quitting an
application". (This setting seems to move around with each OS version)
Quit Terminal, using command ...
0
votes
Some programs report "no route to host" connecting to servers when run without sudo
Not An Answer — the comments section has grown out of control and the latest ones are getting hidden, so I'm posting this here for visibility. I will delete it if and when a true answer is found.
I ...
1
vote
Weird long numbers in terminal prompt and mail headers
Next time this happens, explicitly set your host name and verify your command line prompt is fixed.
sudo scutil --set HostName "newname"
If so, check any of the 40+ questions linked from ...
3
votes
Accepted
Running `ps -t /dev/<tty>` started causing the specified terminal to stop receiving most keystrokes
I have this issue too, and I noticed that for each invocation of ps -t, the Crowdstrike Falcon Agent opens a new fd on that tty. That would explain why it started happening all of a sudden, it's not ...
1
vote
How to delete cache of Microsoft Teams on macOS?
The new Teams has moved its cache to these folders:
~/Library/Group Containers/UBF8T346G9.com.microsoft.teams
~/Library/Containers/com.microsoft.teams2
Source: https://learn.microsoft.com/en-us/...
0
votes
How do I verify the checksum or hash of a downloaded file on the command line?
Have a try on ezcheck.
Install ezcheck and try this to compare with given hash:
ezcheck compare -f /path/to/downloaded.pkg -c d9cd63f187db2daea1371289508c63a7a24c46316f15ac61f030a7d6ea423915
ezcheck ...
0
votes
How to delete cache of Microsoft Teams on macOS?
With the latest Teams version, the cache directory changed:
~/Library/Containers/Microsoft Teams
Some local logged accounts are also stored in the Keychain. Search for:
com.microsoft.oneauth
com....
0
votes
Setting different `PATH` variable for different profiles in iTerm2
If you're in a typical profile that starts your normal login shell, you can inspect the $ITERM_PROFILE environment variable at the start of your bash or zsh init.
So e.g., I have the following logic ...
0
votes
iCloud drive shows in Finder only files where I created a shared link
Here a solution, which is based on an idea of Lulucmy in his attempt to answer the problem:
When I opened my Finder preferences, I noticed that under the iCloud section, iCloud drive was checked, but ...
2
votes
iCloud drive shows in Finder only files where I created a shared link
I won't be able to answer on how it happened without having the command you've typed, but here is how you can get back the "iCloud Drive" tab in the sidebar:
Open the Finder and go to ...
13
votes
Accepted
Is there any way to grep a binary plist?
You can use plutil -p foo.plist | grep ... or plutil -convert xml1 -o - bar.plist | grep ... to search your string in a text representation.
0
votes
Can't modify Info.plist (Operation not permitted)
Caveat: original Info.plist has to be preserved somewhere to be restored later, rest you want to turn that Xcode (or whatever is that you are trying to resuscitate on Sequoia) copy into a doorstop.
...
3
votes
Accepted
Get macOS audio volume not rounded
Update: With a little help from OpenAI, I've written a tool in Swift that should provide a solution. The source code and precompiled binary releases are up on GitHub:
luckman212/volctl
It can list, ...
3
votes
Accepted
How to tell iterm2 to use emacs mode, not vi mode
It has nothing to do with Terminal vs iTerm and everything to do with what the shell running inside them is configured to do. The terminal emulator is not providing the line editor, the shell is.
...
1
vote
AppleScript that reduces the size of multiple PDF files fails
There's quite a lot to unpack here:
Firstly, Automator has an Apply Quartz Filter action, which is a lot easier to user than AppleScript. (Quartz Filters are an OS feature, not just Preview's.)
...
1
vote
How to tell iterm2 to use emacs mode, not vi mode
I still don't know why iterm2 behaves differently from Terminal and Hyper but here's a fix:
Append bindkey -e on a new line to your ~/.zshrc.
This explicitly tells zsh to use emacs/readline ...
-1
votes
Is there a terminal command to change app icons?
No, this isn't using terminal but it's the best and easiest way I've found.
https://freemacsoft.net/liteicon/
This little app is great. Just drag your .png onto your app that you want to change and ...
-1
votes
How to fix "Killed: 9" error in mac os?
I finally fixed the problem:
rm -rf /Library/Developer/CommandLineTools
then, download and install xcode.
do not install command line tools again
1
vote
Using locate.updatedb doesn't work in Lion
I had to manually modify my /usr/libexec/locate.updatedb script.
The su command they run just literally doesn't work on mac - the nobody user asks you for a password, and then that fails.
If you want ...
Top 50 recent answers are included
Related Tags
command-line × 3349macos × 1767
terminal × 1111
bash × 466
applescript × 198
homebrew × 194
zsh × 170
script × 152
unix × 128
finder × 111
xcode × 107
network × 105
automator × 92
mac × 79
permission × 77
iterm × 72
filesystem × 62
path × 62
open-source × 60
keyboard × 58
launchd × 58
python × 56
install × 53
security × 51
automation × 51