Sunday, April 20th, 2008

rpl - A Find & Replace Terminal Tool

Tonight I have mainly been working on Whird. I have been rewriting large chunks of code in an effort to optimise a bunch of functions. As a result of this, I had to change a series of strings in a number of files. As per normal when it comes to fiddly grep, sed and awk commands, I fired up Google and searched for some pointers. Whilst refreshing my memory, I came across a comment by an anonymous reader who suggested using the rpl command.

I had not previously come across rpl before, so I investigated. Turns out that rpl is a really handy text replacement tool — it makes recursive text replacement commands really simple; as simple as:

rpl [options] old_string new_string target_file(s)

Available options are:

--version          show program's version number and exit
-h, --help         show this help message and exit
-L, --license      show the software license
-x SUFFIX          specify file suffix to match
-i, --ignore-case  do a case insensitive match
-w, --whole-words  whole words (old_string matches on word boundaries only)
-b, --backup       make a backup before overwriting files
-q, --quiet        quiet mode
-v, --verbose      verbose mode
-s, --dry-run      simulation mode
-R, --recursive    recurse into subdirectories
-e, --escape       expand escapes in old_string and new_string
-p, --prompt       prompt before modifying each file
-f, --force        ignore errors when trying to preserve permissions
-d, --keep-times   keep the modification times on modified files
-t, --use-tmpdir   use $TMPDIR for storing temporary files
-a, --all          do not ignore files and directories starting with .

rpl is available to install from the Ubuntu repositories, install with the following command:

sudo apt-get install rpl

For more information about rpl, see: http://www.laffeycomputer.com/rpl.html


Monday, September 24th, 2007

CPU Temperature via Terminal

Enter the following command in your Linux terminal to get the current running temperature of your CPU.

acpi -t

This is a handy command and one that I should be able to put to good use. My desktop is a little bit old and crusty and is forever overheating in the summer. It should be possible to use this command in conjunction with cron to set-up a warning system to let me know when my system is about to go into meltdown.

via the Ubuntu Forums


Browse Posts by Tag

13th advocacy antispam artwork bash bbc bcs bittorrent bloggers blogs boobs bookmarklets cli code colour commands comments conduit crontab crunchbanglinux debian design development email fluxbuntu fonts fun gedit gimp gnome google gos hack hacks hardware hosting images javascript language launchpad licenses life lincslug linux lugradio madness meme memes microsoft mint misc monkeys motu muppets mysql n95 networking nokia openbox openoffice opensuse packaging penguins php phpmyadmin podcast ppa printer progbox programming projects puppy python random rants realplayer revu scripts security shell software ssh terminal terminator themes tools twitter typography ubuntu ubuntucse unitedhosting video virtualisation webcam webdesign whird wiki windows woot xfce4 zombies