Tuesday, July 21, 2015

Get command from history in bash

To get a command you typed in the past use history:

history | grep 'ln -s'
 2679  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C1_S1_L001_L004_R1_R2_001/Pass2_1/Aligned.out.sam 90715018.Aligned.out.sam
 2681  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C2_S1_L001_L004_R1_R2_001/Pass2_2/Aligned.out.sam 317155.2.Aligned.out.sam
 2683  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C3_S1_L001_L004_R1_R2_001/Pass2_2/Aligned.out.sam 7103002.3.Aligned.out.sam
 2685  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C3_S1_L001_L004_R1_R2_001/Pass2_3/Aligned.out.sam 7103002.3.Aligned.out.sam
 2687  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C3_S1_L001_L004_R1_R2_001/Pass2_3/Aligned.out.sam 7103002.3.Aligned.out.sam
 2689  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C4_S1_L001_L004_R1_R2_001/Pass2_4/Aligned.out.sam 1042702.4.Aligned.out.sam
 2691  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C5_S1_L001_L004_R1_R2_001/Pass2_5/Aligned.out.sam 313605.4.Aligned.out.sam
 2693  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C6_S1_L001_L004_R1_R2_001/Pass2_6/Aligned.out.sam 24635.2.Aligned.out.sam
 2694  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C7_S1_L001_L004_R1_R2_001/Pass2_7/Aligned.out.sam 2108.4.Aligned.out.sam
 2696  ln -s /home/towerraid/tina/150313_NS500418_0108_AH5Y5YBGXX/Data/Intensities/BaseCalls/C8_S1_L001_L004_R1_R2_001/Pass2_8/Aligned.out.sam 1448.1.Aligned.out.sam

... 

No comments:

Post a Comment