0% found this document useful (0 votes)
19 views4 pages

Essential Linux Zip Commands Guide

This document provides a comprehensive list of Linux commands categorized by their functions, including file and directory management, process management, networking, user management, and more. Each command is accompanied by a brief explanation and examples of usage. It serves as a quick reference guide for users to understand and utilize various Linux commands effectively.

Uploaded by

dhrupaddutta20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Essential Linux Zip Commands Guide

This document provides a comprehensive list of Linux commands categorized by their functions, including file and directory management, process management, networking, user management, and more. Each command is accompanied by a brief explanation and examples of usage. It serves as a quick reference guide for users to understand and utilize various Linux commands effectively.

Uploaded by

dhrupaddutta20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Linux Commands with Explanations

File and Directory Management


ls: Lists files and directories in the current directory.

ls -l: Long listing format (permissions, ownership, size, modification time).

ls -a: Lists all files including hidden (.) files.

pwd: Prints the current working directory.

cd: Changes the current directory. Example: cd /home/user

mkdir: Creates a new directory. Example: mkdir new_folder

rmdir: Removes an empty directory.

rm: Removes files or directories. Example: rm [Link], rm -r dir_name

cp: Copies files or directories. Example: cp [Link] [Link]

mv: Moves or renames files or directories. Example: mv [Link] [Link]

touch: Creates a new empty file or updates timestamp.

cat: Displays the contents of a file.

more / less: Views file content page-by-page.

find: Searches for files/directories. Example: find . -name "*.txt"

File Permissions and Ownership


chmod: Changes file permissions. Example: chmod 755 [Link]

chown: Changes file owner. Example: chown user:user [Link]

chgrp: Changes group ownership. Example: chgrp developers [Link]

umask: Sets default permissions for new files/directories.

Viewing and Editing Files


nano: Opens file in Nano text editor.

vim / vi: Opens file in Vim editor.

head: Displays first lines of a file. Example: head -n 5 [Link]


tail: Displays last lines of a file. Example: tail -f [Link]

wc: Counts words, lines, and characters. Example: wc -l [Link]

Process Management
ps: Shows current processes.

top: Displays real-time system processes.

htop: Interactive process viewer (requires install).

kill: Sends signal to a process. Example: kill 1234

killall: Kills all processes with a given name. Example: killall firefox

nice / renice: Sets process priority.

Disk Usage
df: Shows disk space usage. Example: df -h

du: Shows disk usage of files/folders. Example: du -sh folder

mount: Mounts a filesystem.

umount: Unmounts a filesystem.

Networking
ping: Checks connectivity to a host. Example: ping [Link]

ifconfig / ip a: Displays IP address and network info.

netstat: Shows active network connections (deprecated, use ss).

ss: Displays socket statistics and connections.

curl: Fetches data from URL. Example: curl [Link]

wget: Downloads files from the internet.

scp: Secure copy over SSH. Example: scp [Link] user@host:/path

ssh: Secure Shell to remote machine. Example: ssh user@host

Package Management (APT)


apt update: Updates the package list.

apt upgrade: Installs available updates.


apt install package: Installs a package.

apt remove package: Removes a package.

dpkg -i [Link]: Installs a .deb package manually.

Package Management (YUM / DNF)


dnf install package: Installs a package.

dnf update: Updates all packages.

rpm -i [Link]: Installs an .rpm package.

User Management
adduser / useradd: Adds a new user.

passwd: Changes user password.

deluser / userdel: Deletes a user.

groupadd: Creates a new group.

usermod: Modifies a user. Example: usermod -aG sudo user

System Information
uname -a: Shows kernel and system info.

uptime: Shows how long the system has been running.

hostname: Displays system hostname.

free -h: Displays memory usage.

lscpu: Displays CPU architecture info.

lsblk: Lists block devices.

dmesg: Kernel ring buffer messages (boot log).

Archiving and Compression


tar -cvf [Link] file: Create a tar archive.

tar -xvf [Link]: Extract tar archive.

tar -czvf [Link] folder: Create gzip-compressed tar archive.

gzip file: Compress file using gzip.


gunzip [Link]: Decompress a gzip file.

zip [Link] file1: Create zip file.

unzip [Link]: Extract zip file.

Search and Text Processing


grep "text" file: Searches for text in file.

awk '{print $1}' file: Pattern scanning and processing.

sed 's/old/new/' file: Stream editor (substitute text).

cut -d':' -f1 /etc/passwd: Cuts sections of text.

sort: Sorts lines of text.

uniq: Removes duplicate lines.

diff file1 file2: Shows difference between files.

Other Useful Commands


history: Shows command history.

alias: Creates shortcut for commands. Example: alias ll='ls -l'

echo: Displays message.

date: Displays or sets date and time.

cal: Displays calendar.

man command: Shows manual page of command.

whoami: Displays current user.

sudo: Executes command with superuser privileges.

You might also like