0% found this document useful (0 votes)
10 views

Basic+Linux+Commands

Uploaded by

Shreyas S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Basic+Linux+Commands

Uploaded by

Shreyas S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

https://Neamatullah.

com Neamatullah Ekhteyari

Welcome to The Ultimate Ethical Hacking Master Class!

Dear students,

We're thrilled to have you on board for what promises to be an


exhilarating journey into the world of ethical hacking. In this
master class, we'll delve deep into the art and science of
ethical hacking, exploring the tools, techniques, and principles
that empower security professionals to protect digital
landscapes.

Before we dive into the exciting realms of ethical hacking, let's


ensure you have a solid foundation in Linux/Unix command line
operations. We understand that mastering the command line is
fundamental to navigating the vast landscapes of cybersecurity.
To assist you on this journey, we've prepared a comprehensive
cheat sheet covering essential Linux commands, file permissions,
environment variables, user management, networking, process
handling, and VI editing commands.

Linux/Unix Command Line Cheat Sheet:

1. Basic Linux Commands: Navigate through the Linux environment


with ease.
2. File Permission Commands: Control access to files and
directories.
3. Environment Variables Command: Understand and manipulate
environment variables.
4. User Management Commands: Learn to manage users effectively.
5. Networking Commands: Explore commands for network configuration
and diagnostics.
6. Process Commands: Master the art of managing processes.
7. VI Editing Commands: Navigate and edit text efficiently with the
VI editor.

This cheat sheet will be your companion as you develop the


foundational skills required for ethical hacking. Feel free to
refer to it whenever you need a quick reference or a helping
hand in the Linux command line.

Now, without further ado, let's embark on this incredible journey


together. Get ready to uncover the secrets of ethical hacking,
and remember – in the world of cybersecurity, knowledge is power.
https://Neamatullah.com Neamatullah Ekhteyari

Best of luck, and happy hacking!

The Ultimate Ethical Hacking Master Class Team:

https://www.udemy.com/course/the-ultimate-ethical-hacking-
masterclass/?referralCode=04396DED9904CEE40EC9

Basic Linux Commands


Command Description
Lists all files and
ls directories in the present
working directory
Lists files in sub-directories
ls -R
as well
ls -a Lists hidden files as well
Lists files and directories
ls -al with detailed information like
permissions,size, owner, etc.
cd or cd ~ Navigate to HOME directory
cd .. Move one level up
To change to a particular
cd
directory
cd / Move to the root directory
cat > filename Creates a new file
https://Neamatullah.com Neamatullah Ekhteyari

cat filename Displays the file content


Joins two files (file1, file2)
cat file1 file2 > file3 and stores the output in a new
file (file3)
Moves the files to the new
mv file "new file path"
location
Renames the file to a new
mv filename new_file_name
filename
Allows regular users to run
programs with the security
sudo
privileges of the superuser or
root
rm filename Deletes a file
Gives help information on a
man
command
Gives a list of all past
history commands typed in the current
terminal session
clear Clears the terminal
Creates a new directory in the
mkdir directoryname present working directory or a
at the specified path
rmdir Deletes a directory
https://Neamatullah.com Neamatullah Ekhteyari

mv Renames a directory
Divides the file into x
pr -x
columns
pr -h Assigns a header to the file
Denotes the file with Line
pr -n
Numbers
lp -nc , lpr c Prints “c” copies of the File
lp-d lp-P Specifies name of the printer
Command used to install and
apt-get
update packages
mail -s 'subject'
-c 'cc-address'
Command to send email
-b 'bcc-address'
'to-address'
mail -s "Subject" Command to send email with
to-address < Filename attachment
Command Description
Lists all files and
ls directories in the present
working directory
Lists files in sub-directories
ls -R
as well
ls -a Lists hidden files as well
https://Neamatullah.com Neamatullah Ekhteyari

Lists files and directories


ls -al with detailed information like
permissions,size, owner, etc.
cd or cd ~ Navigate to HOME directory
cd .. Move one level up
To change to a particular
cd
directory
cd / Move to the root directory
cat > filename Creates a new file
cat filename Displays the file content
Joins two files (file1, file2)
cat file1 file2 > file3 and stores the output in a new
file (file3)
Moves the files to the new
mv file "new file path"
location
Renames the file to a new
mv filename new_file_name
filename
Allows regular users to run
programs with the security
sudo
privileges of the superuser or
root
rm filename Deletes a file
https://Neamatullah.com Neamatullah Ekhteyari

