Show all man pages containing the
List files in a zip archive
unzip -l the.zip
Copy with parents
To copy loc, creating /the/file directories beneath it at the destination:
cp --parents /the/file/loc /to/wherever/.
To find out info about an image from the command line:
The command comes from the imagemagick package.
EOT stands for End Of Text. You can send an EOT via ctrl-d.
Change ownership of a symlink
chown -h user:group symlink
Without the -h switch it will change the ownership of the symlink target.
Forward email from user to email address
Create a hidden file called .forward in the user’s home directory that contains the email address you’d like to forward mails to.
Send test email
echo "This will go into the body of the mail." | mail -s "This is the subject of the email" email@example.com
See which processes are using a port
-a for all ports -n for port numbers (instead of service names looked up in /etc/services) -p for processes
See which ports are open
Nmap will show ports as open, filtered, or closed. If filtered, it means nmap doesn’t know the port’s state because some network obstacle is in the way).
Compute the MD5 sum and store it in a file using:
md5sum file > file.md5
Check for validity with:
md5sum -c file.md5
Scan root (writing log to clamscan.log):
clamscan -r-lclamscan.log /
List infected files:
grep FOUND clamscan.log | sed 's/ /\\ /g' | sed 's/:\\ [^:]* FOUND//g' | xargs ls -l