Hey There, I'm Sourya from India and Creative World is my website, I provide services on Music production, Graphics & Web Design, UI/UX, Tshirt design, Illustration, Photography, Hardware Networking, Cyber security, Ethical Hacking, Website Vulnerability analysis, SEO, Digital Marketing, Paid ad campaign Management, also provide Tutorials and coaching on various topics, Also I'm a certified Yoga trainer and Calisthenics Instructor. B.Tech in CSE and BFA in fine art. And a freelancer.
In the previous chapter, we learned about some Linux commands which are mostly used as shortcuts. But in this chapter, we will discuss some Linux commands which are terminal based. There are so many apart from these which we will discuss during the next chapters. But these are the commonly used and most important ones.
sudo:- superuser is the most important Linux command used to get superuser(System Admin) permission.
apt-get:- used to install/ update/ upgrade/ remove any software package or the entire operating system. The most powerful command for front-end package manager for Linux.
pwd :- Used to display the current working directory
cp:- used to copy a file
chmod:- used to change the mode of a file system
cat:- used to concatenate files and view the result in terminal
echo:- used to display a text or a string as an output.
clear:- used to clear the terminal screen
mkdir:- This command used to create a new directory under any directory
rmdir:- Used to delete a directory.
ls:- This command is used to display a list of content of a directory.
log:- used to check the log
cd:- Used to change the current directory.
history:- used to see the previously used command by a user
grep:- used to find text in a file
reboot:- used to reboot the system.
touch:- used to make a blank new file.
locate:- used to locate a file
df:- used to check the system disk space usage.
head:- used to check the first line of any text file
tail:- used to check the last line of any text file.
chown:- used to change the ownership of a file.
jobs:- used to check the currently running jobs with their statuses.
kill:- used to terminate any program manually.
ping:- used to check your internet connectivity status.
ifconfig:- used to check your internet configuration along with your IP and other info. It's a very useful and most important command.
zip/unzip:- used to compress/ decompress (zip/unzip) a file
-a:- show all including hidden
-R:- Recursive list
-r:- reverse order
-t:- sort by last modified
-S:- sort by file size
-l:- long listing format
-1:- One file per line
-m:- comma-separated output
-Q:- Quoted output
Used to count words
wc -c : Displays the count of bytes in a file.
wc -l : Prints the number of lines in a file.
wc -L : prints only the length of the longest line in a file.
wc -m : prints the count of characters from a file.
wc -w : prints the number of words in a file.
Ethical Hacking For Beginners (Chapter-4)
Linux Commands(Part-1)
In Ethical Hacking Linux (Kali Linux) is being considered as the most used OS by attackers and cyber security professionals. And The biggest reason is:-
1. It is Open source (In most of the cases you don't have to spend money to buy this OS and most of its applications also you can get free updates as this is open-source. Bugs are being patched as soon as they are spotted because
there is not a specific group of developers who work as Linux developers,
everyone who has knowledge of Linux development can be developer and as soon
as they find any bug they report it and fix it asap. So a wide range of people
work here so finding an unpatched bug here is not easy here, and that's why
it's considered the most secure/ safest OS as well.
2. Reason 2 is highly customizable, as it is open source it allows the user to
see its source code and let them change as per their requirement. Also, most
of its applications don’t want root-level permission. So, there is no such
security concern here to install any unknown application. And most importantly
it’s most of the applications are CLI-based, meaning it shows its user what's
going on behind the screen. So the user can see it and if they find anything
unusual they can act accordingly.
3. Another reason is its virus-proof. Now, virus-proof doesn't mean that it's
not affected virus or Linux virus does not exist. It means It’s not affected
by viruses, not as much as windows get. Because executable files do not exist
for Linux(.exe) they treat exe as a text file(until you don’t use wine). So if
someone tries to hide a payload in an exe and wait for the victim to double
click it, in a Linux environment it will not gonna work out. In simple terms
most of its application comes as package installer(.tar.gz) or Debian
package(.deb). And user can easily check its permission and in most of the
cases its install through the terminal(Similar to command prompt) so the user
can track each and every step that what's going on behind the screen and if it
needs root permission it also inform the user that it needs root permission,
by default it does not takes root always We will deep dive into this later on
the Linux chapter.
4. And the reason behind Linux virus-proof is Most of the Linux users are
computer experts, so they never randomly double click on any unknown file to
blow up their pc without knowing what's gonna happen with that file!
So, Linux is not such a complicated OS or you shouldn't have to be a computer
expert to use Linux. Anyone can use Linux these days. Because most of its
applications are getting user-friendly day by day and getting GUI-based. But
you need to know some basic or essential Linux commands to operate it
smoothly.
In Ethical hacking, we use Kali Linux which is also a Linux Distribution. But
its made for security professionals because it comes with in-built so many
useful penetration testing tool and some more modification which comes handy
while penetration testing.
Here are some Useful Linux Keyboard shortcuts:-
Basic editing
Ctrl+X -Cut line (empty selection)
Ctrl+C -Copy line (empty selection) Alt+ ↓ / ↑ Move line down/up
Ctrl+Shift+K -Delete line
Ctrl+Enter / Ctrl+Shift+Enter -Insert line below/ above
Ctrl+Shift+\ -Jump to matching bracket
Ctrl+] / Ctrl+[ -Indent/Outdent line Home / End Go to beginning/end of line
Ctrl+ Home / -End Go to beginning/end of file
Ctrl+ ↑ / ↓ -Scroll line up/down Alt+ PgUp / PgDn Scroll page up/down
Ctrl+Shift+ [ / ] -Fold/unfold region
Ctrl+K Ctrl+ [ / ] -Fold/unfold all subregions
Ctrl+K Ctrl+0 / Ctrl+K Ctrl+J -Fold/Unfold all regions
Ctrl+K Ctrl+C -Add line comment
Ctrl+K Ctrl+U -Remove line comment
Ctrl+/ -Toggle line comment
Ctrl+Shift+A -Toggle block comment
Alt+Z -Toggle word wrap
File management
Ctrl+N -New File
Ctrl+O -Open File...
Ctrl+S -Save
Ctrl+Shift+S -Save As...
Ctrl+W -Close
Ctrl+K Ctrl+W -Close All
Ctrl+Shift+T -Reopen closed editor
Ctrl+K -Enter Keep preview mode editor open
Ctrl+Tab -Open next
Ctrl+Shift+Tab -Open previous
Ctrl+K P -Copy path of active file
Ctrl+K R -Reveal active file in Explorer
Ctrl+K O -Show active file in new window/instance
Debug
F9 -Toggle breakpoint
F5 -Start / Continue
F11 / Shift+F11 -Step into/out
F10 -Step over
Shift+F5 -Stop
Ctrl+K Ctrl+I -Show hover