https://github.com/chibby0ne/spaces_to_underscores
Simple bash script that replaces filenames' whitespaces for underscores
https://github.com/chibby0ne/spaces_to_underscores
bash script underscore whitespaces
Last synced: about 1 month ago
JSON representation
Simple bash script that replaces filenames' whitespaces for underscores
- Host: GitHub
- URL: https://github.com/chibby0ne/spaces_to_underscores
- Owner: chibby0ne
- License: mit
- Created: 2018-03-24T14:47:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T15:32:12.000Z (about 8 years ago)
- Last Synced: 2025-06-19T14:51:55.548Z (12 months ago)
- Topics: bash, script, underscore, whitespaces
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spaces to Underscores
Found myself fighting with the escaped spaces in the shell, one to many times.
Renames files in the given directory, by replacing groups of adjacent whitespaces with an underscore (\_).
# Usage
When it finds something to rename:
```
meeseeks@home:~/test_dir $ ./spaces_to_underscores.sh .
Changed a dir to a_dir
Changed a file to a_file
```
When it doesn't find something to rename:
```
meeseeks@home:~/test_dir $ ./spaces_to_underscores.sh .
No files with spaces. No files renamed.
```
When the given directory is not searchable by the current user:
```
meeseeks@home:~/test_dir $ ./spaces_to_underscores.sh .
No files with spaces. No files renamed.
```
```
meeseeks@home:~/test_dir $ ./spaces_to_underscores.sh .
Cannot search root_dir directory. Check directory permissions.
```
## License
MIT