[go: up one dir, main page]

0% found this document useful (0 votes)
230 views5 pages

4.1-Essential Linux Commands

le fichier contient la formation du système d'exploitation linux

Uploaded by

Chega Kitubanza
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)
230 views5 pages

4.1-Essential Linux Commands

le fichier contient la formation du système d'exploitation linux

Uploaded by

Chega Kitubanza
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
You are on page 1/ 5

Nov-2024

Explaining the basic commands of Linux.

in a Linux operating system, the shell is a command-line interface (CLI) that allows users

to interact with the system. It interprets and executes commands entered by the user,

translating them into actions by communicating with the kernel.


Essential Linux commands like ls, cd, cp, mv, and rm help us manage files, navigate

directories, and control system processes directly from the command line. We use the

command line because it offers powerful control, speed, and flexibility for managing tasks,

especially when working with multiple files or configuring a system efficiently.

Summary of Linux basic commands


Basic File and Directory Management

• ls - List directory contents


• cd - Change directory
• pwd - Print working directory
• cp - Copy files or directories
• mv - Move or rename files or directories
• rm - Remove files or directories
• mkdir - Create a new directory
• rmdir - Remove an empty directory
• touch - Create an empty file or update a file’s timestamp
• cat - Concatenate and display file contents
• less - View file contents one screen at a time
• head - Display the first few lines of a file
• tail - Display the last few lines of a file
• find - Search for files and directories in a directory hierarchy
• locate - Find files by name
• which - Locate a command's executable file

File Permissions and Ownership

• chmod - Change file permissions


• chown - Change file ownership
• chgrp - Change group ownership of a file or directory
• umask - Set default file creation permissions

System Information and Monitoring

• uname - Display system information


• df - Display disk space usage
• du - Show disk usage of files and directories
• free - Display memory usage
• top - Display real-time system processes
• htop - Interactive process viewer
• ps - Display running processes
• uptime - Show how long the system has been running
• who - Show who is logged in
• dmesg - Display kernel ring buffer messages
• vmstat - Report virtual memory statistics

Networking Commands

• ping - Test network connectivity to a server


• ifconfig - Configure or display network interfaces
• ip - Show/manipulate routing, devices, policy routing, and tunnels
• netstat - Display network connections, routing tables, etc.
• nslookup - Query Internet domain name servers
• traceroute - Trace the route packets take to a network host
• curl - Transfer data from or to a server
• wget - Retrieve files from the web

Text Processing and Searching

• grep - Search for patterns in files


• awk - Pattern scanning and processing language
• sed - Stream editor for filtering and transforming text
• sort - Sort lines of text files
• uniq - Report or filter out repeated lines
• cut - Remove sections from each line of files
• wc - Count lines, words, and characters in a file

File Compression and Archiving

• tar - Archive files


• gzip - Compress files
• gunzip - Decompress files
• zip - Package and compress files
• unzip - Extract compressed files
User Management

• adduser / useradd - Add a new user


• deluser / userdel - Delete a user account
• passwd - Change a user password
• su - Switch user
• sudo - Execute a command as another user, typically root

System Shutdown and Reboot

• shutdown - Schedule a system shutdown


• reboot - Restart the system
• halt - Halt the system
• poweroff - Power off the system

Package Management (Depends on Distribution)

• Debian/Ubuntu:
o apt - Advanced Package Tool
o apt-get - Install, update, remove packages
• RHEL/CentOS:
o yum - Yellowdog Updater, Modified
o dnf - Next-generation version of yum
• Arch Linux:
o pacman - Package manager utility

Process Management

• kill - Terminate a process by PID


• killall - Kill processes by name
• pkill - Terminate processes based on pattern
• xkill - Kill a client by clicking on a window

Shell Job Control


• & - Run a command in the background
• jobs - List active jobs
• fg - Bring a job to the foreground
• bg - Send a job to the background
• nohup - Run a command immune to hangups
• disown - Remove jobs from the shell's job table

You might also like