linux_notes
This is an old revision of the document!
Table of Contents
tasks
remove large directories
mkdir empty_dir rsync -a --delete empty_dir/ yourdirectory/
per https://unix.stackexchange.com/questions/37329/efficiently-delete-large-directory-containing-thousands-of-files this will be faster than “rm -rf” or find + “-exec rm -f”.
stackoverflow answers I came across
- remove leading and trailing spaces - https://unix.stackexchange.com/a/102021/198064
- search for a string and count the number of characters per line - https://unix.stackexchange.com/questions/400650/counting-the-characters-of-each-line-with-wc
get file modified time in shell script
date +%Y%m%d_%H%M%S -r $input_file
Used it in | https://github.com/KamarajuKusumanchi/rutils/blob/master/python3/black_on_selected.sh
Found it in | https://stackoverflow.com/questions/16391208/print-a-files-last-modified-date-in-bash
linux_notes.1633016812.txt.gz · Last modified: 2021/09/30 15:46 by raju