Gives help information on a


man
command
Gives a list of all past
history commands typed in the current
terminal session
clear Clears the terminal
Creates a new directory in the
mkdir directoryname present working directory or a
at the specified path
rmdir Deletes a directory
mv Renames a directory
Divides the file into x
pr -x
columns
pr -h Assigns a header to the file
Denotes the file with Line
pr -n
Numbers
lp -nc , lpr c Prints “c” copies of the File
lp-d lp-P Specifies name of the printer
Command used to install and
apt-get
update packages
mail -s 'subject'
-c 'cc-address'
Command to send email
-b 'bcc-address'
'to-address'
https://Neamatullah.com Neamatullah Ekhteyari

mail -s "Subject" Command to send email with


to-address < Filename attachment
cd / Move to the root directory
File permission commands
Command Description
to show file type and access
ls -l
permission
r read permission
w write permission
x execute permission
-= no permission
For changing the ownership of
Chown user
a file/directory
change the user as well as
Chown user:group filename
group for a file or directory
Command Description
to show file type and access
ls -l
permission
r read permission
w write permission
x execute permission
-= no permission
https://Neamatullah.com Neamatullah Ekhteyari

For changing the ownership of


Chown user
a file/directory
change the user as well as
Chown user:group filename
group for a file or directory
Environment Variables command

Command Description
echo $VARIABLE To display value of a variable
Displays all environment
env
variables
VARIABLE_NAME=
Create a new variable
variable_value
Unset Remove a variable
To set value of an environment
export Variable=value
variable
User management commands of linux

Command Description
sudo adduser username To add a new user
To change the password of a
sudo passwd -l 'username'
user
sudo userdel -r
To remove a newly created user
'username'
https://Neamatullah.com Neamatullah Ekhteyari

sudo usermod -a -G
To add a user to a group
GROUPNAME USERNAME
sudo deluser USER
To remove a user from a group
GROUPNAME
Shows information of all the
finger
users logged in
Gives information of a
finger username
particular user
Networking command

Command Description
SSH username@ip-address login into a remote Linux
or hostname machine using SSH
To ping and Analyzing network
Ping hostname="" or =""
and host connections
Display files in the current
dir
directory of a remote computer
change directory to “dirname”
cd "dirname"
on a remote computer
upload ‘file’ from local to
put file
remote computer
Download ‘file’ from remote to
get file
local computer
https://Neamatullah.com Neamatullah Ekhteyari

quit Logout
Process command

Command Description
To send a process to the
bg
background
To run a stopped process in
fg
the foreground
Details on all Active
top
Processes
Give the status of processes
ps
running for a user
Gives the status of a
ps PID
particular process
Gives the Process ID (PID) of
pidof
a process
kill PID Kills a process
Starts a process with a given
nice
priority
Changes priority of an already
renice
running process
Gives free hard disk space on
df
your system
https://Neamatullah.com Neamatullah Ekhteyari

Vi editing commands
Command Description
Insert at cursor (goes into
i
insert mode)
Write after cursor (goes into
a
insert mode)
Write at the end of line (goes
A
into insert mode)
ESC Terminate insert mode
u Undo last change
Undo all changes to the entire
U
line
Open a new line (goes into
o
insert mode)
dd Delete line
3dd Delete 3 lines
Delete contents of line after
D
the cursor
Delete contents of a line
after the cursor and insert
C
new text. Press ESC key to end
insertion.
dw Delete word
https://Neamatullah.com Neamatullah Ekhteyari

4dw Delete 4 words


cw Change word
x Delete character at the cursor
r Replace character
Overwrite characters from
R
cursor onward
Substitute one character under
s
cursor continue to insert
Substitute entire line and
S begin to insert at the
beginning of the line
Change case of individual
~
character

Thanks for being so active in course!

The ultimate ethical hacking master class course link:

https://www.udemy.com/course/the-ultimate-ethical-hacking-
masterclass/?referralCode=04396DED9904CEE40EC9

the complete python BootCamp + 100 real-world application:

https://www.udemy.com/course/python-project-
masterclass/?referralCode=0DBF917BCBA6F262B7D7

the complete python automation:

https://www.udemy.com/course/mastering-python-automation-for-every-
day-life/?referralCode=C9492B65364B02709639
https://Neamatullah.com Neamatullah Ekhteyari

You might also like