Linux is an open-source operating system widely used for servers, development, cloud computing, and embedded systems. It’s powerful due to its command-line interface (CLI), flexibility, and security.
The terminal or CLI is where you type commands to interact with the system.
Command | Description |
---|---|
pwd |
Print current working directory |
ls |
List files and directories |
cd <dir> |
Change directory |
mkdir <dir> |
Create a directory |
touch <file> |
Create an empty file |
cp <src> <dest> |
Copy file/directory |
mv <src> <dest> |
Move/rename file/directory |
rm <file> |
Remove file |
rm -r <dir> |
Remove directory recursively |
cat <file> |
View file content |
less <file> |
View file content page by page |
echo "text" |
Display text or write to file |
find <path> -name <filename> |
Search files by name |
grep "text" <file> |
Search text in files |
history |
Show command history |
man <command> |
Show manual/help page |
Linux is a multi-user OS. Every file/directory has permissions controlling who can read, write, or execute it.
-rwxr-xr--
d
(directory)r
=read, w
=write, x
=execute)Permission | Value |
---|---|
read (r ) |
4 |
write (w ) |
2 |
execute (x ) |
1 |
rwx
= 4+2+1=7, rw-
= 4+2=6chmod 755 file
→ rwxr-xr-x