title | description | category | subcategory | tags | |||
---|---|---|---|---|---|---|---|
Managing files |
This code helps with managing file names |
computing |
tips_tricks |
|
First, expand rm capabilities by:
shopt -s extglob
Then use find and remove:
find . ! -name 'file.txt' -type f -exec rm -f {} +
It has a lot of good options but one pretty useful for removing whitespaces and set all to lowercase:
rename -c --nows <fileName>
Set umask 007 in our .bashrc. Then newly created directories will have 770 (rwxrwx---) permissions, and files will have 660 (rw-rw----).