| Command | Description | Example | Hands-on Task |
|---|---|---|---|
| ls | List directory contents | ls -a /etc |
List all files (including hidden) in /etc. |
| cd | Change directory | cd ~ |
Navigate to your home directory and list contents. |
| pwd | Show current directory path | pwd |
Verify your current directory path. |
| mkdir | Create a directory | mkdir -p project/{src,docs} |
Create a nested folder structure. |
| touch | Create an empty file | touch log-{1..5}.txt |
Create 5 log files in a row. |
| cp | Copy files/directories | cp -r project/ backup/ |
Copy a directory recursively to a backup folder. |
| mv | Rename/move files | mv *.txt docs/ |
Move all .txt files to a "docs" directory. |
| rm | Remove files/directories | rm -rf temp/* |
Safely delete all files in "temp/". |
| cat | View/concatenate files | cat file1.txt file2.txt > combined.txt |
Combine two files into one. |
| grep | Search text patterns | grep -i "error" /var/log/syslog |
Search for "error" in system logs (case-insensitive). |
| sudo | Run commands as root | sudo apt update |
Update the package list using sudo. |
| chmod | Change file permissions | chmod 755 script.sh |
Set permissions to allow execution of a script. |
| history | Show command history | history | grep ping |
Find all instances of "ping" in your history. |
| tar | Compress/extract files | tar -cvf archive.tar docs/ |
Create an archive of a directory. |
| wget | Download files from URLs | wget https://example.com/file.zip |
Download a file and verify its existence. |
| ps | List running processes | ps aux | grep ssh |
Find all SSH-related processes. |
| kill | Terminate processes | kill 1234 |
Kill a process by its PID (use with caution). |
| df | Show disk space usage | df -h |
Check disk space in human-readable format. |
| free | Show memory usage | free -m |
View memory usage in megabytes. |
| systemctl | Control system services | systemctl restart apache2 |
Restart the Apache web server service. |
| Command | Description | Example | Hands-on Task |
|---|---|---|---|
| show ip int brief | Show interface IP status | show ip interface brief |
List all interfaces and their IP addresses. |
| configure terminal | Enter configuration mode | configure terminal |
Enter configuration mode on a router/switch. |
| interface GigabitEthernet 0/1 | Select an interface | interface Gi0/1 |
Configure an interface for VLAN 10. |
| ip address 192.168.1.1 255.255.255.0 | Assign an IP address | ip address 192.168.1.1 255.255.255.0 |
Assign an IP to a router's FastEthernet interface. |
| no shutdown | Enable an interface | no shutdown |
Enable a disabled interface. |
| copy running-config startup-config | Save configuration | copy run start |
Save the current configuration to NVRAM. |
| ping | Test network connectivity | ping 192.168.1.254 |
Ping the default gateway. |
| traceroute | Trace route to a host | traceroute 8.8.8.8 |
Trace the path to Google's DNS. |
| show cdp neighbors | Show connected devices | show cdp neighbors detail |
List neighboring devices with details. |
| vlan database | Enter VLAN configuration mode | vlan database |
Create VLAN 20 and name it "Sales". |
| spanning-tree mode pvst | Configure STP | spanning-tree mode rapid-pvst |
Enable Rapid PVST on a switch. |
| access-list 10 permit 192.168.1.0 0.0.0.255 | Create an ACL | access-list 10 deny 10.0.0.0 0.255.255.255 |
Create an ACL to block traffic from a subnet. |
| crypto isakmp policy | Configure IPSec | crypto isakmp key cisco123 address 192.168.2.1 |
Set up an IPSec tunnel between two routers. |
| show version | Show device information | show version |
Identify the hardware/software version of a router. |
| show processes cpu | View CPU usage | show processes cpu sorted |
Identify the process consuming the most CPU. |
| show logging | View system logs | show logging | include error |
Search logs for "error" messages. |
| show ip route | View routing table | show ip route 192.168.3.0 |
Find the route to a specific subnet. |
| configure replace | Rollback configurations | configure replace flash:old_config |
Roll back to a previous configuration file. |
| archive | Backup configurations | archive |
Automate configuration backups to TFTP. |
| ip http server | Enable HTTP server | ip http server |
Configure a basic web server on the router. |
| show ip bgp summary | View BGP status | show ip bgp summary |
Check BGP neighbor relationships. |
| show mac address-table | Show MAC table | show mac address-table |
List MAC addresses learned on a switch. |
| show ip ospf neighbor | View OSPF neighbors | show ip ospf neighbor |
Verify OSPF adjacency between routers. |
| show flash | Show flash memory | show flash: |
List files stored in flash memory. |
| show users | List connected users | show users |
Identify which users are logged into the device. |
| copy tftp | Transfer files via TFTP | copy tftp://192.168.1.5/config running-config |
Download a configuration from a TFTP server. |
| clear counters | Reset interface counters | clear counters Gi0/1 |
Reset interface statistics for troubleshooting. |
Linux Lab: Use a Linux VM (e.g., Ubuntu) or Docker containers to practice file management, scripting, and system administration tasks.
Cisco Lab: Use Packet Tracer, GNS3, or Cisco VIRL for configuring routers/switches. For advanced tasks, use physical devices or cloud labs (e.g., Cisco DevNet).
Notes: Ensure you have proper permissions and backups before modifying critical configurations. Use virtual environments to avoid disrupting live networks.