Some useful bash scripts

1. Copy files from a folder according to the list of name in a file to a new folder

Github

This bash script will copy files according to the listed names in a file from a folder into a new folder.

Prerequisities

  • Bash

Usage

The following is a bash script, run it with:
sudo chmod +x copy.sh
./copy.sh

Set the correct paths:

source_directory=“./Vaca_8″ # Folder where all files are located
destination_directory=“./Selected_100_structures/Vaca_8″ # Folder where selected files will be copied
list_file=“Vaca_8_selected_structure_names_PCA.txt“

 

Example of content of the output file 'output_all.txt', listing the name of the characterized structure and its corresponding minimum atomic distance in Å: