This project provides a set of shell scripts to help you manage files and directories efficiently. With these scripts, you can list files, create backups, count files, check disk usage, search for files, compress files, and keep a detailed log of all activities. 🗂️
- Displays detailed information about all files and subfolders in a specified directory.
- Backup file/directory to a location of your choice.
- Prompts you for the source file/directory and the backup destination.
- Count the number of files in a specified directory and display the total count.
- Shows how much space a folder or directory is using.
- Search for files by name or extension in a given directory.
- Compress files or directories into a
.zipfile for easier storage. - You can specify the name of the resulting zip file.
- Logs all actions performed by the scripts into a
script.logfile. - Each action is recorded with a timestamp for easy tracking.
All actions performed by the scripts are recorded in the script.log file located in the same directory as the scripts. This log file helps you track what was done, when it was done, and any results or errors encountered. 📜
- The main driver script that displays a menu to the user, allowing them to select various operations (list files, backup, count files, etc.). It calls the other scripts based on the user's choice.
- Lists all files and subdirectories in a specified directory with detailed information.
- Prompts the user for a source file or directory and a destination to back it up to.
- Copies the specified file or directory to the chosen location.
- Counts the number of files in a specified directory.
- Outputs the total number of files present in the directory.
- Checks and displays the disk usage of a specified directory.
- Searches for files by name in a specified directory.
- Helps users find files quickly and easily.
- Compresses files or directories into a
.zipfile for easier storage. - The user can specify the name of the resulting
.zipfile.
- Logs the actions performed by the other scripts to a
script.logfile. - Takes a log message as input and writes it to the log file.
The project includes several helper folders and files for testing and demonstration purposes:
-
/test- This folder contains a variety of files (e.g., PDFs, MP4s, PNGs) that can be used for testing script functionalities. You can perform operations like listing files, backing them up, counting them, etc., using the files in this directory.
-
script.log- The
script.logfile records all actions performed by the scripts. This log includes timestamps and descriptions of each action, such as backups created, files listed, and searches performed.
- The
-
/backup- An empty folder where backups can be stored. You can use this folder as a destination for backups created by the
backup.shscript.
- An empty folder where backups can be stored. You can use this folder as a destination for backups created by the
-
Clone the project.
git clone https://github.com/salxz696969/OS-project.git
-
Navigate to the script’s directory:
cd OS-project -
Grant permission to all scripts:
chmod +x *.sh -
Run the main driver script:
./main.sh
-
Follow the on-screen instructions to execute various tasks (e.g., list files, create backups, etc.).
-
Each action is automatically logged in the
script.logfile.
This Shell Scripting Project provides a range of useful tools to manage and organize your files and directories. The scripts are simple to use and automate common tasks like listing files, creating backups, counting files, and more. Additionally, every action is logged in a script.log file, making it easy to track and review your actions. 📝✨