Linux is a powerful operating system with a rich set of commands that allow you to control nearly every aspect of the system. Here is a list of over 50 Linux commands that you should know, including some of the most important ones:
File and Directory Commands
-
ls
: List files and directories. -
cd
: Change the current directory. -
pwd
: Print the current working directory. -
cp
: Copy files and directories. -
mv
: Move or rename files and directories. -
rm
: Remove files and directories. -
mkdir
: Create a directory. -
rmdir
: Remove empty directories. -
touch
: Create an empty file or update the timestamp. -
ln
: Create links (symbolic or hard).
File Viewing and Searching Commands
-
cat
: Concatenate and display files. -
less
: View files interactively, allowing you to scroll. -
more
: View files interactively, similar to less. -
head
: Display the beginning of a file. -
tail
: Display the end of a file. -
grep
: Search for patterns within files. -
find
: Search for files in a directory hierarchy. -
locate
: Quickly find files by name. -
du
: Display disk usage of files and directories.
File Manipulation Commands
-
chmod
: Change file permissions. -
chown
: Change file ownership. -
chgrp
: Change file group ownership. -
tar
: Create and extract archive files. -
gzip
: Compress files. -
gunzip
: Decompress files. -
bzip2
: Compress files with the bzip2 algorithm. -
bunzip2
: Decompress files with the bzip2 algorithm. -
zip
: Create a zip archive. -
unzip
: Extract a zip archive.
Network Commands
-
ping
: Test network connectivity. -
ifconfig
: Display or configure network interfaces. -
netstat
: Display network connections and statistics. -
traceroute
: Trace the route packets take to a network host. -
wget
: Download files from the web. -
curl
: Transfer data from or to a server. -
ssh
: Securely connect to a remote server. -
scp
: Securely copy files to or from a remote server. -
ftp
: Transfer files using the FTP protocol. -
sftp
: Securely transfer files using the SFTP protocol.
Process Management Commands
-
ps
: Display information about processes. -
top
: Display dynamic information about running processes. -
htop
: Interactive process viewer (if installed). -
kill
: Terminate processes. -
pkill
: Terminate processes by name or attribute. -
jobs
: Display a list of background jobs. -
bg
: Resume a background job. -
fg
: Bring a background job to the foreground. -
nice
: Execute a command with a modified scheduling priority. -
renice
: Change the scheduling priority of running processes.
System Management Commands
-
df
: Display disk space usage. -
free
: Display memory usage. -
uptime
: Display system uptime and load averages. -
uname
: Display system information. -
hostname
: Display or set the system's hostname. -
date
: Display or set the system date and time. -
timedatectl
: Query and change system clock and time settings. -
sudo
: Execute commands as another user (typically root). -
su
: Switch user accounts. -
useradd
: Create a new user account. -
usermod
: Modify an existing user account. -
userdel
: Delete a user account. -
groupadd
: Create a new group. -
groupdel
: Delete a group.
These commands are just the beginning of what you can do in Linux. By learning how to use them effectively, you will gain significant control over your Linux system.