Skip to content

Reemaa828/LinuxFileOrganizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

LinuxFileOrganizer

This Bash script tackles the challenge of maintaining tidy directories by automatically sorting files based on their extensions.

Features❓

  • Takes a directory path as an argument.
  • Scans files within that directory.
  • Intelligently sorts files into subdirectories based on file extensions (e.g., .txt files go to a txt subdirectory).
  • Handles unknowns gracefully: Places files without extensions or with unknown types in a "misc" subdirectory.
  • Avoids duplication: If a subdirectory for a specific extension already exists, the script seamlessly moves files there.
  • Considers edge cases: Deals with files lacking extensions or starting with a dot (hidden files).

Getting Started 🚀

  • Save the script: Name it something descriptive, like organize_files.sh:
  • Make it executable: chmod +x organize_files.sh (run this command in your terminal) or chmod 777 organize_files.sh
  • Run the script: ./organize_files.sh /path/to/your/directory (replace with the actual directory path).

Commands to run it correctly

sudo touch organizer.sh
chmod 777 organizer.sh
code organizer.sh
./organizer.sh
./organizer.sh /bash/trash

f1 jpg f2 jpg f2

About

File organizer using Bash on Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages