Top Linux Troubleshooting Commands with Examples

Posted by

CommandDescriptionExample
topDisplay tasks and system information.top
htopInteractive process viewer.htop
psDisplay current processes.ps aux
killTerminate a process by PID.kill -9 1234
pkillTerminate a process by name.pkill firefox
pgrepFind process IDs by name.pgrep apache2
freeDisplay memory usage.free -h
dfDisplay disk space usage.df -h
duEstimate file space usage.du -sh /var/log
iostatReport CPU and I/O statistics.iostat
vmstatReport virtual memory statistics.vmstat
netstatNetwork statistics.netstat -tuln
ssDisplay socket statistics.ss -tuln
lsofList open files.lsof /var/log/syslog
straceTrace system calls and signals.strace -p 1234
dmesgKernel ring buffer.`dmesg
journalctlQuery systemd journal.journalctl -xe
systemctlControl systemd services.systemctl status httpd
serviceControl system services.service apache2 status
uptimeShow system uptime.uptime
whoShow who is logged on.who
wShow who is logged on and what they are doing.w
lastShow last logins of users.last
pingSend ICMP ECHO_REQUEST to network hosts.ping google.com
traceroutePrint the route packets take to the network host.traceroute google.com
ifconfigConfigure network interfaces.ifconfig eth0
ipShow/manipulate routing, devices, policy routing.ip addr show
hostnameShow or set the system’s hostname.hostname
nslookupQuery Internet name servers interactively.nslookup google.com
digDNS lookup utility.dig google.com
arpManipulate the system ARP cache.arp -a
routeShow/manipulate the IP routing table.route -n
tcpdumpCommand-line packet analyzer.tcpdump -i eth0
wiresharkNetwork protocol analyzer with GUI.wireshark
nc (netcat)Utility for reading and writing from/to network connections.nc -zv google.com 80
curlTransfer data from or to a server.curl -I http://google.com
wgetNon-interactive network downloader.wget http://example.com/file.zip
rsyncRemote file and directory synchronization.rsync -avz /path/to/source /path/to/dest
scpSecure copy (remote file copy program).scp file.txt user@remote:/path/to/dest
sshOpenSSH SSH client (remote login program).ssh user@remote
fdiskPartition table manipulator for Linux.fdisk -l
mkfsBuild a Linux file system.mkfs.ext4 /dev/sda1
mountMount a file system.mount /dev/sda1 /mnt
umountUnmount file systems.umount /mnt
fsckFile system consistency check and repair.fsck /dev/sda1
lsblkList information about block devices.lsblk
blkidLocate/print block device attributes.blkid
modprobeAdd and remove modules from the Linux Kernel.modprobe module_name
systemctlControl the systemd system and service manager.systemctl restart nginx
journalctlQuery and display messages from the journal.journalctl -u nginx.service
crontabSchedule jobs to run periodically.crontab -e
dateDisplay or set the system date and time.date
timedatectlControl the system time and date.timedatectl status
dfReport file system disk space usage.df -h
duEstimate file space usage.du -sh /var/log
ddConvert and copy a file.dd if=/dev/sda of=/dev/sdb bs=4M
findSearch for files in a directory hierarchy.find /var/log -name "*.log"
grepSearch text using patterns.grep "error" /var/log/syslog
tailOutput the last part of files.tail -n 100 /var/log/syslog
headOutput the first part of files.head -n 20 /var/log/syslog
lessView file contents in a scrollable manner.less /var/log/syslog
catConcatenate and display file contents.cat /var/log/syslog
echoDisplay a line of text.echo "Hello, World!"
chmodChange file permissions.chmod 755 script.sh
chownChange file owner and group.chown user:group file.txt
statDisplay file or file system status.stat file.txt
touchChange file timestamps or create an empty file.touch newfile.txt
sarCollect, report, or save system activity information.sar -u 1 3
sysctlConfigure kernel parameters at runtime.sysctl -a
archPrint machine architecture.arch
lsmodShow the status of modules in the Linux Kernel.lsmod
partedA partition manipulation program.parted /dev/sda
hwclockQuery and set the hardware clock (RTC).hwclock --show
uptimeTell how long the system has been running.uptime
hostnamectlControl the system hostname.hostnamectl
iostatReport CPU and I/O statistics.iostat -x 5 3
nmapNetwork exploration tool and security scanner.nmap -sP 192.168.1.0/24
telnetUser interface to the TELNET protocol.telnet google.com 80
ethtoolDisplay or change Ethernet device settings.ethtool eth0
ip addrShow/manipulate network interfaces.ip addr show
ip linkDisplay and modify network interfaces.ip link set eth0 up
dmidecodeDump computer’s DMI (some say SMBIOS) table contents in human-readable format.dmidecode

Top 100 Linux Troubleshooting Commands with Examples

CommandDescriptionExample
topDisplay tasks and system information.top
htopInteractive process viewer.htop
psDisplay current processes.ps aux
killTerminate a process by PID.kill -9 1234
pkillTerminate a process by name.pkill firefox
pgrepFind process IDs by name.pgrep apache2
freeDisplay memory usage.free -h
dfDisplay disk space usage.df -h
duEstimate file space usage.du -sh /var/log
iostatReport CPU and I/O statistics.iostat
vmstatReport virtual memory statistics.vmstat
netstatNetwork statistics.netstat -tuln
ssDisplay socket statistics.ss -tuln
lsofList open files.lsof /var/log/syslog
straceTrace system calls and signals.strace -p 1234
dmesgKernel ring buffer.`dmesg
journalctlQuery systemd journal.journalctl -xe
systemctlControl systemd services.systemctl status httpd
serviceControl system services.service apache2 status
uptimeShow system uptime.uptime
whoShow who is logged on.who
wShow who is logged on and what they are doing.w
lastShow last logins of users.last
pingSend ICMP ECHO_REQUEST to network hosts.ping google.com
traceroutePrint the route packets take to the network host.traceroute google.com
ifconfigConfigure network interfaces.ifconfig eth0
ipShow/manipulate routing, devices, policy routing.ip addr show
hostnameShow or set the system’s hostname.hostname
nslookupQuery Internet name servers interactively.nslookup google.com
digDNS lookup utility.dig google.com
arpManipulate the system ARP cache.arp -a
routeShow/manipulate the IP routing table.route -n
tcpdumpCommand-line packet analyzer.tcpdump -i eth0
wiresharkNetwork protocol analyzer with GUI.wireshark
nc (netcat)Utility for reading and writing from/to network connections.nc -zv google.com 80
curlTransfer data from or to a server.curl -I http://google.com
wgetNon-interactive network downloader.wget http://example.com/file.zip
rsyncRemote file and directory synchronization.rsync -avz /path/to/source /path/to/dest
scpSecure copy (remote file copy program).scp file.txt user@remote:/path/to/dest
sshOpenSSH SSH client (remote login program).ssh user@remote
fdiskPartition table manipulator for Linux.fdisk -l
mkfsBuild a Linux file system.mkfs.ext4 /dev/sda1
mountMount a file system.mount /dev/sda1 /mnt
umountUnmount file systems.umount /mnt
fsckFile system consistency check and repair.fsck /dev/sda1
lsblkList information about block devices.lsblk
blkidLocate/print block device attributes.blkid
modprobeAdd and remove modules from the Linux Kernel.modprobe module_name
systemctlControl the systemd system and service manager.systemctl restart nginx
journalctlQuery and display messages from the journal.journalctl -u nginx.service
crontabSchedule jobs to run periodically.crontab -e
dateDisplay or set the system date and time.date
timedatectlControl the system time and date.timedatectl status
dfReport file system disk space usage.df -h
duEstimate file space usage.du -sh /var/log
ddConvert and copy a file.dd if=/dev/sda of=/dev/sdb bs=4M
findSearch for files in a directory hierarchy.find /var/log -name "*.log"
grepSearch text using patterns.grep "error" /var/log/syslog
tailOutput the last part of files.tail -n 100 /var/log/syslog
headOutput the first part of files.head -n 20 /var/log/syslog
lessView file contents in a scrollable manner.less /var/log/syslog
catConcatenate and display file contents.cat /var/log/syslog
echoDisplay a line of text.echo "Hello, World!"
chmodChange file permissions.chmod 755 script.sh
chownChange file owner and group.chown user:group file.txt
statDisplay file or file system status.stat file.txt
touchChange file timestamps or create an empty file.touch newfile.txt
sarCollect, report, or save system activity information.sar -u 1 3
sysctlConfigure kernel parameters at runtime.sysctl -a
archPrint machine architecture.arch
lsmodShow the status of modules in the Linux Kernel.lsmod
partedA partition manipulation program.parted /dev/sda
hwclockQuery and set the hardware clock (RTC).hwclock --show
uptimeTell how long the system has been running.uptime
hostnamectlControl the system hostname.hostnamectl
iostatReport CPU and I/O statistics.iostat -x 5 3
nmapNetwork exploration tool and security scanner.nmap -sP 192.168.1.0/24
telnetUser interface to the TELNET protocol.telnet google.com 80
ethtoolDisplay or change Ethernet device settings.ethtool eth0
ip addrShow/manipulate network interfaces.ip addr show
ip linkDisplay and modify network interfaces.ip link set eth0 up
dmidecodeDump computer’s DMI (some say SMBIOS) table contents in human-readable format.dmidecode
unamePrint system information.uname -a
sarCollect, report, or save system activity information.sar -u 1 3
sysctlConfigure kernel parameters at runtime.sysctl -a
nstatNetwork statistics utility.nstat
ssDisplay socket statistics.ss -tuln
watchExecute a program periodically, showing output fullscreen.watch df -h
tsharkNetwork protocol analyzer (text-based Wireshark).tshark -i eth0
iftopDisplay bandwidth usage on an interface by host.iftop -i eth0
ipsetAdmin tool to manage IP sets in the Linux kernel.ipset list
iptablesAdmin tool to configure IPv4 packet filtering rules.iptables -L
firewalldDynamic firewall daemon with D-Bus interface.firewall-cmd --list-all
ping6Send ICMP ECHO_REQUEST to network hosts (IPv6).ping6 google.com
traceroute6Print the route packets take to the network host (IPv6).traceroute6 google.com
routeShow/manipulate the IP routing table.route -n
nmapNetwork exploration tool and security scanner.nmap -sP 192.168.1.0/24
digDNS lookup utility.dig google.com
hostDNS lookup utility.host google.com
netstatNetwork statistics.netstat -tuln
arpManipulate the system ARP cache.arp -a
routeShow/manipulate the IP routing table.route -n
iwconfigConfigure wireless network interfaces.iwconfig
iwlistGet more detailed wireless information.iwlist scanning
nmcliCommand-line client for NetworkManager.nmcli dev status
ifdownTake a network interface down.ifdown eth0
ifupBring a network interface up.ifup eth0
ssDisplay socket statistics.ss -tuln
ip aShow/manipulate network interfaces.ip a
ip linkDisplay and modify network interfaces.ip link set eth0 up
ip routeShow/manipulate the IP routing table.ip route show
ip addrShow/manipulate network interfaces.ip addr show
ethtoolDisplay or change Ethernet device settings.ethtool eth0
mtrNetwork diagnostic tool combining ping and traceroute.mtr google.com
bmonBandwidth monitor and rate estimator.bmon
iftopDisplay bandwidth usage on an interface by host.iftop -i eth0
iptrafNetwork monitoring utility.iptraf


