PE day 1 Bash Flashcards

1
Q

What is typed to clear your terminal?

A

clear…duh

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

What will give you a history of all the past commands you’ve typed in the shell?

A

history…also duh

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

what command copies files/directories?

A

cp (copy)

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

What shows your current working directory?

A

PWD (print working directory)

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

To stop a process from executing in shell what command can you run?

A

ctl + c

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

What keyboard command will do the same thing as hitting the up arrow?

A

ctl + p (as in previous)

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

What keyboard command will do the same thing as hitting the down arrow

A

ctl + n (for Next)

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

What command will allow you to simply escape out of a loop in progress?

A

break ( as in you need to break free)

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

What would you run to kill a process using a specific PID? (the command before the PID)

A

kill -9 (don’t know why, look it up, but i remember it by using a 9mm ;)

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

What is the alternate command for echo?

A

printf

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

If I wanted to display the PID of the last executed command, what variable would I echo?

A

myapp& echo

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

What command would show the last 5 lines of file1?

A

tail -5 file1

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

What command would show the first 5 lines of file1?

A

head -5 file1

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

If you wanted to find the process name from process id 8675, what command would you run?

A

ps -p 8675

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

To change a file so that it can be an executable what command do you run?

A

chmod 777

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

What command changes a directory?

A

cd (for change directory)

17
Q

hat command can you use to remove a file?

A

rm (for remove, you would then specify the file either by relative, absolute path or by filtering…careful with your wildcards)

18
Q

If you want to display the contents of file1, what command can you run?

A

Cat as in concCATenate….the commands “more” and “less” also work

19
Q

What command will show what users are currently logged in?

A

Who…as in “who is logged in right now?”

20
Q

What command will show you how long a system has been running?

A

runtime….makes sense