Julie's command line cheatsheet - meyermicrobiolab/Meyer_Lab_Resources GitHub Wiki
. current directory
.. parent directory
~ home directory
cd ..
cat file1 file2 > newfile
cat *_R1.fastq.gz > Halo_R1.fastq.gz
split -l [# of lines] file
split -b [# of bytes] file
grep -c "^>" file.fa
grep -c "^+" file.fastq
sed 's/^M/\n/g' file_in > file_out
[You MUST type this in, not cut and paste. To get ^M, hold down CTRL then hit V then M]
I wanted to add a suffix (here "-A") to my amplicon files after cutadapt. Use command line to navigate to the directory containing files to be edited then copy and paste in the following for forward reads:
for f in *R1_cut.fastq.gz; do
mv -- "$f" "${f%_*_L001_R1_cut.fastq.gz}-A_R1_cut.fastq.gz"
done
Now for the reverse reads:
for f in *R2_cut.fastq.gz; do
mv -- "$f" "${f%_*_L001_R2_cut.fastq.gz}-A_R2_cut.fastq.gz"
done