Skip to content

TEJASWANIANIMIREDDY/Linux-Commands-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Commands Practice – Kali Linux 🐉

Platform Category Tool Status


Overview

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.


Basic Navigation Commands

  • pwd
  • ls
  • ls -l
  • ls -a
  • ls -la
  • cd
  • cd ..
  • clear

File Management Commands

  • mkdir
  • touch
  • cp
  • mv
  • rm
  • rm -r
  • cat

User Management Commands

  • whoami
  • passwd
  • sudo
  • id

Networking Commands

  • ip a
  • ping google.com
  • ifconfig
  • netstat -tulnp
  • traceroute google.com
  • nslookup google.com

Package Management Commands

  • sudo apt update
  • sudo apt upgrade
  • sudo apt install
  • sudo apt remove

Permissions Commands

  • chmod +x
  • chmod 777
  • chown

Process Commands

  • top
  • ps aux
  • kill

Cybersecurity Tools Commands

  • whois domain.com
  • nmap target_ip
  • wireshark

1. pwd

Meaning

pwd stands for Print Working Directory.

It is used to display the current folder/location where the user is present.


Syntax

pwd

Example

pwd

Output

/home/kali

Screenshot

pwd command


2. ls

Meaning

ls is used to list the files and folders present in the current directory.


Syntax

ls

Example

ls

Output Example

Desktop Documents Downloads Pictures Videos

Screenshot

ls command


3. ls -l

Meaning

ls -l displays files and folders in detailed list format.

It shows:

  • file permissions
  • owner
  • file size
  • timestamps

Syntax

ls -l

Example

ls -l

Output Example

drwxr-xr-x 2 kali kali 4096 Desktop
-rw-r--r-- 1 kali kali 220 file.txt

Screenshot

ls -l command


4. ls -a

Meaning

ls -a is used to display all files including hidden files and folders.

Hidden files usually start with a dot (.).


Syntax

ls -a

Example

ls -a

Output Example

.  ..  .bashrc  .profile  Desktop

Screenshot

ls -a command


5. ls -la

Meaning

ls -la combines:

  • ls -l → detailed list format
  • ls -a → hidden files

It displays:

  • hidden files
  • permissions
  • owners
  • timestamps
  • detailed file information

Syntax

ls -la

Example

ls -la

Output Example

drwxr-xr-x kali kali Desktop
-rw-r--r-- kali kali .bashrc

Screenshot

ls -la command 1

ls -la command 2


6. cd foldername

Meaning

cd stands for Change Directory.

It is used to move into a specific folder.


Syntax

cd foldername

Example

cd Documents
pwd

Output

/home/kali/Documents

Screenshot

cd command


7. cd ..

Meaning

cd .. is used to move back one directory/folder.


Syntax

cd ..

Example

cd ..
pwd

Output

/home/kali

Screenshot

cd back command


8. clear

Meaning

clear is used to clear the terminal screen.

After executing the command, the terminal becomes empty and clean.


Syntax

clear

Example

clear

Screenshot

clear command 1

clear command 2


9. mkdir

Meaning

mkdir stands for Make Directory.

It is used to create a new folder/directory.


Syntax

mkdir foldername

Example

mkdir test

Verification

ls

Output Example

Desktop Documents Downloads test

Screenshot

mkdir command


10. touch

Meaning

touch is used to create a new empty file.


Syntax

touch filename

Example

touch file.txt

Verification

ls

Output Example

file.txt

Screenshot

touch command


11. cp

Meaning

cp stands for Copy.

It is used to copy files from one location to another.


Syntax

cp sourcefile destinationfile

Example

cp file.txt copy.txt

Verification

ls

Output Example

file.txt copy.txt

Screenshot

cp command


12. mv

Meaning

mv stands for Move.

It is used to move or rename files and folders.


Syntax

mv oldname newname

Example

mv copy.txt newfile.txt

Verification

ls

Output Example

file.txt newfile.txt

Screenshot

mv command


13. rm

Meaning

