Mastering Linux Command For Cyber Security by Cybersec Sentinel Medium
Mastering Linux Command For Cyber Security by Cybersec Sentinel Medium
ethical hacking, managing and automating complex operations and security tasks.
SECURITY
CyberSec Sentinel · Follow
7 min read · Jun 25, 2024
Listen Share
➔ pwd : Prints the current working directory, showing you where you are in the file
system.
✯Linux has cemented its place as an essential tool for cyber security professionals ➔ls -l command option lets you print out detailed information about the directory
with its customizable and secure operating system management. It also helps in contents in a columnar format that includes size, modified date and time, file or
managing and securing servers, networks, and devices. directory name, owner of the file, and its permission.
✯Linux offers various tools and methods to identify and mitigate security risks.
Some of the useful tools are encryption, firewalls, and intrusion detection systems.
Open in app Sign up Sign in
Search
➔ chown - Change Ownership: Change the owner and group of a file or directory.
Example: chown user:group file.txt
User Management:
Adding Users:
➔ useradd : Adds a new user account to the system. Syntax: useradd username .
Deleting Users: ➔ touch : Creates a new empty file or updates the timestamp of an existing file. For
example, touch my_file.txt create a new text file named "my_file.txt."
➔ userdel : Deletes a user account from the system. Syntax: userdel username .
➔ finger : Provides detailed user information, including login name, real name,
terminal, and more. Syntax: finger username .
System Information:
Displaying Basic System Information: ➔ lspci : Shows information about PCI buses and connected devices.
➔ lscpu : Provides information about the CPU architecture and processor details.
➔ lsblk : Lists block devices, such as hard drives and partitions, along with their
mount points.
➔ free : Displays the amount of free and used memory in the system, including
total, used, and free memory, as well as buffers and cache.
➔ vmstat : Reports information about processes, memory, paging, block IO, traps,
and CPU activity.
Process Management:
Viewing Processes:
for a detailed list of all processes and -ef for a full listing of processes.
➔ pgrep : Searches for processes based on name or other attributes and prints their
process IDs.
➔ top : Provides a dynamic real-time view of system processes, CPU usage, and
memory usage. ➔ pstree : Displays a tree diagram of processes, showing their hierarchical
relationship.
➔ xkill : A graphical utility that allows users to kill a window or process by clicking ➔ awk : A versatile text processing tool that operates on lines of input and can
on it. perform actions based on patterns.
Background and Foreground Processes: ➔ sed : A stream editor used to perform text transformations on an input stream. It's
often used for search and replace operations.
➔ bg : Puts a stopped or backgrounded process into the background.
➔ tar : Archives files into a single file (often called a "tarball") and optionally
➔ fg : Brings a backgrounded process to the foreground. compresses them.
➔ jobs : Lists active jobs (background processes) associated with the current shell. ➔ gzip : Compresses files using the gzip compression algorithm. It replaces the
original file with a compressed version.
Process Priority and Control:
➔ zip : Compresses files into a zip archive, which can include multiple files and
➔ nice : Launches a process with a specified priority level.
directories.
➔ renice : Changes the priority of an existing process.
CONCLUSION
➔ ionice : Sets the I/O scheduling priority for a process.
In summary, Linux commands are essential in cybersecurity for managing system
Monitoring and Debugging: security, monitoring networks, and responding to threats.Mastery of these commands
enables security professionals to effectively manage and secure Linux systems, detect
➔ strace : Traces system calls and signals made by a process, helpful for debugging. and respond to potential threats, and maintain robust security postures. Mastering
these commands is crucial for effective cybersecurity defense.
➔ lsof : Lists open files and the processes that opened them, useful for
troubleshooting. If you found this guide helpful, then do click on 👏 the button. Follow for more
Learning like this 😎
➔ pidof : Returns the process ID of a running program.
Cybersecurity Linux Commands Ubuntu Linux Command Line
➔ pgrep : Searches for processes based on name and other attributes and prints
their process IDs. Basic Linux Commands
File Management:
➔ find : Searches for files and directories in a directory hierarchy based on various
criteria such as name, size, or permissions.