# u-never-knew-this-mac-terminal-trick
Published in
3 min readSep 2, 2023
- `say then whatever u want ur Mac to say`, Siri will say whatever u want her/him to say, but don’t know why it’s always a male voice i tried to change it but was unable to, If someone know how to make a female voice say in terminal
- `security find-generic-password -wa “whatever is ur wifi name”` this will show the password of the wifi stored in ur mac
- `some command | pbcopy` whatever is the output of the command will be copied to the clipboard
- `shift command option v` to copy without formatting, it’s really a godsend if try to copy something from notes to Google Docs or majorly anything to Google Docs
- `caffeinate` type thing in the terminal and your Mac won’t sleep till u end this command, It’s perfect for a coffee break
- `command control shift 4` like normally u takes screenshots by pressing `shift command 3` or for a specific area `shift comand 4` but by doing so the screenshot will get saved on the desktop and then u have to go to the desktop and from there u need to copy and then paste it somewhere but with this command, u can take a screenshot of a particular place and copy it to clipboard.. really amazing one
- `defaults write com.apple.screencapture name` -> Set a default name to your screenshots
- `defaults write com.apple.screencapture type` -> u can set your screenshot file format jpg, png, etc
- `default write com.apple.screencapture location ~/Desktop/screenshots` Currently the default saving location for your screenshots is your desktop, u can change it with this command
- `passwd` to change your password
- `whoami` will tell u ur user name
- `ditto` there r two commands on Mac to copy and paste via your terminal, `cp` and `ditto`, don’t know sure, but a Mac expert said to me that `ditto` is better than `cp`
- `df -h` will tell u how much space u have in your Mac, it’s full form is displays free disk space
- `man` to open a manual or if u want a manual of something, like say `cp` command u can type, `man cp`
- `open` to just open things like `open .` will open finder, or `open myprofilepic.png`
- `ping` to check whether a website is up or not, like `ping google.com`
- `ifconfig` configures network interface parameters, u can use it with different variations and combinations as such, `ifconfig en0`, `ifconfig en0 | grep inet`, `ifconfig en0 | grep inet | awk ‘carry regular expressions’`
- `traceroute website.com` to see the path u r taking to get to a certain website, great for troubleshooting
- `dig websitename.com` If u want to dig into the DNS of a website, u can get all the DNS goodness
- `ps` to see all the processes on your computer
- `ps -ax` to see more, like a lot more
- `top` u can see which processes are using the most CPU in real-time
- `top -o rsize` can see processes by memory
- `kill -9 processid` will kill a running process, cooler combination for this is, `ps -ax | grep processname`
- `which $SHELL` to see which shell we r using
- `bash` to switch to bash shell
- `zsh` to switch back to zsh shell
- `uptime` to find how long have your mac been up
- `qlmanage -p thefileNameThatUWantToPreview` to preview any file
- `diff file1 file2` to compare two files
- `curl theLink < where u want to store` to download
- `leave 1245` will set an alarm in the terminal, and will tell u to leave at that time
- `history` to see the history of all the commands u have been typing in your terminal
- `python3 -m http.server` This will create a web server of your hard disk and anyone can go to the ip address and see your files
- `shutdown -h now` to shutdown immediately
- `shutdown -r now` to restart immediately