Friday, July 7, 2017
If you need to copy or move only a portion of your files based on some rule for their name, use regular expressions.
If you need to find files with specific number, lets say those with _1_ or _2_ in the name of the file, use the following regex:
Now simply to copy those files capture the output of the command:
For example, these are all fastqc.zip files in a folder:
Wednesday, July 5, 2017
If you need to extract lines before and after a line with a string you search for using grep use -B flag for before and -A for after to get lines wanted:
If you need same number of lines before and after use -C flag