Random Linux Tips and Tricks

Preface

This page contains a random collection of Linux tips and tricks. These aren't really tips or tricks, just some shell commands that are useful for every Linux sysadmin.

CD Burning Tips and Tricks

Create an ISO:

/usr/bin/mkisofs -r -x -o file.iso /files/to/image

Create an ISO Preserving Ownership and ACL and Excluding a directory:

/usr/bin/mkisofs -R -x /files/to/image/dir/to/exclude -o file.iso /files/to/image

Burn an ISO to CD:

/usr/bin/cdrecord dev=0,0,0 speed=4 -data file.iso

Burn an ISO to DVD:

/usr/bin/dvdrecord dev=0,1,0 -dao file.iso

or

growisofs -speed=4 -Z /dev/dvd=/home/nfs/backups/root.iso

Erase a CD-RW:

/usr/bin/cdrecord dev=0,0,0 speed=4 blank=all

Rip a CD as an ISO:

/bin/dd if=/dev/cdrom of=file.iso

Email Tips and Tricks

Send an email:

/usr/bin/echo "message here" | /usr/bin/mailx -s "Subject Here" recipient-email@example.com

Send a file by email:

/usr/bin/echo "see attachment" | /usr/bin/mailx -s "I'm sending a file" -a /file/to/send recipient-email@example.com

File Tips and Tricks

Truncate the contents of a file:

> file/to/truncate

Eliminate "reserve space" from non-root (/) partitions, freeing for other uses:

> tune2fs -r 0 /dev/sda4

Copyright ©2002-2024 Wade Wassenberg
Last Modified: Tuesday June 10, 2014. 
If you have questions, comments, or if you find any part of this document to be inaccurate or incorrect, please submit your feedback to webmaster@wass.homelinux.net.