π Linux/Unix: Networking & Communication β Commands for Ping, SSH, Transfers, and Diagnostics
π§² Introduction β Power Your Terminal with Network Tools
Linux/Unix systems are widely used in servers and development environmentsβmaking network communication a critical skill. Whether you’re troubleshooting connectivity, securely transferring files, or accessing web content from the CLI, Linux offers robust and versatile networking tools.
π― In this guide, youβll learn:
- How to test and diagnose network connections
- How to securely connect and transfer files using SSH-based tools
- How to fetch data from web servers using CLI tools
- How to send messages between users on the system
π Topics Covered
π΅ Subtopic | π Description |
---|---|
Basic Networking (ping , ip , ifconfig ) | Test connectivity and view/change IP configurations |
Diagnostics (netstat , ss , traceroute ) | Check open ports, socket states, and packet routes |
Transfers & Access (ssh , scp , rsync ) | Secure remote access and file transfers over encrypted protocols |
Web Tools (wget , curl , lynx ) | Download, inspect, or interact with web resources from the terminal |
Messaging (write , wall , mail ) | Communicate with logged-in users or send system messages |
π΅ Linux/Unix: Basic Networking (ping, ip, ifconfig)
πΉ ping
β Check Host Availability
ping google.com
β Sends ICMP packets to test if the remote server is reachable.
πΉ ip
β Modern IP Configuration Tool
ip a # Show all IP addresses
ip link # Show all interfaces
ip route # Show routing table
πΉ ifconfig
β Legacy Interface Configuration
ifconfig eth0
β Still used on older systems to display or configure network interfaces.
π΅ Linux/Unix: Diagnostics (netstat, ss, traceroute, mtr)
πΉ netstat
β View Open Ports and Connections
netstat -tuln
β Lists TCP/UDP ports with numeric IP and port values.
πΉ ss
β Modern Socket Statistics Tool
ss -tunlp
β
Faster alternative to netstat
.
πΉ traceroute
β Track Packet Path
traceroute google.com
β Shows each hop your packet takes to reach the target.
πΉ mtr
β Combine Ping + Traceroute
mtr google.com
β Interactive real-time hop and packet loss tracking.
π΅ Linux/Unix: Transfers & Access (ssh, scp, rsync, sftp)
πΉ ssh
β Secure Remote Shell
ssh user@host
β Connect to remote systems securely using encrypted session.
πΉ scp
β Secure Copy Over SSH
scp file.txt user@host:/path/
πΉ rsync
β Efficient File Transfer with Syncing
rsync -avz local/ user@host:/remote/
β Resumes transfers and syncs only changed parts.
πΉ sftp
β Interactive File Transfer Shell
sftp user@host
π΅ Linux/Unix: Web Tools (wget, curl, lynx)
πΉ wget
β Download from Web
wget https://example.com/file.zip
πΉ curl
β Versatile Web Request Tool
curl -I https://example.com
β Fetches headers, posts forms, or submits API calls.
πΉ lynx
β Text-Based Web Browser
lynx https://example.com
β Browse websites in terminal without graphics.
π΅ Linux/Unix: Messaging (write, wall, mail)
πΉ write
β Send Message to Another User
write username
πΉ wall
β Broadcast Message to All Users
wall "System will reboot in 5 minutes"
πΉ mail
β Send/Read Emails from CLI
mail -s "Subject" user@example.com < message.txt
π Summary β Recap & Next Steps
Linux networking tools provide deep control over network visibility, diagnostics, communication, and web interaction. Mastering them equips you to manage systems remotely, automate web access, and troubleshoot connectivity with confidence.
π Key Takeaways:
- Use
ping
,ip
, andtraceroute
for basic network troubleshooting - Securely connect or transfer files via
ssh
,scp
,rsync
, andsftp
- Automate or inspect web traffic using
wget
andcurl
- Send messages system-wide using
wall
, or directly viawrite
βοΈ Real-World Use Cases:
- Monitor server connectivity and latency
- Automate backups or updates over SSH
- Test APIs and download data from web servers
- Notify all logged-in users of critical events
β Frequently Asked Questions
β Whatβs the difference between scp
and rsync
?
β
rsync
is more efficient for large syncs and resumes; scp
is simpler for quick transfers.
β How do I find which port a service is using?
β
Use:
ss -tunlp
β Can I schedule transfers with rsync
?
β
Yes, combine with cron
to automate backups and remote syncs.
β How can I check if a website is up from the terminal?
β
Use:
curl -I https://example.com
β Is ifconfig
deprecated? What should I use instead?
β
Yes. Use the modern replacement:
ip a
Share Now :