90+ Vital Linux Commands
90+ Vital Linux Commands
4 mkdir Creates a new directory. mkdir newdir creates a directory named newdir.
Removes an empty
5 rmdir rmdir olddir removes the empty directory olddir.
directory.
in/harunseker/ 1
echo "Hello, World!" >> filename.txt
appends the phrase "Hello, World!" to the end of the
existing file named "filename.txt" (or creates the file if it
doesn't exist).
Removes files or
10 rm rm file.txt deletes file.txt.
directories.
Views file content one less file.txt displays file.txt content one screen at
12 less
screen at a time. a time.
14 nano Open the Nano text editor. nano file.txt opens file.txt in the Nano editor.
15 vim Open the Vim text editor. vim file.txt opens file.txt in the Vim editor.
in/harunseker/ 2
Displays the first part of a head -n 10 file.txt shows the first 10 lines of
16 head
file. file.txt.
Displays the last part of a tail -n 10 file.txt shows the last 10 lines of
17 tail
file. file.txt.
20 sort Sorts lines of text files. sort file.txt sorts the lines in file.txt.
Searches for files in a find /home -name "*.txt" finds all .txt files in
21 find
directory hierarchy. the /home directory.
Changes file owner and chown user:group file.txt changes the owner
23 chown
group. and group of file.txt to user and group.
A programming language
awk '{print $1}' file.txt prints the first field
25 awk for pattern scanning and
of each line in file.txt.
processing.
Process Management
Displays information about ps aux shows detailed information about all running
26 ps
active processes. processes.
in/harunseker/ 3
Displays real-time system top shows real-time processes and system resource
27 top
resource usage. usage.
An interactive process
28 htop htop provides an interactive view of system processes.
viewer.
Terminates a process by
29 kill kill 1234 terminates the process with PID 1234.
PID.
System Information
Displays system
neofetch shows system information in a visually
34 neofetch information with an
appealing format.
aesthetic layout.
Estimates file and directory du -sh /path/to/directory shows the total size
36 du
space usage. of a directory in human-readable format.
in/harunseker/ 4
Displays information about
38 lscpu lscpu
the CPU architecture.
Lists hardware
39 lshw sudo lshw
information.
Executes a command as
sudo apt-get update runs the apt-get update
42 sudo another user, typically the
command with superuser privileges.
superuser.
Adds a new user with a sudo adduser newuser interactively adds a new
45 adduser
more interactive interface. user named newuser.
Modifies user account sudo usermod -aG sudo username adds the
48 usermod
properties. user to the sudo group.
in/harunseker/ 5
sudo groupdel groupname removes the specified
50 groupdel Deletes a group
group.
Sends ICMP
ping google.com sends ping requests to
55 ping ECHO_REQUEST packets
google.com.
to network hosts.
Displays network
connections, routing netstat -tuln shows listening ports and their
56 netstat
tables, and interface status.
statistics.
in/harunseker/ 6
A versatile networking
utility for reading from and nc -l 1234 listens on port 1234.
60 nc
writing to network nc hostname 80 connects to 'hostname' on port 80.
connections.
Package Management
in/harunseker/ 7
sudo dpkg -i package.deb installs a Debian
Low-level package package.
66 dpkg manager for Debian-based
systems. sudo dpkg -r package removes an installed
Debian package
Other Commands
70 clear Clears the terminal screen. clear clears the terminal display.
in/harunseker/ 8
Compresses files into a zip zip archive.zip file1 file2 compresses file1
76 zip
archive. and file2 into archive.zip.
resolvectl Shows the current DNS resolvectl status displays the DNS configuration
78
status settings. and status.
in/harunseker/ 9
Configures wireless iwconfig wlan0 shows the configuration of the
87 iwconfig
network interfaces. wlan0 wireless interface.
Shuts down or reboots the sudo shutdown -h now shuts down the system
91 shutdown
system. immediately.
in/harunseker/ 10