LINUX COMMANDS Flashcards
LS
lists files and folders in a directory
GREP
SEARCHES TEXT FILES OR COMMAND OUTPUT
EX: Use grep on “access.log” to find the flag that has a prefix of “THM”. What is the flag?
tryhackme@linux1:~$ grep “THM” access.log
13.127.130.212 - - [04/May/2021:08:35:26 +0000] “GET THM{ACCESS} lang=en HTTP/
1.1” 404 360 “-“ “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36”
CD
cd command in linux known as change directory command. It is used to change current working directory.
SHUTDOWN
BRINGS DOWN SYSTEM
PWD
This stands for Print Working Directory
DISPLAYS FULL PATH OR WORKING DIRECTORY
EX: /HOME/MARK
PASSWD
UPDATES CURRENT USER’S PASSWORD
MV
MOVES OR RENAMES FILES
CP
COPY FILES
RM
PERMANENTLY DELETES FILES
You can simply remove files by using rm. However, you need to provide the -R switch alongside the name of the directory you wish to remove.
ex:
tryhackme@linux2:~$ rm note
tryhackme@linux2:~$ ls
folder1 mydirectory
using -R switch:
tryhackme@linux2:~$ rm -R mydirectory
tryhackme@linux2:~$ ls
folder1
CHMOD
CHANGES PERMISSIONS FOR SPECIFIED FILES
CHOWN
CHANGES OWNERSHIP
IWCONFIG
DISPLAYS AND CONFIGURES WIRELESS NETWORK SETTINGS
IFCONFIG
DISPLAYS AND CONFIGURES NETWORK SETTINGS
PS
LISTS PROCESSES
SU
SWITCHES USER TO SPECIFIED USER ACCOUNT