command

Linux Shell Commands – quick how-tos

Following are linux commands, tricks for doing regular tasks. Rename files: replace space by _ in linux: for files in *; do mv “$files” `echo $files | tr ‘ ‘ ‘_’`; done Change case of multiple file names: for files in *; do mv $files `echo $files | tr ‘[:upper:]’ ‘[:lower:]’`; done Find files having large size: ls -hlRtr | awk ‘{print $5 ” ” $6 “-” $7 ” “$9}’ | grep ‘[0-9]G ‘ – Variants: grep ‘[0-9][0-9][0-9]M’ will give you files having sizes xxxMBs. Find and replace text from multiple files : find ./ -type f | xargs perl...