You are currently viewing Top 20 Linux commands for Hackers 2023

Top 20 Linux commands for Hackers 2023

In this article we are going to explore Top 20 Linux commands for Hackers 2023.

1: The OS type

uname -o
Top 20 Linux commands for Hackers 2023

The first command, uname -o, displays the type of operating system installed on your machine.

2: CPU archit­ecture

uname -m
Top 20 Linux commands for Hackers 2023

The second command, uname -m, provides information about the CPU architecture on your system.

3: The kernel version

uname -r
Top 20 Linux commands for Hackers 2023

The third command, uname -r, tells us the kernel version running on our system.

4: The OS name, release, version

cat /etc/os-release
Top 20 Linux commands for Hackers 2023

The fourth command is cat /etc/os-release. This command provides us with the name, release, and version of the operating system.

5: The system hardware

lshw
Top 20 Linux commands for Hackers 2023

The fifth command is lshw. This command gives us complete information about the system hardware.

6: The CPU details

lscpu
Top 20 Linux commands for Hackers 2023

The sixth command is lscpu. This command provides detailed information about the CPU.

7: Check system memory

free -h or free -m
Top 20 Linux commands for Hackers 2023

The seventh command is free -h or free -m. This command allows us to check the system memory.

8: Check the virtual memory stats

vmstat -S m
Top 20 Linux commands for Hackers 2023

The eighth command is vmstat -S m. This command helps us check the statistics of virtual memory.

9: display information about currently running processes

ps all
Top 20 Linux commands for Hackers 2023

The ninth command is ps all. This command provides information about all currently running processes on the system.

10: search packages for instal­lation

apt search
For Example: apt search python­-boto
Top 20 Linux commands for Hackers 2023

For example: apt search python-boto

The tenth command demonstrates apt search. This command allows us to search for packages available for installation.

11: To installed package

sudo apt-get install
Example: sudo apt-get install mariadb-client
Top 20 Linux commands for Hackers 2023

The eleventh command is about installing packages in Linux. With the apt-get install <package name> command, you can install packages. Sometimes, sudo apt-get install command is used to install packages requiring administrative privileges.

12: Find current Directory

pwd
Top 20 Linux commands for Hackers 2023

The twelfth command helps us find the current directory. By running the pwd command, we can determine which directory we are currently in.

13: Uninstall package

sudo apt-get remove
Example: sudo apt-get remove sqlmap

The thirteenth command is sudo apt-get remove. With this command, you can uninstall or delete any package from your Linux operating system.

14: List the mounted disk drives

df -kh
Top 20 Linux commands for Hackers 2023

The fourteenth command is used to list the mounted disk drives in Linux. By running df -kh, you can easily check the mounted disk drives on your system.

15: To mount the volume

First, you need to create a directory. After creating the directory, you can mount it using the following commands:

mkdir -p
sudo mount

By executing these commands, you can mount a directory that you have created.

16: List biggest files from directory (biggest 5)

sudo du -a /etc/ | sort -n -r | head -n 5
Top 20 Linux commands for Hackers 2023

The sixteenth command helps you find the largest files in a specific directory. In this example, sudo du -a /etc/ | sort -n -r | head -n 5 retrieves the largest 5 files from the /etc/ folder.

17: Find the file

find /home/ -name "*.txt"
Top 20 Linux commands for Hackers 2023

The seventeenth command allows you to find files. For example, if you want to find all files with the .txt extension in a specific directory, you can use the find /home/ -name "*.txt" command.

18: Search the text string in a directory and print filename containing that string

grep -ril "hello" /home/masaud
Top 20 Linux commands for Hackers 2023

In the eighteenth command, we use the grep command. With grep, you can search for a specific string value or pattern in files. The command grep -ril "hello" /home/masaud searches for the string “hello” in the /home/masaud directory and prints the filenames containing that string.

19: File the text string from a given directory

grep -rIn (search text)
Top 20 Linux commands for Hackers 2023

The nineteenth command, grep -rIn novaexperience.net, allows you to search for a specific text string in files within a given directory. In this example, it fetches data containing the text “novaexperience.net” from files in the desktop directory.

20: Linux commands to display a colorful and dynamic system information dashboard

watch -n 1 "echo -e '\033[0;36mSystem Information:\033[0m'; lscpu | awk '/Model name/ {print \"\033[0;33mCPU:\033[0m\", \$3, \$4, \$5, \$6}'; free -h | awk '/Mem:/ {print \"\033[0;33mMemory Usage:\033[0m\", \$3, \"/\", \$2}'; df -h / | awk '/\// {print \"\033[0;33mDisk Usage:\033[0m\", \$3, \"/\", \$2}'; echo -e \"\033[0;33mUptime:\033[0m\" $(uptime -p)"

we have also created a beautiful web security roadmap for learners. click here and explore further.

Follow Me on Linkedin

Leave a Reply