Basic Commands Flashcards
How to display Disk Utility attached disks?
diskutier list
How to restart the Finder?
killall Finder
Command to make Mac speak?
say “Hi, Terminal says hello.”
Keep Mac from falling asleep.
caffeinated
-t (number of seconds)
Print CML history to screen?
history
-c (will clear history list)
Set root password.
sudo passwd root
Log-in as super user or root?
su or sudo -s
Change directory
cd /applications
Change to another volume
cd /volumes/”Mac OS X”
spaces need quotes
Remove or delete a file
rm
Remove a file in a different directory?
rm
example: re /Applications/Candybar.app
Remove a directory or folder.
rm -d
Example: rm -d delete_me
How to copy a file?
cp
Example: cp something.txt somethingeles.txt
How to move a file?
mv
Example: mv something.txt /Applications
Find a file
locate
Example: locate text.kext
Find a binary file
whereis
Example: whereis rm
Create a folder
mkdir
Example: mkdir directory
(it will make directory in current folder)
Move a folder
mv
Example: mv folder /Applications
Repair Permissions for a folder
chmod -R 755
chmod root:wheel
Examples: chmod -R 755 /System/Library/Extensions
(repair the Extensions folder)
Repair Disk Permissions without DiskUtility
diskutil repairPermissions /
List files in a directory
ls
Print Working Directory
pwd