Ethical Hacking – 10 commands in Kali Linux – Part 2

Hi all,

Today in this series of ethical hacking we are continue to explore the commands of Kali Linux.

If you didn’t got chance to read the “Ethical Hacking – 15 commands in Kali Linux – Part 1” please have a look – https://knowledge-junction.in/2022/10/29/ethical-hacking-15-commands-in-kali-linux/

To download and install Kali Linux click here – https://knowledge-junction.in/2022/10/23/python-introduction-to-ethical-hacking-in-python-introduction-to-kali-linux-part-1/

We have started a series of Ethical Hacking so we can visit once and stay tuned to learn ethical hacking – https://knowledge-junction.in/category/ethical-hacking/

Commands in Kali Linux

  • Command to display current system information

uname -a

fig - 1 Command to display current system information
fig – 1 Command to display current system information
  • Command to display our username – users currently logged in to the current host
users

fig - 2 Command to display our username
fig – 2 Command to display our username
  • Command to know the use of certain commands
whatis command_name

fig - 3 Command to show the use of commands
fig – 3 Command to show the use of commands

  • Command to shutdown the kali Linux. It shutdowns the kali Linux in specified time.
shutdown

fig - 4 Command to shutdown the Kali Linux
fig – 4 Command to shutdown the Kali Linux
  • Command to read the contents of all txt files
cat file_name

In this txt file this is the content – knowledge_junction.txy

fig - 5 reading the content in the txt file
fig – 5 Content in the txt file – knowledge_Junction.txt

To read the content on the terminal

fig - 6 To read the content on the terminal
fig – 6 To read the content on the terminal
  • The command which searches files and prints lines that match pattern
grep [Options] [Pattern] [Filename]

We have a text file knowledge_Junction.txt file. 

grep -i <pattern> <filename>

Example : Finding “system” word in our text file

grep -i system knowledge_Junction
fig - 7 The command which searches files and prints lines that match pattern
fig – 7 The command which searches files and prints lines that match pattern

In above example “system” world is highlighted since we are finding it. Basically this highlights the pattern

  • The command which prints the first given number of lines from a file.
head -n <number> <Filename>

Example:
head -n 2 knowledge_Junction

fig - 8 The command which prints the first given number of lines from a file
fig – 8 The command which prints the first given number of lines from a file
  • The command prints the last given number of lines from a file.
tail -n <number> <Filename>

Example:
tail -n 2 knowledge_Junction

fig - 9 This command prints the last given number of lines from a file.
fig – 9 This command prints the last given number of lines from a file.
  • Command to see the manual of any command
    man command_name
    
    example:
    man rm

    fig : 10 manual of rm command
    fig : 10 manual of rm command
    • Command to change the password of Kali Linux
    passwd

    fig : 11 changing the password
    fig : 11 changing the password

    Thanks for reading 🙂

    Have a nice day!!

    You may also like...

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    %d bloggers like this: