Linux Flashcards

1
Q

Find a file by name and type

A

find -name bob -type f (or d)

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

Find any files modified in last 20 min

A

find -mmin 20

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

Find: find any files accessed in last 3 days

A

find -atime 3

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

List the user groups on the system

A

cat /etc/group

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

Add user jaalger to group tomcat

A

usermod -aG tomcat jaalger

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

How to edit the sudo file

A

visudo (As root user)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
How do you ssh into a server through a hop server, and run a command.
Assume hop is 1.2.3.4
Assume target is 10.20.30.40
Assume command is sudo ./logs
Include the sshAgent to bypass passwords
A

ssh -At 1.2.3.4 ssh -At 10.20.30.40 sudo ./logs

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

Add user to a linux system with a password

A

useradd username

passwd username

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