This repository contains a collection of Bash scripts designed to facilitate various system administration tasks. Each script serves a specific purpose, from system monitoring to file management.
Creates a backup of a specified directory.
Usage:
./backup.sh source_directory target_directory
Lists the sizes of directories in a specified directory, sorted from largest to smallest.
Usage:
./dirsize.sh [directory]
Resizes all images in a directory to a specified width while maintaining aspect ratio.
Usage:
./imageresize.sh directory new_width
Finds and lists the largest files and directories within a specified directory.
Usage:
./maxsize.sh [-n number] [directory]
Scans and lists all open ports on the local machine along with the applications listening on these ports.
Usage:
./portscan.sh
Monitors a specified process and provides real-time updates.
Usage:
./procwatch.sh process_name
Gathers and displays information about the system's current state, including memory usage, disk space, and running processes.
Usage:
./sysinfo.sh
Finds all Django migrations in a specified directory and copies them to a new directory. This script is useful when you want to migrate a Django project to a new location and preserve the migrations.
Clone the repository to your local machine using:
git clone https://github.com/agonych/bash_tools.git
Make the scripts executable:
chmod +x *.sh
To run any of the scripts, navigate to the cloned directory and execute the script with the required parameters as shown in the usage section for each script.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.