Bash Scripts

Bash Scripts

Bash Scripts #

How to discard changes in VScode? #

Navigate to reporsitory (has .github folder) with changes. Then, git restore <file>

Activate conda environment in bash script #

source ~/miniconda3/etc/profile.d/conda.sh
conda activate ENV

SBATCH Array jobs #

#SBATCH -J array-job					
#SBATCH -a 1-3
#SBATCH -o array-job.%A.%a.log

id_list="./id_list.txt"
id=`head -n $SLURM_ARRAY_TASK_ID $id_list | tail -n 1`
python3 script.py -in $id

srun gpu #

srun -N 1 --ntasks-per-node 2 -p v100 -q gpu --gres=gpu:1 --mem=50G --pty /bin/bash

run scripts #

sbatch test.slm

check sequence process #

squeue -u username

cancel sequence #

scancel jobID

copy files into another folder #

cp ./*.pdb ../newfoler

count files in a directory in command line #

cd directory
ls -l | wc -l