Bash Knowhow

- 1 min

Bash Knowhow

ln -s {/path/to/file-name} {link-name}

cd />path/to/where/links/will/go
find /where/files/are/linked/from -type f -name "*.png" -exec ln -s '{}' . ';' -maxdepth 3

Copy many files somewhere

Take all files that end with something (in this case it is .xls) and copy it to the target directory.

find ./ -name '*.xsls' -exec cp -prv '{}' '/path/to/targetDir/' ';'

Find and delete by type

$ find . -name ".RAW" -delete

WGET from google drive

wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=1-O7vWiMa3mDNFXUoYxE3vkKZQpiDXUCf' -O train_imgs.zip

Find CUDA driver

/usr/local/cuda/bin/nvcc --version
python -c "import torch; print(torch.version.cuda)"

Add postfix

$ for i in *.png; do mv "$i" "${i%.*}_w300.png"; done 
comments powered by Disqus
rss facebook twitter github gitlab youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora