linux

Linux Command Reference

Included below are some commands that I have found, created or tweaked to help make life easier along the way. I have collected them here so I can easily refer to them instead of buildling up the commands from scratch. Some are very simple, others are approaching "script" level. Hopefully others will find them useful as well.

Misc Linux Commands

Find and compress all PNG files under the apache web root:

Using a Webcam with Linux

It's actually surprisingly easy. Install fswebcam (preferably via RPM) and then run this command:

/usr/bin/fswebcam --quiet --background --loop 120 --skip 40 \
--timestamp "%d-%m-%Y %H:%M:%S (%Z)" --png --palette png \
--font /usr/share/fonts/liberation/LiberationMono-Regular.ttf \
--resolution 640x480 --info "Web Cam Stream" --top-banner \ --save /var/www/webcam/webcam.png

Linux Package Management Commands

Yes, some distros still use rpm.

Extract files from an RPM:

rpm2cpio filename.rpm | cpio -idv

Unpack an RPM into /tmp/deleteme without installing it:

rpm -ivh -root /tmp/deleteme --nodeps --noscripts package.rpm

Install

rpm -ivh

Upgrade (use this except for kernels)

rpm -Uvh

Find out what's installed

rpm -qa

See which package a file belongs to

rpm -qf