Terminal Commands Flashcards

(113 cards)

1
Q

Ctrl + A

A

Go to the beginning of the line you’re currently typing on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Ctrl + E

A

Go to the end of the line you’re currently typing on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Ctrl + U

A

Clear the line before the cursor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Ctrl + K

A

Clear the line after the cursor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Ctrl + W

A

Delete the word before the cursor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Ctrl + T

A

Swap the last two characters before the cursor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Esc + T

A

Swap the last two words before the cursor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Ctrl + L

A

Clear the screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Ctrl + C

A

Kill whatever you’re running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Ctrl + D

A

Exit the current shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Option + →

A

Move cursor one word forward

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Option + ←

A

Move cursor one word backward

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Ctrl + F

A

Move cursor one character forward

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Ctrl + B

A

Move cursor one character backward

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Ctrl + Y

A

Paste whatever was cut by the last command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Ctrl + Z

A

Puts whatever you’re running into a suspended background process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Ctrl + _

A

Undo the last command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

/ (Forward Slash)

A

Top level directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

. (Single Period)

A

Current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

.. (Double Period)

A

Parent directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

~ (Tilde)

A

Home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

sudo [command]

A

Run command with the security privileges of the super user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

nano [file]

A

Opens the Terminal editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

open [file]

A

Opens a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
[command] -h
Get help about a command
26
man [command]
Show the help manual of the command
27
cd
Home directory
28
cd [folder]
Change directory, e.g. cd Documents
29
cd ~
Home directory
30
cd/
Root of the drive
31
cd -
Previous directory or folder you last browsed
32
pwd
Show your working directory
33
cd..
Move up to the parent directory
34
ls
Display the name of files and subdirectories in the directory
35
ls -C
Force multi-column output of the listing
36
ls -a
List all entries including those with .(period) and ..(double period)
37
ls -1
Output the list of files in one entry per line format
38
ls -F
39
ls -S
Sort files or entries by size
40
ls -l
List in a long format. Includes file mode, owner and group name, date and time file was modified, pathname, and more
41
ls -lt
List the files sorted by time modified (most recent first)
42
ls -lh
Long listing with human readable file sizes in KB, MB, or GB
43
ls -lo
List the file names with size, owner, and flags
44
ls -la
List detailed directory contents, including hidden files
45
du
List usage for each subdirectory and its contents
46
du -sh [folder]
Human readable output of all files in a directory
47
du -s
Display an entry for each specified file
48
du -sk\* | sort -nr
List files and folders, totaling the size including the subfolders. Replace sk\* with sm\* to list directories in MB
49
df -h
Calculate your system's free disk space
50
df -H
Calculate free disk space in powers of 1,000 (as opposed to 1,024)
51
mkdir
Create new folder named
52
mkdir -p /
53
mkdir
Create several folders at once
54
mkdir " "
Create a folder with a space in the filename
55
rmdir
Delete a folder (only works on empty folders)
56
rm -R
Delete a folder and its contents
57
touch
Create a new file without any extension
58
cp
Copy a file to the folder
59
cp
Copy a file to the current folder
60
cp ~//
Copy a file to the folder and rename the copied file
61
cp -R <"new dir">
Copy a folder to a new folder with spaces in the filename
62
cp -i
Prompts you before copying a file with a warning overwrite message
63
cp /Users/
Copy multiple files to a folder
64
rm
Delete a file (This deletes the file permanently; use with caution.)
65
rm -i
Delete a file only when you give confirmation
66
rm -f
Force removal without confirmation
67
rm
Delete multiple files without any confirmation
68
mv
Move/rename
69
mv
Move a file to the folder, possibly by overwriting an existing file
70
mv -i
Optional -i flag to warn you before overwriting the file
71
mv \*.png ~/
Move all PNG files from current folder to a different folder
72
Ctrl + R
Search through previously used commands
73
history n
Shows the previous commands you've typed. Add a number to limit to the last n items
74
![value]
Execute the last command typed that starts with a value
75
!!
Execute the last command typed
76
ls -ld
Display the default permission for a home directory
77
ls -ld/
Display the read, write, and access permission of a particular folder
78
chmod 755
Change the permission of a file to 755
79
chmod -R 600
Change the permission of a folder (and its contents) to 600
80
chown :
Change the ownership of a file to user and group. Add -R to include folder contents
81
ps -ax
Output currently running processes. Here, a shows processes from all users and x shows processes that are not connected with the Terminal
82
ps -aux
Shows all the processes with %cpu, %mem, page in, PID, and command
83
top
Display live information about currently running processes
84
top -ocpu -s 5
Display processes sorted by CPU usage, updating every 5 seconds
85
top -o rsize
Sort top by memory usage
86
kill PID
Quit process with ID . You'll see PID as a column in the Activity Monitor
87
ps -ax | grep
Find a process by name or PID
88
ping
Ping host and display status
89
whois
Output whois info for a domain
90
curl -O
Download file via HTTP, HTTPS, or FTP
91
ssh @
Establish SSH connection to with user
92
scp @:/remote/path
Copy to a remote
93
brew doctor
Check brew for potential problems
94
brew install
Install a formula
95
brew uninstall
Uninstall a formula
96
brew list
List all the installed formulas
97
brew search
Display available formulas for brewing
98
brew upgrade
Upgrade all outdated and unpinned brews
99
brew update
Fetch latest version of homebrew and formula
100
brew cleanup
Remove older version of installed formula
101
brew tap homebrew/cask
Tap the cask repository from GitHub
102
brew cask list
List all installed casks
103
brew cask install
Install the given cask
104
brew cask uninstall
Uninstall the given cask
105
find -name <"file">
Find all files named inside . Use wildcards (*) to search for parts of filenames
106
grep ""
Output all occurrences of inside (add -i for case insensitivity)
107
grep -rl ""
Search for all files containing inside
108
cat
Output the content of
109
less
Output the contents of using the less command that supports pagination and more
110
head
Output the first 10 lines of
111
> >
Appends the output of to
112
>
Direct the output of into
113
cd ../../
Move 2 levels up