Kali Linux Commands Flashcards
What does ‘echo’ do ?
Output any text that we provide
What command outputs any text that we provide ?
echo
what does ‘whoami’ do ?
Find out what user we’re currently logged in as!
What command lets us know what user we are currently logged in as ?
whoami
What does ‘ls’ do ?
listing
What is the command for listing ?
ls
what does ‘cd’ do ?
change directory
What is the command to change directory ?
cd
What does ‘cat’ do ?
concatenate
What is the command to concatenate ?
cat
What is the command to print the working directory ?
pwd
What does ‘pwd’ do ?
Print Working Directory
How can you list the contents of a directory without having to navigate to it
‘ls’ and the name of the directory
e.g ‘ls my documents’
What does the concatenate command do ?
Output the content of a file. Not just the text files
Command to go back to previous directory
cd -
What does ‘cd -‘ do ?
go back to previous directory
If we remember the filename, what command can we use so that the command will look through every folder in our current directory for that specific file.
‘find -name’ and the name of the file
e.g ‘find -name password.txt’
what character is the wildcard ?
*
What command can we run to find the name of every .txt file ?
find -name *.txt
What does ‘grep’ do ?
Allows us to search the contents of files for specific values that we are looking for.
What command allows us to search the contents of files for specific values that we are looking for ?
grep
What command would you run to use grep on “access.log” to find the flag that has a prefix of “THM”. What is the flag?
grep THM access.log
This operator allows you to run commands in the background of your terminal.
&
What does the & operator do ?
Allows you to run commands in the background of your terminal.
This operator allows you to combine multiple commands together in one line of your terminal.
&&
What does the ‘&&’ operator do ?
Allows you to combine multiple commands together in one line of your terminal.
This operator is a redirector - meaning that we can take the output from a command (such as using cat to output a file) and direct it elsewhere.
>
What does the ‘>’ operator do ?
This operator is a redirector - meaning that we can take the output from a command (such as using cat to output a file) and direct it elsewhere.
This operator does the same function of the > operator but appends the output rather than replacing (meaning nothing is overwritten).
> >
What does the ‘»’ operator do ?
This operator does the same function of the > operator but appends the output rather than replacing (meaning nothing is overwritten).
What command could we run to create a file named “welcome” with the message “hey”.
echo hey > welcome
What command could we run to add ‘hello’ to the end of our file called ‘welcome’
echo hello»_space; welcome
What is the command to log in remotely using SSH ?
‘ssh’ and the username of the account @the ip address of the the machine.
ssh tryhackme@10.10.97.49
What command will list all files including those ones that might be hidden ?
ls –all
What does ‘ls –all’ do ?
Lists all files, even those that might be hidden
What is the switch to bring up the options for each command ?
–help
e.g ‘ls –help’
what is the command to access the documentation on the manual page ?
man plus the command we want to see the manual for
man ls
What flag would we use to display the output in a “human-readable” way?
ls -h
What does “touch” do ?
create a file
What does “mkdir” do ?
Create a folder
Make a Directory.
What does “cp” do ?
Copy a file or folder
What does “mv” do ?
Move a File or Folder
What does “rm” do ?
Remove a file or folder ?
What does “file” do ?
Determine the type of a file.
What tag do we need to add to “rm” to remove a directory ?
-R