Zero to Hero Flashcards
List out all files in a directory that aren’t all shown in standard ls
ls -la
Copies file into new directory
cp new.txt Desktop/new.txt
move file into new directory
mv new.txt Desktop/new.txt
locate a file
updatedb (to update the command)
locate new.txt
What does this mean?
-rw-r–r–
File owner: read and write
Group Owner: read
All other permissions: read
What does {chmod +x new.txt} do?
It gives all user levels executable permission
-rw-r–r–
—>
-rwxr-xr-x
How can I add a user
adduser bob
how to see all users on the machine?
cat /etc/passwd/
How to see the hash for each user
cat /etc/shadow/
How can I switch users on the machine at the CLI?
su bob
How can I switch back to root user?
su -
How to view recent activity via CLI
cat auth.log
How can I print out my information
ifconfig
How can I limit a ping to 1 packet
ping -c 1 {IP address}
what does arp -a do?
It associates IP addresses with MAC addresses
What does netstat -ano do?
Shows you all the ports that are open and what is connected to those ports
What does route do?
??
How do you check the history of all commands you have run?
history
How can you check the previous times you have run the ping command?
history | grep ping
How would you write the following text “hello world” into a new file named newFile.txt?
echo “hello world” > newFile.txt
How can you add more text to a file without overwriting the existing text?
echo “hello world again”»_space; newFile.txt
what does the {touch} command do?
Allows you to create a new file i.e. touch hello.txt
How could you get rid of a program i.e. impacket?
apt purge impacket
How could you find your IP address?
ifconfig