rm stands for Remove.

It is used to delete files.


Syntax

rm filename

Example

rm newfile.txt

Verification

ls

Output Example

file.txt

Screenshot

rm command


14. rm -r

Meaning

rm -r is used to delete folders/directories recursively along with their contents.


Syntax

rm -r foldername

Example

rm -r test

Verification

ls

Output Example

Desktop Documents Downloads

Screenshot

rm -r command


15. cat

Meaning

cat stands for Concatenate.

It is used to view the contents of a file.


Syntax

cat filename

Example

echo "Hello Linux" > file.txt
cat file.txt

Output

Hello Linux

Screenshot

cat command


16. whoami

Meaning

whoami is used to display the current logged-in username.


Syntax

whoami

Example

whoami

Output

kali

Screenshot

whoami command


17. passwd

Meaning

passwd is used to change the password of the current user account.


Syntax

passwd

Example

passwd

Output Example

Changing password for kali
Current password:
New password:
Retype new password:

Screenshot

passwd command


18. sudo

Meaning

sudo stands for Super User Do.

It is used to run commands with administrator/root privileges.


Syntax

sudo command

Example

sudo apt update

Output Example

[sudo] password for kali:

Screenshot

sudo command


19. id

Meaning

id is used to display detailed information about the current user such as:

  • User ID (UID)
  • Group ID (GID)
  • Groups

Syntax

id

Example

id

Output Example

uid=1000(kali) gid=1000(kali) groups=1000(kali)

Screenshot

id command


20. ip a

Meaning

ip a is used to display IP addresses and network interface information.


Syntax

ip a

Example

ip a

Output Example

inet 192.168.1.5/24

Screenshot

ip a command


21. ping google.com

Meaning

ping is used to check internet connectivity and test communication with another server.


Syntax

ping google.com

Example

ping google.com

Output Example

64 bytes from google.com

Press Ctrl + C to stop the ping command.


Screenshot

ping command


22. ifconfig

Meaning

ifconfig is used to display network interface configuration details.


Syntax

ifconfig

Example

ifconfig

Output Example

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>

Screenshot

ifconfig command


23. netstat -tulnp

Meaning

netstat -tulnp is used to display:

  • open ports
  • active services
  • listening connections
  • process IDs

Syntax

netstat -tulnp

Example

netstat -tulnp

Output Example

tcp LISTEN 0 128 0.0.0.0:22

Some details may require sudo privileges.


Screenshot

netstat command


24. traceroute google.com

Meaning

traceroute is used to display the path packets take from your system to a destination server.


Syntax

traceroute google.com

Example

traceroute google.com

Output Example

1 192.168.1.1
2 * * *

Screenshot

traceroute command


25. nslookup google.com

Meaning

nslookup is used for DNS lookup and finding the IP address of a domain.


Syntax

nslookup google.com

Example

nslookup google.com

Output Example

Address: 142.250.xxx.xxx

Screenshot

nslookup command


26. sudo apt update

Meaning

sudo 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."


Syntax

sudo apt update

Example

sudo apt update

Output Example

Fetched 5 MB in 3s
Reading package lists... Done

Screenshot

apt update command


27. sudo apt upgrade

Meaning

sudo apt upgrade upgrades installed packages to their latest available versions.


Syntax

sudo apt upgrade

Example

sudo apt upgrade

Output Example

Do you want to continue? [Y/n]

Screenshot

apt upgrade command


28. sudo apt install nmap

Meaning

sudo apt install is used to install software packages from repositories.


Syntax

sudo apt install package-name

Example

sudo apt install nmap

Output Example

The following NEW packages will be installed:
nmap

Screenshot

apt install command


29. sudo apt remove nmap

Meaning

sudo apt remove is used to uninstall software packages.


Syntax

sudo apt remove package-name

Example

sudo apt remove nmap

Output Example

The following packages will be REMOVED:
nmap

Screenshot

apt remove command


30. chmod +x file.sh

Meaning

chmod stands for Change Mode.

