A beginner-friendly Linux commands practice repository created while learning Kali Linux using VirtualBox.
This repository contains Linux commands along with:
- meaning
- syntax
- examples
- outputs
- screenshots
The purpose of this repository is to document Linux command practice and improve terminal usage skills.
pwdlsls -lls -als -lacdcd ..clear
mkdirtouchcpmvrmrm -rcat
whoamipasswdsudoid
ip aping google.comifconfignetstat -tulnptraceroute google.comnslookup google.com
sudo apt updatesudo apt upgradesudo apt installsudo apt remove
chmod +xchmod 777chown
topps auxkill
whois domain.comnmap target_ipwireshark
pwd stands for Print Working Directory.
It is used to display the current folder/location where the user is present.
pwdpwd/home/kalils is used to list the files and folders present in the current directory.
lslsDesktop Documents Downloads Pictures Videosls -l displays files and folders in detailed list format.
It shows:
- file permissions
- owner
- file size
- timestamps
ls -lls -ldrwxr-xr-x 2 kali kali 4096 Desktop
-rw-r--r-- 1 kali kali 220 file.txtls -a is used to display all files including hidden files and folders.
Hidden files usually start with a dot (.).
ls -als -a. .. .bashrc .profile Desktopls -la combines:
ls -l→ detailed list formatls -a→ hidden files
It displays:
- hidden files
- permissions
- owners
- timestamps
- detailed file information
ls -lals -ladrwxr-xr-x kali kali Desktop
-rw-r--r-- kali kali .bashrccd stands for Change Directory.
It is used to move into a specific folder.
cd foldernamecd Documents
pwd/home/kali/Documentscd .. is used to move back one directory/folder.
cd ..cd ..
pwd/home/kaliclear is used to clear the terminal screen.
After executing the command, the terminal becomes empty and clean.
clearclearmkdir stands for Make Directory.
It is used to create a new folder/directory.
mkdir foldernamemkdir testlsDesktop Documents Downloads testtouch is used to create a new empty file.
touch filenametouch file.txtlsfile.txtcp stands for Copy.
It is used to copy files from one location to another.
cp sourcefile destinationfilecp file.txt copy.txtlsfile.txt copy.txtmv stands for Move.
It is used to move or rename files and folders.
mv oldname newnamemv copy.txt newfile.txtlsfile.txt newfile.txtrm stands for Remove.
It is used to delete files.
rm filenamerm newfile.txtlsfile.txtrm -r is used to delete folders/directories recursively along with their contents.
rm -r foldernamerm -r testlsDesktop Documents Downloadscat stands for Concatenate.
It is used to view the contents of a file.
cat filenameecho "Hello Linux" > file.txt
cat file.txtHello Linuxwhoami is used to display the current logged-in username.
whoamiwhoamikalipasswd is used to change the password of the current user account.
passwdpasswdChanging password for kali
Current password:
New password:
Retype new password:sudo stands for Super User Do.
It is used to run commands with administrator/root privileges.
sudo commandsudo apt update[sudo] password for kali:id is used to display detailed information about the current user such as:
- User ID (UID)
- Group ID (GID)
- Groups
ididuid=1000(kali) gid=1000(kali) groups=1000(kali)ip a is used to display IP addresses and network interface information.
ip aip ainet 192.168.1.5/24ping is used to check internet connectivity and test communication with another server.
ping google.comping google.com64 bytes from google.comPress
Ctrl + Cto stop the ping command.
ifconfig is used to display network interface configuration details.
ifconfigifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>netstat -tulnp is used to display:
- open ports
- active services
- listening connections
- process IDs
netstat -tulnpnetstat -tulnptcp LISTEN 0 128 0.0.0.0:22Some details may require
sudoprivileges.
traceroute is used to display the path packets take from your system to a destination server.
traceroute google.comtraceroute google.com1 192.168.1.1
2 * * *nslookup is used for DNS lookup and finding the IP address of a domain.
nslookup google.comnslookup google.comAddress: 142.250.xxx.xxxsudo apt update updates the package list from repositories.
It checks:
- newest package versions
- available updates
- security updates
This command does not install updates.
Think of it as:
"Check what updates are available."
sudo apt updatesudo apt updateFetched 5 MB in 3s
Reading package lists... Donesudo apt upgrade upgrades installed packages to their latest available versions.
sudo apt upgradesudo apt upgradeDo you want to continue? [Y/n]sudo apt install is used to install software packages from repositories.
sudo apt install package-namesudo apt install nmapThe following NEW packages will be installed:
nmapsudo apt remove is used to uninstall software packages.
sudo apt remove package-namesudo apt remove nmapThe following packages will be REMOVED:
nmapchmod stands for Change Mode.
It is used to change file permissions.
The +x option adds execute permission to a file.
chmod +x filenameCreate a script:
touch script.shMake it executable:
chmod +x script.shVerify permissions:
ls -l script.sh-rwxr-xr-x 1 kali kali 25 May 31 script.shchmod 777 gives full permissions to everyone.
- Owner: Read, Write, Execute
- Group: Read, Write, Execute
- Others: Read, Write, Execute
chmod 777 filenamechmod 777 file.txtCheck permissions:
ls -l file.txt-rwxrwxrwx 1 kali kali 25 May 31 file.txt| Number | Permission |
|---|---|
| 7 | Read + Write + Execute |
| 7 | Read + Write + Execute |
| 7 | Read + Write + Execute |
Result:
Owner = rwx
Group = rwx
Others = rwx
777 is not recommended for sensitive files because everyone gets full access.
Use only for learning and testing purposes.
chown stands for Change Owner.
It is used to change the ownership of a file or directory.
sudo chown user:group filenamesudo chown kali:kali script.shCheck ownership:
ls -l script.sh-rwxr-xr-x 1 kali kali 25 May 31 script.shNote: If the file already belongs to
kali:kali, the ownership may appear unchanged.
top displays live system activity and running processes.
Think of it as:
Linux Task Manager
toptoptop - 03:14:53 up 41 min, 1 user, load average: 0.15, 0.19, 0.16
Tasks: 250 total, 1 running, 249 sleeping
%Cpu(s): 2.0 us, 1.0 sy, 97.0 id
PID USER %CPU %MEM COMMAND
1234 kali 1.0 0.5 firefox
Press:
q
to quit the top screen.
ps aux displays all currently running processes on the system.
It shows:
- Process owner
- Process ID (PID)
- CPU usage
- Memory usage
- Command name
ps auxps auxUSER PID %CPU %MEM COMMAND
root 1 0.0 0.7 /sbin/init
root 2 0.0 0.0 [kthreadd]
kali 2540 1.2 2.1 firefox
| Column | Meaning |
|---|---|
| USER | Process Owner |
| PID | Process ID |
| %CPU | CPU Usage |
| %MEM | Memory Usage |
| COMMAND | Program Name |
kill is used to stop a running process.
A process is identified using its Process ID (PID).
kill PIDFind a process:
ps aux | grep sleepOutput:
kali 2500 0.0 0.0 sleep 300Kill the process:
kill 2500ps aux | grep sleepThe process should no longer appear in the process list.
PID stands for Process ID.
Every running process in Linux has a unique PID.
whois is used to retrieve information about a domain name.
It can provide details such as:
- Registrar
- Creation date
- Expiry date
- Name servers
Think of it as:
"Who owns this website?"
whois domain.comwhois google.comDomain Name: GOOGLE.COM
Registrar: MarkMonitor
Creation Date: 1997
nmap stands for Network Mapper.
It is used to discover:
- Open ports
- Running services
- Devices on a network
Think of it as:
"Checking which doors are open."
nmap target_ipnmap scanme.nmap.orgPORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
Wireshark is a packet analysis tool used to capture and inspect network traffic.
Think of it as:
"A microscope for network communication."
wireshark- DNS requests
- HTTP traffic
- TCP packets
- IP addresses
192.168.1.5 → google.com
DNS Query
| Tool | Purpose |
|---|---|
whois |
Domain information lookup |
nmap |
Network and port discovery |
wireshark |
Packet analysis |
- Kali Linux
- Oracle VirtualBox
- GitHub
- Linux terminal navigation
- File and directory management
- User management commands
- Linux networking basics
- Linux command usage
- Understanding hidden files and permissions
- Command-line interface practice
- Documentation using GitHub
Linux-Commands-Practice
│
├── Navigation Commands (1-8)
│ ├── pwd
│ ├── ls
│ ├── ls -l
│ ├── ls -a
│ ├── ls -la
│ ├── cd
│ ├── cd ..
│ └── clear
│
├── File Management Commands (9-15)
│ ├── mkdir
│ ├── touch
│ ├── cp
│ ├── mv
│ ├── rm
│ ├── rm -r
│ └── cat
│
├── User Management Commands (16-19)
│ ├── whoami
│ ├── passwd
│ ├── sudo
│ └── id
│
├── Networking Commands (20-25)
│ ├── ip a
│ ├── ping google.com
│ ├── ifconfig
│ ├── netstat -tulnp
│ ├── traceroute google.com
│ └── nslookup google.com
│
├── Package Management Commands (26-29)
│ ├── sudo apt update
│ ├── sudo apt upgrade
│ ├── sudo apt install <package-name>
│ └── sudo apt remove <package-name>
│
├── Permissions Commands (30-32)
│ ├── chmod +x file.sh
│ ├── chmod 777 file.txt
│ └── chown user:group file
│
├── Process Management Commands (33-35)
│ ├── top
│ ├── ps aux
│ └── kill PID
│
└── Cybersecurity Tools Commands (36-38)
├── whois domain.com
├── nmap
└── wireshark
- Add more Linux commands
- Practice file permissions
- Learn networking commands
- Explore shell scripting basics
- Document advanced Linux usage
Tejaswani Animireddy








































