Linux Flashcards
(40 cards)
Find current kernel version ?
(sudo) uname -a for full, -r for just version
Find list of kernels available
(sudo) ls /boot
Install packages on the box
(sudo) apt install
Remove a file forever
shred <filename></filename>
Find your own username
whoami
Add a new user
(sudo) useradd john . Note: he has no password, so use passwd to set the password before login.
Add a new user who will not have login access
(sudo) useradd -s /sbin/nologin john OR
(sudo) useradd -s /bin/false
Open a shell as different user
su john
Get a list of all users authorized to this box
ls /etc/passwd
Change a password
passwd
Find information about a user
finger john
Find what an executable is and the path where it is located
whatis , whereis
Do an HTTP GET
wget https://… or curl 172.45.23.2
Compare see difference between files
cmp , diff
Make a file executable
chmod
Make someone owner of a file
chown
Find the IP address of current box
ip addr , ifconfig
Search using a regex expression
awk
Get the DNS configuration for the server
resolvectl status , cat /etc/resolv.conf
Determine reachability and network routing
ping -n 172.3.4.5 , traceroute
Find the open ports, ports being used by specific protocols
netstat -tulpn , ss
(Dis) Allow traffic on specific ports
iptables, ufw status/allow/enable/disable..
Find available memory
free
Find available disk space
df -H