Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views2 pages

Command Purpose Example

The document provides a list of common command-line commands along with their purposes and examples, such as `pwd` for printing the working directory and `ls` for listing files. It also includes a brief overview of the file system hierarchy, explaining the significance of directories like `/home`, `/etc`, and `/var`. This information is essential for navigating and managing files in a Unix-like operating system.

Uploaded by

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

Command Purpose Example

The document provides a list of common command-line commands along with their purposes and examples, such as `pwd` for printing the working directory and `ls` for listing files. It also includes a brief overview of the file system hierarchy, explaining the significance of directories like `/home`, `/etc`, and `/var`. This information is essential for navigating and managing files in a Unix-like operating system.

Uploaded by

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

| Command | Purpose | Example

|
| --------- | ------------------------------------------------ |
----------------------------------------- |
| `pwd` | Print Working Directory (show current directory) | `pwd` →
`/home/taajrmen` |
| `ls` | List files/folders | `ls -la` (show
hidden and detailed) |
| `cd` | Change directory | `cd /var/log` or
`cd ..` to go up |
| `mkdir` | Make directory | `mkdir projects`
|
| `touch` | Create empty file | `touch file.txt`
|
| `cp` | Copy files/directories | `cp file.txt /tmp`
|
| `mv` | Move or rename | `mv file.txt
file2.txt` |
| `rm` | Remove files/directories | `rm file.txt` or
`rm -r folder` |
| `cat` | Show file content | `cat file.txt`
|
| `less` | View file interactively | `less
/var/log/messages` |
| `head` | Show first lines | `head -n 10
file.txt` |
| `tail` | Show last lines (great for logs) | `tail -f
/var/log/messages` (follow live) |
| `echo` | Display text or variables | `echo $HOME`
|
| `man` | Open manual page | `man ls`
|
| `which` | Find command location | `which python3`
|
| `chmod` | Change permissions | `chmod +x
script.sh` |
| `chown` | Change owner | `chown taajrmen
file.txt` |
| `df` | Disk free space | `df -h` (human-
readable) |
| `du` | Disk usage | `du -sh *`
|
| `ps` | Show running processes | `ps aux`
|
| `kill` | Kill process by PID | `kill 1234`
|
| `top` | Interactive system monitor | `top` or `htop`
(better, install) |
| `uname` | Show system info | `uname -a`
|
| `date` | Show or set date/time | `date`
|
| `history` | Show command history | `history`
|
| `clear` | Clear screen | `clear` or
`Ctrl+L` |
.File System Hierarchy Basics
/ — root directory

/home — user home directories

/etc — system config files

/var — variable data like logs

/usr — user programs, libraries

/bin and /sbin — essential binaries and system binaries

/tmp — temporary files

Understanding this helps navigate and locate files.

You might also like