This page is a collection of resources and notes we’ve taken over the years.
if [ -z "$(ls -A /path/to/dir)" ]; then
echo "Empty"
else
echo "Not Empty"
fi
for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
mv "$file" `echo $file | awk '{gsub(/>>/,"_")} 1'`
base_orig=`echo $j | cut -d "." -f1`; base_new=`echo $j | cut -d "." -f1 | rev | cut --complement -d "_" -f2 | rev | cut -d "_" -f 4-`; echo $base_spc $base_orig $base_new;
for i in `ls ./P*/dwi/*.nii.gz | cut -d . -f1`; do if [[ `cat ${i}.json | grep "SeriesDescription" | grep -o "_FA"` == "_FA" ]] || [[ `cat ${i}.json | grep "SeriesDescription" | grep -o "_ColFA"` == "_ColFA" ]] || [[ `cat ${i}.json | grep "SeriesDescription" | grep -o "_EXP"` == "_EXP" ]]; then echo $i; fi; done
alias ls=l #for example
in ~/.ssh/config (a text file) contains, for example:
Host typenameofserver
User typeyourusername
HostName typecompletehostname #e.g. graham.computecanada.ca
so that now i can type ssh graham and it will know to ssh to username@graham.computecanada.ca