Delete File with Dash/Hyphen in Name Within Linux/Unix

If you have a file named “-file” without the quotes, you would typically delete it using:

rm -rf -file

Except that doesn’t work. My CentOS complained to me with the following message (though not all operating systems may supply this, so this is mainly for those whose OS does not supply this tip):

rm: invalid option -- 'l'
Try `rm ./-file' to remove the file `-file'.
Try `rm --help' for more information.

The suggested tip here works well. Simply running the following command should delete the “-file” file.

rm -rf ./-file

Keep in mind this limitation does not apply only to the rm command, but a large number of commands including touch and others. It is the most annoying for the rm command, since you are trying to remove the file. For these other commands, you would also have to prepend the file name with a ./ in order for this to work.

Posted in Guides | Tagged | Leave a comment

Mac Trick: Invert Screen Colors

To invert the colors on your mac, use the shortcut ⌘ (command key) + option/alt + control + 8 (all at the same time). For those not confortable with shortcuts, you can do the same by going to  (Apple logo at upper-left hand corner_ -> System Preferences, and clicking “Universal Access” under Personal. From there, checking ‘White on Black’ will have the same effect.

Take a look at the two images below of what my screen normally looks like, and what my screen looks like when the colors are inverted

Do keep in mind if you take any screenshots in the ‘inverted color’ mode, the screenshot will not come out with inverted colors. If you would like to have inverted colored screenshots, you must manually invert the image in an image editing program.

Posted in Guides | Leave a comment

Installing Recordmydesktop on CentOS and RHEL

Recordmydesktop is a command line (and GUI) program that can be used to record a video of the CentOS Desktop (among other distros as well). To install it on CentOS, begin by installing the required dependancies:

yum install gcc make libXext-devel libSM-devel libICE-devel zlib-devel libXfixes-devel libXdamage-devel libvorbis-devel libtheora-devel

Because CentOS does not official an RPM for recordmydesktop, we will have to install it from source. We will download a tar of the source code, untar the source, and remove the tar file:

wget http://downloads.sourceforge.net/project/recordmydesktop/recordmydesktop/0.3.8.1/recordmydesktop-0.3.8.1.tar.gz
tar xf recordmydesktop-0.3.8.1.tar.gz
rm -rf recordmydesktop-0.3.8.1.tar.gz

Now, let’s go into the folder and install Recordmydesktop.

cd recordmydesktop-0.3.8.1
./configure
make
make install

If you did not set a custom prefix, running /usr/bin/recordmydesktop should begin recording your desktop! Use the following command (just as with most commands) to view the options available:

recordmydesktop --help
Posted in Guides | Tagged , , | Leave a comment