Command line shortcuts (OSX) Flashcards
1
Q
Go to the home directory
A
cd ~
2
Q
Go up a folder level
A
cd ..
3
Q
Read about a command
A
man
4
Q
Print out current working directory (path / name)
A
pwd
5
Q
Create a new directory
A
mkdir
6
Q
Make a new empty file
A
touch
7
Q
Copy a file
A
cp
8
Q
Move a file
A
mv
9
Q
Remove a file
A
rm
10
Q
Show the contents of a file in a scrolling buffer
A
less
11
Q
My computer’s network name
A
hostname
12
Q
Print out everything in a directory
A
ls
13
Q
Remove a directory
A
rmdir
14
Q
Push directory
A
pushd
15
Q
Pop directory
A
popd
16
Q
Print the whole file
A
cat
17
Q
Execute arguments
A
xargs
18
Q
Find files
A
find
19
Q
Find things in files
A
grep
20
Q
Find what man page is appropriate
A
apropos
21
Q
Look at your environment
A
env
22
Q
Print some arguments
A
echo
23
Q
Export/set a new environment variable
A
export
24
Q
Exit the shell
A
exit
25
DANGER! become super user root DANGER!
sudo
26
Change permission modifiers
chmod
27
Change ownership
chown
28
Output from commands on the left brought to commands on the right.
$ | $
29
Send input from the command on the right to the command from the left
$<$
30
Output from command on left and write it on file to the right
$>$
31
Output of command on left and append to file on right
$>>$
32
Matches anything in a wildcard
*
33
print all documents with a filename with a certain name
find STARTDIR -name WILDCARD -print
34
Fill in the rest of the word you've started typing
tab
35
Get your previous command
up
36
Go to the beginning of the line
Ctrl + a
37
Go to the end of the line
Ctrl + e
38
Delete everything on the line after your current character
Ctrl + k
39
Go to the next tab
Cmd + shift + [
40
Go to the previous tab
Cmd + shift + ]