Linux Flashcards
1
Q
Find a file by name and type
A
find -name bob -type f (or d)
2
Q
Find any files modified in last 20 min
A
find -mmin 20
3
Q
Find: find any files accessed in last 3 days
A
find -atime 3
4
Q
List the user groups on the system
A
cat /etc/group
5
Q
Add user jaalger to group tomcat
A
usermod -aG tomcat jaalger
6
Q
How to edit the sudo file
A
visudo (As root user)
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
8
Q
Add user to a linux system with a password
A
useradd username
passwd username