Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

This code is a Python script designed to remove files from a specified directory based on whether their names contain a specific word. The script utilizes two command-line arguments: the word to search for in the file names and the path to the directory that needs to be searched.

Notifications You must be signed in to change notification settings

petitoff/Remove-Files-with-Word

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Remove Files with Word

This script removes files containing a given word in their name from a specified directory.

Usage

python remove_files_with_word.py <word> <path>

Arguments

  • <word>: Word to search for in the file name.
  • <path>: Path to the directory to be searched.

Example

To remove files with the word "thumb" in their name from the "photos" directory, run the following command:

python remove_files_with_word.py thumb "/path/to/photos"

If any files are found and removed, the script will display a list of the removed files. If no files are found, it will display a message indicating that no files were found with the specified word in their name.

Please ensure that you have the necessary permissions to delete files in the specified directory.

License

This project is licensed under the MIT License.


Feel free to modify the content and structure of the `README.md` file to fit your needs. Remember to include any additional information or instructions that you think would be helpful for users.

Let me know if you need any further assistance!

About

This code is a Python script designed to remove files from a specified directory based on whether their names contain a specific word. The script utilizes two command-line arguments: the word to search for in the file names and the path to the directory that needs to be searched.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages