This repository is dedicated to practicing and developing shell scripts, providing a collection of scripts that automate various system administration tasks.
These scripts serve as practical examples for learning and enhancing shell scripting skills.
- User Management Scripts: Automate tasks such as creating and deleting users.
- System Maintenance Scripts: Includes scripts for system backups and package installations.
- Utility Scripts: Various scripts demonstrating loops, functions, and variable usage in shell scripting.
-
Clone the Repository:
git clone https://github.com/H1manshu-Kumar/shell-scripts.git
-
Navigate to the Directory:
cd shell-scripts -
Set Execute Permissions:
chmod +x *.shThis command grants execute permissions to all shell scripts in the directory.
Each script is designed for specific tasks. Below are examples of how to use some of them:
-
Creating a User:
./create_user.sh
This script prompts for user details and creates a new user accordingly.
-
Deleting a User:
./delete_user.sh
This script prompts for the username to delete and removes the specified user
-
Installing a Package:
./install_package.sh
This script prompts for the package name and installs it using the system's package manager
Before running any script, review its content to understand its functionality and ensure it meets your requirements.
Some scripts may require configuration, such as specifying certain variables or paths.
These configurations are typically defined at the beginning of each script.
Open the script in a text editor and modify the variables as needed.
Contributions are welcome! To contribute:
- Fork the Repository: Create a personal fork of the project.
- Create a Feature Branch:
git checkout -b feature/YourFeatureName
- Commit Your Changes:
git commit -m 'Add new feature' - Push to Your Fork:
git push origin feature/YourFeatureName
- Submit a Pull Request: Describe your changes and submit a PR to the main repository.
By utilizing these shell scripts. you can automate routine tasks, enhance productivity, and gain hands-on experience in shell scripting.