What are Linux System and Networking Commands

Linux system commands are commands that can be executed in the command line interface (CLI) of a Linux operating system to perform various tasks. These tasks can range from displaying system information, manipulating files, managing processes, and configuring the system.

Some common Linux system commands include:

ls: This command is used to list the contents of a directory. For example, running ls /usr/bin will display a list of all the files and directories in the “/usr/bin” directory.

cd: This command is used to change the current working directory. For example, running cd /usr/bin will change the current directory to “/usr/bin”.

pwd: This command is used to display the current working directory. For example, running pwd will display the path of the directory you are currently in.

mkdir: This command is used to create a new directory. For example, running mkdir test will create a new directory called “test” in the current working directory.

rmdir: This command is used to remove a directory. For example, running rmdir test will remove the directory “test” if it is empty.

touch: This command is used to create a new file. For example, running touch test.txt will create a new file called “test.txt” in the current working directory.

rm: This command is used to remove a file. For example, running rm test.txt will remove the file “test.txt” from the current working directory.

ps : This command is used to display the process status of the current system. For example, running ps -ef will show you all the process status with more details like process-id, parent process-id and more.

top : This command is used to display the real-time system status with the process taking more CPU, memory usage and more details.

chmod: This command is used to change the permissions of a file or directory. For example, running chmod 755 test.txt will give read, write, and execute permissions to the owner and read and execute permissions to everyone else for the file “test.txt”.

chown: This command is used to change the owner and/or group of a file or directory. For example, running chown root:root test.txt will change the owner and group of “test.txt” to “root”.

cp: This command is used to copy files and directories. For example, running cp test.txt /tmp will copy the file “test.txt” to the “/tmp” directory.

mv: This command is used to move or rename files and directories. For example, running mv test.txt test2.txt will rename the file “test.txt” to “test2.txt”, and running mv test.txt /tmp will move the file “test.txt” to the “/tmp” directory.

find : This command is used to find files and directories according to different criteria such as name, type, size, owner and more . For example, running find / -name “test.txt” will search for the file “test.txt” from the root directory.

grep: This command is used to search for a pattern in a file or a group of files. For example, running grep “test” test.txt will search for the word “test” in the file “test.txt”.

tar : This command is used to create and extract archives of files and directories. For example, running tar -cvf archive.tar /directory will create a archive of directory, and running tar -xvf archive.tar will extract the archive.

systemctl : This command is used to control the systemd system and service manager. It can be used to start, stop, restart, enable, and disable system services, and check the status of services. For example, running systemctl status apache2 will show the current status of Apache web server.

df: This command is used to display the amount of disk space available on file systems. For example, running df -h will display the disk space usage in human-readable format (e.g., “1G” instead of “1000000000”).

du: This command is used to estimate the space used by a file or directory. For example, running du -sh /usr will show the total space used by the /usr directory in human-readable format

free: This command is used to display the amount of free and used memory in the system. For example, running free -m will display the memory usage in megabytes.

uptime: This command is used to display the system uptime (i.e., how long the system has been running since the last reboot).

passwd : This command is used to change the user password. When run without any arguments it changes the password of the current user.

ping: This command is used to check the network connectivity to a host. For example, running ping google.com will send a series of packets to the server at “google.com” and display information about the network latency

route : This command is used to display and manipulate the IP routing table. For example, running route add -net 0.0.0.0 gw 192.168.1.1 will add a default route to the IP routing table, telling the system to send all IP packets with no specific route to the gateway at IP address 192.168.1.1

ifconfig : This command is used to configure network interfaces. For example, running ifconfig eth0 will show the current configuration of the Ethernet interface “eth0”

iptables : This command is used to configure the Linux firewall. This command can be used to add, delete, or modify rules in the firewall’s rule set to filter incoming and outgoing traffic.

These are just a few examples of the many Linux system commands available. Each command has its own set of options and usage, and you can find more information about them by reading the manual pages by using man command name.

Leave a Reply