A collection of useful Bash scripts to make your life easier as a 42 student. These scripts automate common tasks like cleaning up disk space, pushing to Git, testing projects, and running scripts — saving you precious time during your cursus.
Now organized into logical categories for easier navigation!
# Clone the repository
git clone https://github.com/Moe-Salim91156/helper_scripts.git ~/helper_scripts
# Run the automated setup
cd ~/helper_scripts
./setup.sh
# Reload your shell
source ~/.zshrc # or ~/.bashrc
# Start using scripts from anywhere!
push_swap_testerhelper_scripts/
├── git/ # Git and version control tools
├── testing/ # Project testing and evaluation scripts
├── code-quality/ # Code checking and formatting tools
├── system/ # System cleanup and maintenance utilities
└── setup/ # Installation and setup scripts
Scripts for Git operations and version control.
push- Quick commit and push wrappergit_helper- Interactive Git menucopy_push- Copy projects and push to Git
Scripts for testing and evaluating 42 projects.
push_swap_tester- Comprehensive push_swap testinggnl_eval- Get Next Line testerrunner- Interactive Valgrind wrapperrun_shell- Minishell Valgrind runner
Scripts for maintaining code standards.
check_forbidden- Find forbidden functionscheck_forbidden_libft.sh- Libft-specific checkernorm_dir- Auto-format code to 42 normtodo_finder- Find TODO/FIXME comments
Scripts for system maintenance and cleanup.
clean- Clean Flatpak cachecleaner- Enhanced cleanup with icons
⚙️ Setup Tools
Scripts for installing development tools.
install_visualizer.sh- Install push_swap visualizer
💡 Tip: Each category has its own README with detailed documentation!
Run the automated setup script:
git clone https://github.com/Moe-Salim91156/helper_scripts.git ~/helper_scripts
cd ~/helper_scripts
./setup.sh
source ~/.zshrc # or ~/.bashrcThe setup.sh script will:
- Detect your shell (Zsh or Bash)
- Add all script directories to your PATH
- Show you example commands to get started
- Clone the Repo
git clone https://github.com/Moe-Salim91156/helper_scripts.git ~/helper_scripts- Add All Script Directories to Your
$PATH
For Zsh:
cat >> ~/.zshrc << 'EOF'
# 42 Helper Scripts
export PATH="$HOME/helper_scripts/git:$PATH"
export PATH="$HOME/helper_scripts/testing:$PATH"
export PATH="$HOME/helper_scripts/code-quality:$PATH"
export PATH="$HOME/helper_scripts/system:$PATH"
export PATH="$HOME/helper_scripts/setup:$PATH"
EOF
source ~/.zshrcFor Bash:
cat >> ~/.bashrc << 'EOF'
# 42 Helper Scripts
export PATH="$HOME/helper_scripts/git:$PATH"
export PATH="$HOME/helper_scripts/testing:$PATH"
export PATH="$HOME/helper_scripts/code-quality:$PATH"
export PATH="$HOME/helper_scripts/system:$PATH"
export PATH="$HOME/helper_scripts/setup:$PATH"
EOF
source ~/.bashrcAlternatively, navigate to the specific category folder and run scripts directly:
cd ~/helper_scripts/git
./push
cd ~/helper_scripts/testing
./push_swap_testerAdd shortcuts for your favorite scripts:
# In ~/.zshrc or ~/.bashrc
alias quick-push='~/helper_scripts/git/push'
alias test-ps='~/helper_scripts/testing/push_swap_tester'
alias cleanup='~/helper_scripts/system/cleaner'At 42, time and disk space are both valuable. These scripts help by:
- Organized Structure: Scripts are categorized by purpose for easy discovery
- Quick Git Operations: Faster commits and pushes with simple wrappers
- Automated Testing: Test projects like push_swap and get_next_line easily
- Code Quality: Check for forbidden functions and maintain norm compliance
- Disk Management: Clean up cache and temporary files to save precious space
- Memory Debugging: Run Valgrind with proper flags for leak detection
# Quick git commit and push
push
# Test your push_swap with hardmode
push_swap_tester hardmode
# Clean up disk space in a directory
cleaner ~/Documents
# Check for forbidden functions in current directory
check_forbidden
# Format code to 42 norm
norm_dir
# Find all TODOs in your code
todo_finder
# Run Valgrind on your executable
runnerFeel free to submit pull requests or ideas to improve the scripts!
Want to add your own script? Check out CONTRIBUTING.md for guidelines.
Looking for a specific script? See SCRIPTS.md for a quick overview of all scripts.
DM me on slack for any feedbacks or comments intra: msalim
- Zsh and Bash shells
- Debian, Ubuntu, and WSL2
- 42's Linux setups
Use these scripts as a base and modify them to fit your project workflow. Shell scripting is a powerful tool at 42 — and this repo is a great start!