Archive For The “linux/unix” Category
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…
The GNU parallel allows you take advantage of multiple cores on your machine Nice (bioinformatics heavy) explanation here
Lately, i’ve been pulling out rnaseq reads and trying to build contings by hand in a quick and dirty manner by
1 |
samtools view unmapped.bam | grep MYSTRING |
A nifty trick is to use vim to line up your strings on MYSTRING. I did this using the tabularize.vim plugin.
1 |
:Tabularize /TACCAT/r0c1l0 |
This basically says, line up all lines on TACCAT. Everything before…
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…
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…
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,…
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…
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)….