Tips and tricks

Useful commands in Mac OS X Terminal
Posted on August 15 2023 / in WordPress
How to add to PATH variable
The name of the PATH variable is case-sensitive and must be all-uppercase.
export PATH=$PATH:/folder/you/want
To verify your change, run:
echo $PATH
Listing all the groups to which a user belongs in macOS
id -Gn [user]
find files with a specific name in a directory
find /opt -name httpd.conf
see which files are preventing shutdown
pmset -g assertions
see scheduled tasks
launchctl list | grep com.local.sendrequest
close specific task
pkill -f "ng serve"
close task at port
lsof -ti:3514 | xargs kill -9 2>/dev/null || echo "No processes on port 3514"
connect to ssh server
if you have an authorised .ssh key in the ~/.ssh folder, you can do
ssh {{user}}@{{ip-or-domain}}
restart ssh server
if you have modified config or something, you can do
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_tfs
show hidden files mac
open terminal and write
defaults write com.apple.finder AppleShowAllFiles YES
disable mouse acceleration
open terminal and write
defaults write -g com.apple.mouse.scaling -integer -1
you can restart the terminal after that
restart airdrop
in case AirDrop is not working on your Mac:
killall sharingd
create a local dev Apache Mysql PHP Setup on Mac OS X - add XDebug
When starting bash / zsh rc which files can I config