Commands Flashcards

1
Q

Used to drill down to specific content

A

”|” - pipe

Ex: cat secure | grep fail
- this will search for any lines that have “fail” in them

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

Used to display last few lines of a file

A

tail “file” - this will display the last 10 lines by default. Ex: tail cron; tail secure

To change the number of lines displayed, add “-n” flag. Ex: tail -n 20 secure - will display last 20 lines of the file “secure”

Use -f flag to get realtime updates to the file displayed. Ex: tail -f secure

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

Show the current directory you are working in

A

pwd

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

Changing directories

A

cd “directory name”

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

Automatically completes the command being typed

A

Hit the Tab key

Use Tab Tab to complete a chosen command if more than one option is available

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

Go up one directory level

A

cd ..

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

Go back to home directory of current user

A

cd ~

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

Go to specific folder

A

cd “folder name”

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

List contents of a current directory

A

ls

ls / will list root directory

ls -a will list complete content if a directory, including hidden files

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

Move to beginning of the line

Move to the end of the line

A

“Ctrl” “a”

“Ctrl” “e”

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