Linux Related Command Reference
From SusoSight
- Linux pipeline commands - these get their own page because there are so many useful recipies.
Find (once and for all)
How to execute something off of a find command:
find . -type f -exec chmod 600 \{} \;
Note only one backslash before the {} and one before the ;.
CD Recording
First you need to create an ISO image:
mkisofs -J -o output.iso input_directory
Then you will run cdrecord to write the image to CD.
cdrecord -v dev=/dev/cdrecordingdevice output.iso
DVD
growisofs -dvd-compat -Z /dev/dvd=image.iso
OpenSSL
Removing the passphrase from an SSL keyfile:
openssl rsa -in www.domainname.com.key -out www.domainname.com.key-nopass
Note for others. This is dangerous and you shouldn't do it unless you know what you are doing. If you don't already know this, then don't do it.
DVD playing/ripping
Rip chapters of a DVD and include english
mencoder dvd://3 -chapter 5-6 -slang en -subdelay 1 -ovc lavc -lavcopts vpass=1 -oac copy -o output.avi
You might have to use -oac pcm or -oac lavc with the -af volume=10 options so that its not too quiet.
Re-encoding for youtube or other video sites. These sites require lower quality video at smaller resolutions so that space is not wasted. Try this on:
mencoder input.mpeg -vf scale=360:240 -o output.mpeg -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4
SSL client
This command allows you to connect to a host and negotiate an SSL session and then type in what you want to send to the server the same way you would use telnet for diagnostics.
- openssl s_client -connect hostname:443
Audible ping
ping 64.32.179.56 | tr : ^G (Use Ctrl-v Ctrl-g to get the control g character)
Sysrq logging
If you need to see the sysrq output without being at the console, you can run this:
echo t > /proc/sysrq-trigger
Then look in /var/log/messages.