Command line shortcuts (OSX) Flashcards
Go to the home directory
cd ~
Go up a folder level
cd ..
Read about a command
man
Print out current working directory (path / name)
pwd
Create a new directory
mkdir
Make a new empty file
touch
Copy a file
cp
Move a file
mv
Remove a file
rm
Show the contents of a file in a scrolling buffer
less
My computer’s network name
hostname
Print out everything in a directory
ls
Remove a directory
rmdir
Push directory
pushd
Pop directory
popd
Print the whole file
cat
Execute arguments
xargs
Find files
find
Find things in files
grep
Find what man page is appropriate
apropos
Look at your environment
env
Print some arguments
echo
Export/set a new environment variable
export
Exit the shell
exit
DANGER! become super user root DANGER!
sudo
Change permission modifiers
chmod
Change ownership
chown
Output from commands on the left brought to commands on the right.
$ | $
Send input from the command on the right to the command from the left
$<$
Output from command on left and write it on file to the right
$>$
Output of command on left and append to file on right
$»$
Matches anything in a wildcard
*
print all documents with a filename with a certain name
find STARTDIR -name WILDCARD -print
Fill in the rest of the word you’ve started typing
tab
Get your previous command
up
Go to the beginning of the line
Ctrl + a
Go to the end of the line
Ctrl + e
Delete everything on the line after your current character
Ctrl + k
Go to the next tab
Cmd + shift + [
Go to the previous tab
Cmd + shift + ]