Ultimate Command Reference Guide for System Administrators and Network Engineers
A comprehensive collection of essential commands for Wireshark, Linux, and Windows systems
Introduction
This guide serves as a complete reference for system administrators, network engineers, security professionals, and IT enthusiasts. Whether you’re troubleshooting network issues with Wireshark, managing Linux servers, or automating tasks in Windows environments, this cheat sheet provides the most commonly used commands all in one place.
Each section is organized by functionality to help you quickly find the commands you need. Bookmark this page or print it out for easy reference during your daily tasks.
Table of Contents
- Wireshark Commands
- Linux Commands
- Windows CMD Commands
- PowerShell Equivalents
- Networking Best Practices
- Troubleshooting Tips
Wireshark Filters and Commands
Display Filters Syntax
==
: Equal!=
: Not equal>
: Greater than<
: Less than>=
: Greater than or equal<=
: Less than or equalcontains
: Protocol, field or text contains specified valuematches
: Protocol or text matches regular expression!
: Logical NOT&&
orand
: Logical AND||
oror
: Logical OR
Common Filtering Commands
ip.addr == 192.168.1.1
: Filter for specific IP addresshttp
: Show only HTTP packetstcp.port == 80
: Show only traffic on TCP port 80!tcp.port == 443
: Show all traffic except TCP port 443ip.src == 10.0.0.5 && ip.dst == 10.0.0.10
: Filter by source and destinationframe contains "login"
: Find frames containing specific texthttp.request.method == "GET"
: Show only HTTP GET requeststcp.flags.syn == 1
andtcp.flags.ack == 0
: Find SYN packets
Wireshark Keyboard Shortcuts
Ctrl + E
: Start/Stop captureCtrl + R
: Restart current captureCtrl + K
: Stop current captureCtrl + N
: Create new capture fileCtrl + O
: Open capture fileCtrl + S
: Save capture fileCtrl + G
: Go to specified packetCtrl + F
: Find packetF2
: Go back in the packet historyF3
: Move to next packet of that conversationF4
: Go to previous packet of that conversationF5
: Go to next packet of the conversationF6
: Go to first packetF7
: Go to last packetF8
: Go to next marked packetF9
: Mark/unmark current packetF10
: Go to previous marked packet
Main Toolbar Items
- Capture → Start : Start the new packet capturing session
- Capture → Stop : Stop current capture session
- Capture → Restart : Restarts active capture session
- Capture → Options : Opens “Capture Options” dialog box
- File → Open : Opens “file open” dialog box to load a capture
- File → Save As : Save current capture file
- File → Close : Close current capture file
- Edit → Find Packet : Find packet based on different criteria
- Go → Go Back : Move back in the packet history
Linux Commands Reference
System Commands
uname -a
: Display Linux system informationhostname
: Show system host nameuptime
: Show how long the system has been running + loadlast reboot
: Show system reboot historydate
: Show the current date and timecal
: Show this month calendarw
: Display who is onlinewhoami
: Who you are logged in asfinger user
: Display information about user
Hardware Information
dmesg
: Detected hardware and boot messagescat /proc/cpuinfo
: CPU informationcat /proc/meminfo
: Hardware memorycat /proc/interrupts
: Lists the interrupts per CPU per I/O devicelshw
: Displays information on hardware configurationlsblk
: Display block device related informationfree -m
: Used and free memory (-m for MB)lspci -tv
: Show PCI deviceslsusb -tv
: Show USB devicesdmidecode
: Show hardware info from the BIOShdparm -i /dev/sda
: Show info about disk sdahdparm -tT /dev/sda
: Do a read speed test on disk sdabadblocks -s /dev/sda
: Test for unreadable blocks on disk sda
Users Management
id
: Show the active user id with login and grouplast
: Show last logins on the systemwho
: Show who is logged on the systemgroupadd admin
: Add group “admin”useradd -c "Sam Tomshi" -g admin -m sam
: Create user “sam”userdel sam
: Delete user “sam”adduser sam
: Add user “sam”usermod
: Modify user information
File Commands
ls -al
: Display all information about files/directoriespwd
: Show the path of current directorymkdir directory-name
: Create a directoryrm -rf directory-name
: Delete directory recursivelyrm -f file-name
: Force remove filerm -rf directory-name
: Remove directory recursivelycp file1 file2
: Copy file1 to file2cp -r dir1 dir2
: Copy dir1 to dir2; create dir2 if it doesn’t existmv file1 file2
: Rename source to dest / move source to directoryln -s /path/to/file-name link-name
: Create symbolic link to file-nametouch file
: Create an empty filecat > file
: Places standard input into filemore file
: Output the contents of filehead file
: Output the first 10 lines of filetail file
: Output the last 10 lines of filetail -f file
: Output the contents of file as it grows starting with the last 10 linesgpg -c file
: Encrypt filegpg file.gpg
: Decrypt filewc
: Print the number of bytes, words, and lines in filesxargs
: Execute command lines from standard input
Process Related
ps
: Display your currently active processesps aux | grep 'telnet'
: Find all process related to telnet processpmap
: Memory map of processtop
: Display all running processeskill pid
: Kill process with mentioned pidkillall proc
: Kill all processes named procpkill process-name
: Send signal to a process with its namebg
: Resume suspended jobs without bringing them to foregroundfg
: Brings the most recent job to foregroundfg n
: Brings job n to the foreground
File Permissions
chmod octal file-name
: Change the permissions of file to octalchmod 777 /data/test.c
: Set rwx permission for owner, group, worldchmod 755 /data/test.c
: Set rwx for owner, rx for group and worldchown owner-user file
: Change owner of the filechown owner-user:owner-group file
: Change owner and group owner of the filechown owner-user:owner-group directory
: Change owner and group owner of the directory
Network Commands
ifconfig
: Display all network interfaces and ip addressip addr show
: Display all network interfaces and ip addressifconfig eth0
: Set IP address for eth0ethtool eth0
: Linux tool to show ethernet statusping host
: Send echo request to test connectivitywhois domain
: Get whois information for domaindig domain
: Get DNS information for domaindig -x host
: Reverse lookup hosthost google.com
: Lookup DNS ip address for the namehostname -i
: Lookup local ip addresswget file
: Download filenetstat -tupl
: Listing all active listening ports
Compression / Archives
tar cf home.tar home
: Create tar named home.tar containing home/tar xf file.tar
: Extract the files from file.tartar czf file.tar.gz files
: Create a tar with gzip compressiongzip file
: Compress file and renames it to file.gz
Install Packages
rpm -i pkgname.rpm
: Install rpm based packagerpm -e pkgname
: Remove package
Install from Source
./configure
:make
:make install
:
Search
grep pattern files
: Search for pattern in filesgrep -r pattern dir
: Search recursively for pattern in dirlocate file
: Find all instances of filefind /home -name "index*"
: Find files names that start with “index”find /home -size +10000k
: Find files larger than 10000k in /home
Login (SSH and Telnet)
ssh user@host
: Connect to host as userssh -p port user@host
: Connect to host using specific porttelnet host
: Connect to the system using telnet port
File Transfer
scp file.txt server2:/tmp
: Secure copy file.txt to remote host /tmp folderrsync -a /home/apps /backup/
: Synchronize source to destination
Disk Usage
df -h
: Show free space on mounted filesystemsdf -i
: Show free inodes on mounted filesystemsfdisk -l
: Display disks partitions sizes and typesdu -ah
: Display disk usage in human readable formdu -sh
: Display total disk usage on the current directoryfindmnt
: Displays target mount point for all filesystemsmount device-path mount-point
: Mount a device
Directory Navigation
cd
: To go to home foldercd ..
: To go to parent directory/
: Root directory.
: Current directory..
: Parent directorycd /test
: Change to /test directory
Windows CMD Commands
File Management
ASSOC
: Displays or modifies file extension associationsATTRIB
: Displays or changes file attributesCD
: Shows the name of or changes to a current directoryCHCP
: Displays or sets the active code page numberCHDIR
: Displays the name of or changes to the current directoryCHKDSK
: Checks a disk and displays a status reportCHOICE
: Batch command that allows users to select from a set of optionsCIPHER
: Displays or alters the encryption of directories (files) on NTFS partitionsCOMP
: Compares the contents of two files or sets of files byte-by-byteCOMPACT
: Displays or alters the compression of files on NTFS partitionsCONVERT
: Converts FAT volumes to NTFS (You cannot convert the current drive)COPY
: Copies one or more files to another locationDEL
: Deletes one or more filesDIR
: Displays a list of files and sub-directories in a directoryDISKCOMP
: Compares the contents of two floppy disksDISKCOPY
: Copies the contents of one floppy disk to anotherDISKPART
: Displays or configures Disk Partition propertiesECHO
: Displays messages, or turns command echoing on or offERASE
: Deletes one or more filesEXPAND
: Expands compressed filesFC
: Compares two files or sets of files, and displays the differences between themFIND
: Searches for a text string in a file or filesFINDSTR
: Searches for strings in filesFOR
: Runs a specified command for each item in a setFORFILES
: Selects files in a folder for batch processingFORMAT
: Formats a disk for use with WindowsFSUTIL
: Displays or configures the file system propertiesFTYPE
: Displays or modifies file types used in file extension associationsLABEL
: Creates, changes, or deletes the volume label of a diskMD
: Creates a directoryMKDIR
: Creates a directoryMKLINK
: Creates Symbolic Links and Hard LinksMOVE
: Moves one or more files from one directory to another directoryOPENFILES
: Queries, displays, or disconnects open files or files opened by network usersRD
: Removes a directoryREN
: Renames a file or filesRENAME
: Renames a file or directoryREPLACE
: Replaces filesRMDIR
: Removes a directoryROBOCOPY
: Advanced utility to copy files and directory treesSORT
: Sorts inputTREE
: Graphically displays the directory structure of a drive or pathTYPE
: Displays the contents of a text fileWHERE
: Displays the location of files that match a search patternXCOPY
: Copies files and directory trees
System Management
BCDEDIT
: Sets properties in boot database to control boot loadingBREAK
: Sets or clears extended CTRL+C checkingCACLS
: Displays or modifies access control lists (ACLs) of filesCALL
: Calls a batch program from anotherCHKNTFS
: Displays or modifies the checking of disk at boot timeCLS
: Clears the screenCMD
: Starts a new instance of the Windows command interpreterCMDKEY
: Creates, lists, and deletes stored user names and passwords or credentialsCOLOR
: Sets the default console colorsDATE
: Displays or sets the dateDRIVERQUERY
: Displays current device driver status and propertiesEXIT
: Quits and closes the command shellGPRESULT
: Displays Group Policy information for machine or userHELP
: Provides help information for Windows commandsICACLS
: Display, modify, backup, or restore ACLs for files and directoriesIPCONFIG
: Displays all current TCP/IP network configuration valuesMODE
: Configures a system deviceMORE
: Displays output one screen at a timePAUSE
: Suspends processing of a batch filePOPD
: Restores the previous value of the current directory saved by PUSHDPOWERCFG
: Manages power settings and power consumptionPRINT
: Prints a text filePROMPT
: Changes the Windows command promptPUSHD
: Saves the current directory then changes itRECOVER
: Recovers readable information from a bad or defective diskREM
: Designates comments (remarks) in batch filesSCHTASKS
: Schedules commands and programs to run on a computerSETLOCAL
: Begins localization of environment changes in a batch fileSETX
: Sets environment variablesSHUTDOWN
: Allows proper local or remote shutdown of machineSTART
: Starts a separate window to run a specified program or commandSYSTEMINFO
: Displays machine specific properties and configurationTASKKILL
: Kill running process or applicationTASKLIST
: Displays all currently running tasks including servicesTIME
: Displays or sets the system timeTIMEOUT
: Pauses the command processor for the specified number of secondsTITLE
: Sets the window title for a CMD.EXE sessionTRACERT
: Route tracing toolVER
: Displays the Windows versionVERIFY
: Tells Windows whether to verify that your files are written correctly to a diskVOL
: Displays a disk volume label and serial numberWMIC
: Displays WMI information inside interactive command shellRUNAS
: Allows a user to run specific tools and programs with different permissions
Networking
ARP
: Displays and modifies the IP-to-Physical address translation tablesGETMAC
: Displays the MAC address of network adaptersIPCONFIG
: Displays IP network settingsNETSH
: Network services configuration toolNETSTAT
: Network statisticsNSLOOKUP
: DNS query toolPATHPING
: Advanced version of ping, used on multiple routersPING
: Sends echo requests to an addressROUTE
: Manipulates network routing tablesTRACERT
: Traces route to a remote host showing all hops
PowerShell Equivalents
PowerShell has become the preferred scripting and automation tool for Windows environments. Here are PowerShell equivalents for common CMD commands:
CMD Command | PowerShell Equivalent | Description |
---|---|---|
dir |
Get-ChildItem or ls |
Lists directory contents |
cd |
Set-Location or cd |
Changes directory |
mkdir |
New-Item -ItemType Directory or mkdir |
Creates new directory |
copy |
Copy-Item or cp |
Copies files or directories |
move |
Move-Item or mv |
Moves files or directories |
del |
Remove-Item or rm |
Deletes files or directories |
type |
Get-Content or cat |
Displays file contents |
find |
Select-String |
Searches for patterns in files |
ipconfig |
Get-NetIPConfiguration |
Shows network configuration |
ping |
Test-Connection |
Tests network connectivity |
tasklist |
Get-Process |
Lists running processes |
taskkill |
Stop-Process |
Terminates processes |
systeminfo |
Get-ComputerInfo |
Displays system information |
netstat |
Get-NetTCPConnection |
Shows network statistics |
Networking Best Practices
When working with network tools and commands, keep these best practices in mind:
- Documentation: Always document network changes, especially firewall rules and routing configurations.
- Backup Configurations: Before making significant changes, back up device configurations.
- Use Filtering Efficiently: When using Wireshark, apply specific display filters to reduce noise and focus on relevant traffic.
- Security First: Always use encrypted protocols (SSH instead of Telnet, SFTP instead of FTP) when managing remote systems.
- Test in Isolation: Test complex commands or scripts in isolated environments before applying to production.
- Monitor Resource Usage: Use commands like
top
(Linux) orResource Monitor
(Windows) to monitor system resources during troubleshooting. - Regular Updates: Keep systems updated with security patches and firmware updates.
Troubleshooting Tips
Network Connectivity Issues
- Check Physical Connections: Verify all cables and physical connections.
- Verify IP Configuration: Use
ipconfig
(Windows) orifconfig
/ip addr
(Linux) to check IP addressing. - Test Basic Connectivity: Use
ping
to test basic network connectivity. - Check DNS Resolution: Use
nslookup
ordig
to verify DNS is working correctly. - Trace Route: Use
tracert
(Windows) ortraceroute
(Linux) to identify where connections are failing. - Examine Firewall Rules: Check if firewalls are blocking necessary traffic.
- Packet Capture: Use Wireshark to capture and analyze packets for deeper troubleshooting.
System Performance Issues
- Check Resource Usage: Use
top
orhtop
in Linux, Task Manager in Windows. - Review Logs: Check system logs for errors or warnings.
- Monitor Disk Space: Use
df -h
in Linux ordir
in Windows to check available disk space. - Check Running Services: Review which services are running and consuming resources.
- Scan for Malware: Ensure the system isn’t compromised.
Conclusion
Mastering these commands will significantly enhance your effectiveness as a system administrator or network engineer. While graphical interfaces provide user-friendly ways to manage systems, command-line proficiency offers greater flexibility, efficiency, and the ability to automate routine tasks.
Remember that the best way to learn these commands is through regular practice and application in real-world scenarios. Start with basic commands and gradually incorporate more advanced ones into your daily workflow.
Additional Resources
- Official Wireshark Documentation
- Linux Documentation Project
- Microsoft Command Line Reference
- PowerShell Documentation
Last Updated: April 2025