Complex Linux Troubleshooting Commands (Combined with Other Commands)

Command CombinationDescriptionExample
`ps auxgrep process_name`Search for a specific process by name.
`du -sh *sort -rh`List directory sizes and sort them by size in descending order.
find / -type f -name "file"Find files by name starting from the root directory.find / -type f -name "error.log"
`dmesggrep -i error`Search for error messages in the kernel ring buffer.
`netstat -tulngrep LISTEN`Display listening network connections.
`ss -tulngrep LISTEN`Show listening sockets with ss command.
lsof -i :port_numberList open files and ports.lsof -i :80
tail -f /var/log/syslogContinuously monitor log file changes.tail -f /var/log/syslog
grep -r "search_term" /pathRecursively search for a term within a directory.grep -r "ERROR" /var/log
`df -hgrep /dev/sd`Show disk space usage for specific devices.
`top -b -n 1head -n 20`Batch mode operation of top, useful for logging or scripting.
strace -p $(pgrep process)Trace system calls and signals for a process.strace -p $(pgrep apache2)
`ip addr showgrep inet`Display IP addresses.
iostat -x 1 5Extended I/O statistics report every second for 5 times.iostat -x 1 5
watch -n 5 'df -h'Monitor disk usage every 5 seconds.watch -n 5 'df -h'
journalctl -fFollow the systemd journal in real time.journalctl -f
vmstat 1 5Report system performance statistics every second for 5 times.vmstat 1 5
ping -c 5 google.comPing a host 5 times.ping -c 5 google.com
find / -mtime -1Find files modified within the last 24 hours.find / -mtime -1
awk '{print $1}' file.txtExtract the first column from a text file using awk.awk '{print $1}' file.txt
sed -n '5,10p' file.txtPrint lines 5 to 10 from a file using sed.sed -n '5,10p' file.txt
tar czvf archive.tar.gz dir/Create a compressed tarball of a directory.tar czvf archive.tar.gz /path/to/dir
tcpdump -i eth0 port 80Capture network packets on port 80.tcpdump -i eth0 port 80
nmap -sP 192.168.1.0/24Perform a ping scan on a subnet using nmap.nmap -sP 192.168.1.0/24
curl -I http://google.comFetch HTTP headers using curl.curl -I http://google.com
wget -qO- http://google.comDownload the contents of a URL and display them.wget -qO- http://google.com
rsync -avz /src /destSynchronize files and directories between two locations.rsync -avz /path/to/source /path/to/destination
scp file.txt user@remote:/pathSecurely copy a file to a remote server using scp.scp file.txt user@remote:/path
ssh user@remote 'command'Execute a command on a remote server via SSH.ssh user@remote 'df -h'
fdisk -l /dev/sdaList partition tables for a specific device.fdisk -l /dev/sda
mkfs.ext4 /dev/sda1Create an ext4 file system on a partition.mkfs.ext4 /dev/sda1
mount /dev/sda1 /mntMount a file system.mount /dev/sda1 /mnt
umount /mntUnmount a file system.umount /mnt
fsck /dev/sda1Check and repair a file system.fsck /dev/sda1
lsblk -fList block devices with file system information.lsblk -f
blkid /dev/sda1Print the UUID of a file system.blkid /dev/sda1
modprobe module_nameLoad a kernel module.modprobe module_name
rmmod module_nameRemove a kernel module.rmmod module_name
systemctl restart serviceRestart a systemd service.systemctl restart nginx
journalctl -u serviceView logs for a specific systemd service.journalctl -u nginx.service
`crontab -lgrep job`List scheduled cron jobs and filter by job.
date +%Y-%m-%dPrint the current date in YYYY-MM-DD format.date +%Y-%m-%d
timedatectl set-time 'HH:MM:SS'Set the system time.timedatectl set-time '12:00:00'
df -h /dev/sda1Show disk space usage for a specific device.df -h /dev/sda1
`du -sh /var/*sort -rh`Display size of directories under /var and sort them by size.
dd if=/dev/zero of=/tmp/test.img bs=1M count=1024Create a 1GB test file using dd.dd if=/dev/zero of=/tmp/test.img bs=1M count=1024
find / -type f -mtime -1Find files modified in the last 24 hours.find / -type f -mtime -1
grep -i error /var/log/syslogSearch for case-insensitive error messages in syslog.grep -i error /var/log/syslog
tail -n 50 /var/log/syslogDisplay the last 50 lines of the syslog file.tail -n 50 /var/log/syslog
head -n 10 /var/log/syslogDisplay the first 10 lines of the syslog file.head -n 10 /var/log/syslog
less /var/log/syslogView the syslog file with less for easy navigation.less /var/log/syslog
`cat /etc/passwdgrep user`Search for a specific user in the passwd file.
chmod 755 script.shChange file permissions to make a script executable.chmod 755 script.sh
chown user:group fileChange the owner and group of a file.chown user:group file.txt
stat file.txtDisplay detailed information about a file.stat file.txt
touch /tmp/newfileCreate a new empty file or update the timestamp of an existing file.touch /tmp/newfile
sar -u 1 5Collect and display CPU usage every second for 5 seconds.sar -u 1 5
`sysctl -agrep net.ipv4`List all IPv4 network kernel parameters.
archPrint the machine architecture.arch
`lsmodgrep module`List currently loaded kernel modules and filter by name.
parted /dev/sda printDisplay partition information for a specific device.parted /dev/sda print
hwclock --systohcSet the hardware clock to the current system time.hwclock --systohc
uname -aPrint all system information.uname -a
ip addr show dev eth0Display detailed information about a specific network interface.ip addr show dev eth0
ip link set eth0 upBring a network interface up.ip link set eth0 up
ip route add default via 192.168.1.1Add a default gateway.ip route add default via 192.168.1.1
ethtool eth0Display or change Ethernet device settings.ethtool eth0
mtr google.comNetwork diagnostic tool combining ping and traceroute.mtr google.com
iftop -i eth0Display bandwidth usage on an interface by host.iftop -i eth0
tcpdump -i eth0 port 80Capture network packets on port 80.tcpdump -i eth0 port 80
nmap -sP 192.168.1.0/24Perform a ping scan on a subnet using nmap.nmap -sP 192.168.1.0/24
watch -n 5 'df -h'Monitor disk usage every 5 seconds.watch -n 5 'df -h'
journalctl -fFollow the systemd journal in real time.journalctl -f
vmstat 1 5Report system performance statistics every second for 5 times.vmstat 1 5
ping -c 5 google.comPing a host 5 times.ping -c 5 google.com
find / -mtime -1Find files modified within the last 24 hours.find / -mtime -1
awk '{print $1}' file.txtExtract the first column from a text file using awk.awk '{print $1}' file.txt
sed -n '5,10p' file.txtPrint lines 5 to 10 from a file using sed.sed -n '5,10p' file.txt
tar czvf archive.tar.gz dir/Create a compressed tarball of a
Command CombinationDescriptionExample
tar xzvf archive.tar.gz -C /pathExtract a tar.gz archive to a specified path.tar xzvf archive.tar.gz -C /path/to/extract
find /path -type f -exec ls -lh {} \;Find files and list them with detailed information.find /var/log -type f -exec ls -lh {} \;
chmod -R 755 /path/to/dirRecursively change permissions of a directory and its contents.chmod -R 755 /var/www/html
chown -R user:group /path/to/dirRecursively change the owner and group of a directory and its contents.chown -R user:group /var/www/html
xargs -n 1Build and execute command lines from standard input.`echo “file1 file2 file3”
`ps -eo pid,ppid,cmd,%mem,%cpu –sort=-%memhead`List processes sorted by memory usage.
watch -n 1 'cat /proc/meminfo'Monitor memory usage in real-time.watch -n 1 'cat /proc/meminfo'
vmstat -sDisplay summary of system statistics.vmstat -s
iostat -m 1Monitor disk I/O statistics in megabytes.iostat -m 1
top -u userDisplay processes for a specific user.top -u root
iftop -n -PDisplay bandwidth usage without resolving hostnames and show ports.iftop -n -P
tcpdump -A -i eth0Capture and display packets in ASCII.tcpdump -A -i eth0
ethtool -S eth0Display network interface statistics.ethtool -S eth0
netstat -iDisplay network interface statistics.netstat -i
ip -s linkDisplay network statistics for all interfaces.ip -s link
ss -sDisplay socket statistics summary.ss -s
iptables -L -v -nList all iptables rules with detailed information.iptables -L -v -n
firewall-cmd --list-allDisplay current firewalld settings.firewall-cmd --list-all
ping -I eth0 google.comSend ICMP ECHO_REQUEST from a specific interface.ping -I eth0 google.com
nmap -A 192.168.1.1Perform a comprehensive scan on a host, including OS detection.nmap -A 192.168.1.1
curl -o /dev/null -s -w "%{http_code}\n" http://google.comCheck the HTTP status code of a URL.curl -o /dev/null -s -w "%{http_code}\n" http://google.com
`wget -O- http://example.comgrep “HTML”`Download a webpage and search for a specific string.
rsync -avz --delete /src /destSynchronize files and directories, deleting files at the destination if they don’t exist at source.rsync -avz --delete /path/to/source /path/to/destination
scp -r user@remote:/path /localSecurely copy a directory from a remote server.scp -r user@remote:/path/to/remote /path/to/local
ssh -L 5900:localhost:5900 user@remoteCreate an SSH tunnel for VNC.ssh -L 5900:localhost:5900 user@remote
dd if=/dev/sda of=/dev/sdb bs=4MClone a disk using dd.dd if=/dev/sda of=/dev/sdb bs=4M
find /var/log -type f -mtime +30 -deleteFind and delete log files older than 30 days.find /var/log -type f -mtime +30 -delete
`grep -E ‘errorfailcritical’ /var/log/syslog`
`tail -f /var/log/sysloggrep “error”`Continuously monitor log file for specific strings.
head -n 50 /var/log/syslogDisplay the first 50 lines of the syslog file.head -n 50 /var/log/syslog
less +F /var/log/syslogView the syslog file with less in follow mode.less +F /var/log/syslog
awk '{print $1, $4}' file.txtExtract and print specific columns from a text file using awk.awk '{print $1, $4}' file.txt
sed 's/error/ERROR/g' file.txtReplace all occurrences of a string in a file using sed.sed 's/error/ERROR/g' file.txt
`tar cf – .(cd /new/dir && tar xf -)`Copy a directory structure preserving permissions and timestamps.
tcpdump -i eth0 -w capture.pcapCapture network packets and save to a file.tcpdump -i eth0 -w capture.pcap
nmap -p 1-65535 localhostScan all ports on the local machine using nmap.nmap -p 1-65535 localhost
curl -X POST -d "param1=value1&param2=value2" http://example.comSend a POST request with data using curl.curl -X POST -d "param1=value1&param2=value2" http://example.com
wget -r -np -k http://example.comDownload an entire website recursively using wget.wget -r -np -k http://example.com
rsync -av --progress /src /destSynchronize files and show progress.rsync -av --progress /path/to/source /path/to/destination
scp -i /path/to/key file user@remote:/pathUse a specific SSH key to securely copy a file to a remote server.scp -i /path/to/key file user@remote:/path
ssh user@remote 'df -h; free -m'Execute multiple commands on a remote server via SSH.ssh user@remote 'df -h; free -m'
dd if=/dev/zero of=/tmp/testfile bs=1M count=1024Create a 1GB test file filled with zeros using dd.dd if=/dev/zero of=/tmp/testfile bs=1M count=1024
find / -type f -exec md5sum {} \;Generate MD5 checksums for all files on the system.find / -type f -exec md5sum {} \;
grep -v '^#' /etc/fstabDisplay non-comment lines from a configuration file.grep -v '^#' /etc/fstab
tail -n +10 file.txtDisplay lines starting from line 10.tail -n +10 file.txt
head -c 100 file.txtDisplay the first 100 bytes of a file.head -c 100 file.txt
awk '/pattern1/ && /pattern2/' file.txtSearch for lines containing multiple patterns using awk.awk '/pattern1/ && /pattern2/' file.txt
sed -i 's/foo/bar/g' file.txtEdit a file in place, replacing all occurrences of a string using sed.sed -i 's/foo/bar/g' file.txt
`tar czf – dirssh user@remote ‘cat > /path/to/backup.tar.gz’`Create a tarball and send it directly to a remote server via SSH.
tcpdump -nn -v -i eth0Capture and display packets without resolving hostnames or ports.tcpdump -nn -v -i eth0
nmap -O 192.168.1.1Detect the operating system of a remote host using nmap.nmap -O 192.168.1.1
curl -s -o /dev/null -w "%{time_total}\n" http://example.comMeasure the total time taken to download a URL using curl.curl -s -o /dev/null -w "%{time_total}\n" http://example.com
wget --limit-rate=100k http://example.com/file.zipDownload a file with a specified download rate limit using wget.wget --limit-rate=100k http://example.com/file.zip
rsync -azP user@remote:/path/to/src /local/destSynchronize files with partial transfer and compression.rsync -azP user@remote:/path/to/src /local/dest
scp -3 user1@host1:/path user2@host2:/pathSecurely copy files between two remote hosts.scp -3 user1@host1:/path user2@host2:/path
ssh -R 8080:localhost:80 user@remoteCreate a reverse SSH tunnel.ssh -R 8080:localhost:80 user@remote
`dd if=/dev/sda bs=512 count=1hexdump -C`Display the MBR (Master Boot Record) of a disk in a human-readable format.
find /var/log -type f -size +100MFind files larger than 100MB.find /var/log -type f -size +100M
grep -c "ERROR" /var/log/syslogCount occurrences of a specific string in a log file.grep -c "ERROR" /var/log/syslog
`tail -n 1000 /var/log/sysloggrep “error”less`
awk 'NR>=10 && NR<=20' file.txtExtract lines from 10 to 20 from a file using awk.awk 'NR>=10 && NR<=20' file.txt
sed -e 's/foo/bar/' -e 's/baz/qux/' file.txtApply multiple search-and-replace patterns using sed.sed -e 's/foo/bar/' -e 's/baz/qux/' file.txt
`tar czf – dirssh user@remote ‘dd of=/path/to/backup.tar.gz’`Create a tarball and send it to a remote server using dd.
tcpdump -i eth0 'port 80 and (((ip[6:2] & 0x1fff) = 0) and (tcp[13] = 0x18))'Capture only complete HTTP packets.`tcpdump -i eth0 ‘port 80 and (((ip[6:2] & 0x1fff) =

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x