Dark Light

Here are the top 50 macOS terminal commands you need to know

First How do you launch a terminal?

Hit the command key and space bar.

50 macOS terminal commands

Command 1: say

say

you can make talk right from the terminal, just write say and whatever you want to say

Command 2: security find-generic-password -wa

 security find-generic-password -wa “name you wifi”

you can find your saved password from the terminal

Command 3: phcopy 

this code will copy the output of any command to your clipboard 

Command 4: you need to copy plain text without formatting 

command + option + shift + v

Command 5: caffeinate

caffeinate

as long as your terminal is up, your mac will stay awake 

then hit control C to stop the coffee break

Command 6 : command + shift + 3

command + shift + 3

Taking screenshots that’s cool, but you have another option 

command + shift + 4 which allow you to 

select just a part of what you want to copy and save it

Command 7: defaults write com.apple.screencapture name

defaults write com.apple.screencapture name “name”

You can change the default name of your screenshot 

Command 8: type

You can change the default type of your screenshot 

defaults write com.apple.screencapture type jpg

Command 9: location

You can change the default location of your screenshot 

defaults write com.apple.screencapture location ~/Desktop/screenshot

Command 10: passwd

passwd

To change your password

Command 11: cd

cd

CD will change your current working directory

type CD where you were to go 

CD space to get back home

Command 12: ls

ls

The LS command will list all the files of folders in your directory

wherever you are

command 13: PWD

pwd

PWD let’s find out where you are, it will print your working directory

Command 14: whom

whom

this command tells you exactly who you are

Command 15: mv

mv

You can move files with MV command specifying our files and where you want to move it 

Command 16: cp

cp

This command to copy files

Command 17: ditto

ditto

it is the same as the cp command

Command 18: df -h

df -h

This command to see how much space you have on your hard drive

Command 19: nano

nano

Start editing a file right in your terminal

Command 20: man

man

to learn about your command and get more information

Command 21: Open

Open

To open things and files

Command 22: ping

ping

Write ping and name of the website if you get responses then it up and control C to stop it

Command 23: ifconfig en0

ifconfig en0

To find your IP address

Command 24: ifconfig en0 | grep net

 ifconfig en0 | grep net

which allows us to filter all that we want to see

Command 24: ifconfig en0 | grep net | awk

ifconfig en0 | grep net | awk

you get IP v4 and IP v6

Command 26: traceroute website name

traceroute

to see the path through the internet that takes to get you to a certain website

Command 27: dig

dig website name

You will get all the DNS

Command 28: ps -ax

ps -ax

to see all the processes on your computer

Command 29: top

top -o rsize(for memory)

see which processes are using the most CPU in realtime

Command 30: kill

kill

It will kill a running process

Command 31: which $SHELL

which $SHELL

to see what type of shell we use

Command 32: bash

bash

to switch bash 

Command 32: zsh

zsh

Back to zsh shell

Command 34: uptime

uptime

to find out how long your mac has been up?

Command 35: killall mDNSResponder

killall mDNSResponder

to flush your DNS cash

Command 36: qlmanage

qlmanage -p filename

to get a quick preview of the file

Command 37: diff

diff file1 file2

To compare two files

Command 38: curl

curl url > where you want to store

to download files through terminal 

also, you can curl the weather by

 curl wttr.in/paris

Command 39: leave

leave 12:45

if you’re spending too much time in the terminal you can set an alarm in your terminal 

Command 40: History

history

to see all your command because you’ve been typing a lot of commands

Command 41: disable gatekeeper

sudo spctl —master-disable to  disable gatekeeper

The thing on your mac that keeps you from installing apps you want to install

command brew The Missing Package Manager for macOS (or Linux)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Command 42: brew install cmatrix

brew install cmatrix
cmatrix

after installing type cmatrix

Command 43: brew install asciiquarium

brew install asciiquarium
asciiquarium

after installation type asciiquarium

command 45: brew install toilet

brew install toilet
toilet

You can turn any name, or text into ASCII character art like toilet whatever 

Command 46: Tetris

brew install samtay/tui/tetris

yes, you can play Tetris in terminal

Command 47: python 3

python 3 -m http.server

and suddenly you have a little web server 

Command 48: shutdown

you can shutdown your computer without leaving your terminal 

shutdown -h now (shutdown)
shutdown -r now (restart)

Command 50: Sudo touch id

sudo nano /etc/pam.d/sudo

after the file open add this line 

auth sufficient pam_tid.so 

save

Introduction to Blockchain and the Technology and Web3

Read More

Microsoft365 for Business
Related Posts
art-nft

How to create NFT Art

Table of Contents Show How To Create NFT Art in Easy Steps1. Select an NFT Marketplace2. Set Up a…
Our site uses cookies. Learn more about our use of cookies: cookie policy