It is used to change file permissions.

The +x option adds execute permission to a file.


Syntax

chmod +x filename

Example

Create a script:

touch script.sh

Make it executable:

chmod +x script.sh

Verify permissions:

ls -l script.sh

Output Example

-rwxr-xr-x 1 kali kali 25 May 31 script.sh

Screenshot

chmod +x command


31. chmod 777 file.txt

Meaning

chmod 777 gives full permissions to everyone.

  • Owner: Read, Write, Execute
  • Group: Read, Write, Execute
  • Others: Read, Write, Execute

Syntax

chmod 777 filename

Example

chmod 777 file.txt

Check permissions:

ls -l file.txt

Output Example

-rwxrwxrwx 1 kali kali 25 May 31 file.txt

Permission Breakdown

Number Permission
7 Read + Write + Execute
7 Read + Write + Execute
7 Read + Write + Execute

Result:

Owner  = rwx
Group  = rwx
Others = rwx

Important

⚠️ 777 is not recommended for sensitive files because everyone gets full access.

Use only for learning and testing purposes.


Screenshot

chmod 777 command


32. chown user:group file

Meaning

chown stands for Change Owner.

It is used to change the ownership of a file or directory.


Syntax

sudo chown user:group filename

Example

sudo chown kali:kali script.sh

Check ownership:

ls -l script.sh

Output Example

-rwxr-xr-x 1 kali kali 25 May 31 script.sh

Note: If the file already belongs to kali:kali, the ownership may appear unchanged.


Screenshot

chown command


33. top

Meaning

top displays live system activity and running processes.

Think of it as:

Linux Task Manager


Syntax

top

Example

top

Output Example

top - 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

Exit

Press:

q

to quit the top screen.


Screenshot

top command


34. ps aux

Meaning

ps aux displays all currently running processes on the system.

It shows:

  • Process owner
  • Process ID (PID)
  • CPU usage
  • Memory usage
  • Command name

Syntax

ps aux

Example

ps aux

Output Example

USER       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

Important Columns

Column Meaning
USER Process Owner
PID Process ID
%CPU CPU Usage
%MEM Memory Usage
COMMAND Program Name

Screenshot

ps aux command


35. kill PID

Meaning

kill is used to stop a running process.

A process is identified using its Process ID (PID).


Syntax

kill PID

Example

Find a process:

ps aux | grep sleep

Output:

kali 2500 0.0 0.0 sleep 300

Kill the process:

kill 2500

Verification

ps aux | grep sleep

The process should no longer appear in the process list.


Note

PID stands for Process ID.

Every running process in Linux has a unique PID.


Screenshot

kill command

kill command


36. whois domain.com

Meaning

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?"


Syntax

whois domain.com

Example

whois google.com

Output Example

Domain Name: GOOGLE.COM
Registrar: MarkMonitor
Creation Date: 1997

Screenshot

whois command


37. nmap target_ip

Meaning

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."


Syntax

nmap target_ip

Example

nmap scanme.nmap.org

Output Example

PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https

Screenshot

nmap command


38. wireshark

Meaning

Wireshark is a packet analysis tool used to capture and inspect network traffic.

Think of it as:

"A microscope for network communication."


Launch

wireshark

What You Can See

  • DNS requests
  • HTTP traffic
  • TCP packets
  • IP addresses

Output Example

192.168.1.5 → google.com
DNS Query

Screenshot

wireshark command


Quick Memory Table

Tool Purpose
whois Domain information lookup
nmap Network and port discovery
wireshark Packet analysis

Tools Used

  • Kali Linux
  • Oracle VirtualBox
  • GitHub

Skills Learned

  • 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

Repository Structure

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

Future Improvements

  • Add more Linux commands
  • Practice file permissions
  • Learn networking commands
  • Explore shell scripting basics
  • Document advanced Linux usage

Author

Tejaswani Animireddy

About

Beginner Linux commands practice using Kali Linux in VirtualBox with screenshots and explanations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors