Last active
October 22, 2015 21:37
-
-
Save mdyzma/889db60b68d1627ce487 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Biosnips to store some good oneliners and linux tricks | |
# to perform much more efficiently | |
# Michal Dyzma 2015 | |
# Creating automaticly folders with actual date | |
# set alias in .bashrc | |
alias "today"="date +%F" | |
# type in console | |
mkdir foo-$(today) | |
#================== | |
# Create multiple files and folders | |
#folders | |
mkdir -p tutorial/{content/chapter-{1..8}/{data,img},docs,styles,utilities} | |
#files | |
touch sekwencje/prot{A,B,C}_R{1,2}.fastq | |
#================== | |
# line will find differences in 2 text files and first pipe will throw +/- at front of each line | |
# (same or different), #second pipe will get all different lines (-) and put them to separate | |
# out.txt file. | |
diff -u file1 file2 | sed -n '1,2d;/^[-+]/p' | grep '^-' > out.txt | |
#================== | |
#oneliner replacing tabs with comas generating csv file | |
sed 's/\t/','/g' < input > output | |
#================== | |
#alternative replacicng spaces with comas | |
sed 's/' '/','/g' < input > output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment