Linux Tips

This is a small collection of Linux and KDE tricks to jog my memory. Maybe others will find them useful.

Emacs

DCOP

Shell script to rename a konsole window with an application name
dcop $KONSOLE_DCOP_SESSION renameSession "Matlab R14"
/home/rob/Matlab7.0/bin/matlab -nodesktop
dcop $KONSOLE_DCOP_SESSION renameSession Shell #Rename back to "Shell"

Bash: Complex find operations

Run a Matlab job in the background

With this line you can log in to a remote machine, start a Matlab job (or anything else for that matter), then log off again. The machine will automatically quit Matlab once it's finished running your analysis.
nohup matlab7 < runBoot.m > /dev/null &
In case that looks like gibberish to you: "nohup" keeps the command running even if you log off. "Matlab7" is a script that starts Matlab from a terminal (no GUI). "runBoot.m" is a Matlab script with the commands you want to be run. The output of this is all fed to Linux's black hole (/dev/null) and the ampersand gets back your command prompt.

List only directories

ls -l | grep "^d" or ls -dla */ .*/
i.e. list detailed contents of current directory then pipe to grep and display only lines which start with the character "d"

Passwordless SSH

This is particularly useful if you want to automate backups to another machine over an SSH connection (e.g. with scp or rsync).

Medline quick search

Ok, not really a Linux tip but to get Konqueror and Firefox to do a Medline quick search you can use this shortcut (for Konqueror. In Firefox substitute "\{@}" with "%s":
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&term=\{@}

Useful Links