Company Logo


Basic Linux Commands



br>




1. File and Directory Management

CommandDescription
lsLists files and directories in the current directory.
pwdPrints the current working directory.
cdChanges the current directory.
mkdir <directory>Creates a new directory.
rm <file>Removes a file.
rm -r <directory>Removes a directory and its contents.
cp <source> <destination>Copies files or directories.
mv <source> <destination>Moves or renames files or directories.
touch <file>Creates an empty file.
find <path> -name <filename>Searches for files by name.

2. File Viewing and Editing

CommandDescription
cat <file>Displays the contents of a file.
less <file>Displays file contents one page at a time.
more <file>Displays file contents one screen at a time.
head <file>Displays the first 10 lines of a file.
tail <file>Displays the last 10 lines of a file.
nano <file>Opens a file in the nano text editor.
vi <file>Opens a file in the vi editor.

3. File Permissions

CommandDescription
chmod <permissions> <file>Changes file permissions.
chown <owner>:<group> <file>Changes file owner and group.
ls -lLists files with their permissions and ownership.

4. System Information

CommandDescription
uname -aDisplays system information.
hostnameDisplays the system's hostname.
uptimeShows how long the system has been running.
whoamiDisplays the current user.
df -hShows disk space usage.
free -hDisplays memory usage.

5. Process Management

CommandDescription
psLists running processes.
topDisplays system tasks and resource usage.
kill <PID>Terminates a process by its Process ID (PID).
killall <name>Terminates all processes by name.

6. Networking

CommandDescription
ping <host>Sends ICMP packets to test network connectivity.
ifconfigDisplays network interface information.
ip aDisplays IP addresses and interfaces.
netstat -tulnLists open ports and their listening services.
curl <URL>Fetches content from a URL.

7. Package Management (Centos/Debian/Ubuntu)

CommandDescription
yum updateUpdates the package list(Centos).
yum install <package>Installs a package(Centos).
yum remove <package>Removes a package(Centos).
apt updateUpdates the package list(Debian/Ubuntu).
apt install <package>Installs a package(Debian/Ubuntu).
apt remove <package>Remove a package(Debian/Ubuntu).

8. User Management

CommandDescription
adduser <username>Creates a new user.
passwd <username>Changes a user's password.
whoLists logged-in users.
su <username>Switches to another user account.

9. Archiving and Compression

CommandDescription
tar -cvf archive.tar <files>Archives files.
tar -xvf archive.tarExtracts an archive.
gzip <files>Compresses a file using gzip.
gunzip <file.gz>Decompresses a gzip file.

10. System Shutdown and Reboot

CommandDescription
shutdown now

OR

init 0
Shuts down the system immediately.
reboot

OR

init 6
Reboots the system.
// ______________________Desable Mouse Right Key__________________ // ______________________Desable Some keys__________________