Skip to content

Recursively replace spaces with underscores in file and directory names.

License

Notifications You must be signed in to change notification settings

ikosa/space_to_underscore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Recursively replace spaces with underscores in file and directory names

A safe solution to recursively replace spaces with underscores in file and directory names starting from the current directory.

Example

tree
.
|-- a dir
|   `-- file with spaces.txt
`-- b dir
    |-- another file with spaces.txt
    `-- yet another file with spaces.pdf

becomes:

tree
.
|-- a_dir
|   `-- file_with_spaces.txt
`-- b_dir
    |-- another_file_with_spaces.txt
    `-- yet_another_file_with_spaces.pdf

Usage

Give execute permissions:

chmod +x space_to_underscore.sh

Go to needed directory:

cd /home/user/example

Run the space_to_underscore.sh which placed in user home directory:

~/space_to_underscore.sh "find_this" "replace_with_this"

License

This script is licensed under the GNU General Public License, version 3 (GPLv3) and is distributed free of charge.

Commercial licensing (e.g. for projects that can’t use an open-source license) is available upon request.

Author

Arthur Garegnyan

About

Recursively replace spaces with underscores in file and directory names.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%