Archive For The “linux/unix” Category

Bash shortcuts

By |

Useful but no well known shortcuts to editing previous commands in bash !! expands to the last command and all arguments !* all arguments of the last command, but not the command itself !$ last argument of the last command !foo last command beginning with “foo” !?bar ast command containing “bar” ^foo^bar last command with…

Read more »

The amazing GNU parallel

By |

The GNU parallel allows you take advantage of multiple cores on your machine Nice (bioinformatics heavy) explanation here

Read more »

aligning text in vim

By |

Lately, i’ve been pulling out rnaseq reads and trying to build contings by hand in a quick and dirty manner by

A nifty trick is to use vim to line up your strings on MYSTRING. I did this using the tabularize.vim plugin.

This basically says, line up all lines on TACCAT. Everything before…

Read more »

bash command reuse

By |

When you get tired of typing the same argument over and over Alt + . cycles through previous args On the command line you can use substitutions like these > echo 1 2 3 4 # reuse the 3rd argument of previous command > echo !:3 > ls -l /path/to/really/long/dir # last command line argument…

Read more »

push and pop your way around the shell

By |

On the bash shell, it’s helpful for me have a list of directories at my disposal. That way I can easily jump from one directory to another without having to type it all in. Even with tab completion, that’s a pain. Hence pushd. pushd is not well documented, but basically you can push onto a…

Read more »

The screen command

By |

There are occasions when you have a long running process and don’t want the job to end as soon as you logout. Enter the screen command. To start, run screen Run your job, type your commands, run your perl script, etc. Then detach your session with Ctrl-a d. You can then logout of the system,…

Read more »

rsync over ssh basics

By |

Rsync is useful utility for keeping two directories in sync. The best part is that it works even on different machines. I recently wished to rsync a directory from cluster1 to cluster2 and submit the job via qsub. This won’t work without a little work because by default, a password will be required to access…

Read more »

Emacs/ESS shortcuts

By |

C-x 2 split window vertically C-x 3 split window horizontally C-x 0 close this window C-x 1 close all except this window C-x ^ Make the selected window taller, at the expense of the other(s) (enlarge-window). C-u 3 C-x ^ Make selected window 3x larger than C-x ^ C-x } Widen the selected window (enlarge-window-horizontally)….

Read more »

Disable ESS smart underscore

By |

This gets me every time. ESS on my setup by default will change underscore (_) to an arrow (

Read more »