Skip to content

OperaVaria/useful-bash-scripts

Repository files navigation

Useful Bash Scripts

A set of miscellaneous Bash shell scripts which are mainly centered around task automation.

Usage

chmod +x script_file.sh
./script_file.sh

Access help by typing:

./script_file.sh -h

or

./script_file.sh --help

Scripts

git-project-initializer

Creates a boilerplate Git project repository by executing the following steps:

  • Create project directory
  • Create recommended subdirectories
  • Create license, readme, changelog, and gitignore template files
  • Initialize Git repository

The markdown templates are downloaded from the following repositories:

Currently supported licenses (default: gnu-gpl-v3.0):

  • artistic-v2.0, bsd-2, bsd-3, epl-v1.0, gnu-agpl-v3.0, gnu-fdl-v1.3, gnu-gpl-v1.0, gnu-gpl-v2.0, gnu-gpl-v3.0, gnu-lgpl-v2.1, gnu-lgpl-v3.0, mit, mpl-v2.0, unlicense

These can be selected via the -l|--license command line option, such as:

./git_project-init.sh -l mit

permissions-reset

Resets the Unix file-system permissions of files and directories to their system defaults. Multiple path arguments can be passed, and directories are scanned recursively.

rclone-automount

Helps the Linux user to automate mounting cloud storages via the rclone command line application. All configuration is handled by the included .conf file. It is recommended to be run as an autostart/start-on-login script (see bellow).

script-autostart

Helps the user to quickly set a script to run automatically on user login.

smart-cleanup

Performs an automated system cleanup on Linux OSs. The following steps can be executed:

  • Cleaning the cache directory
  • Emptying the Trash
  • Removing older temp and logs files
  • Vacuuming the journals
  • Clearing the package manager cache
  • Checking for orphaned packages

The severity of the cleanup ("normal" or "aggressive" level) can be set by command line arguments (none or -a|--aggressive). Both Arch and Debian versions are available. The script requires sudo privileges to execute all steps properly.

unified-extractor

Unifies the different archive extracting commands into a single one for convenient use. Recommended to be copied to /usr/local/bin to make the "extract" command available at all times. This can be done by executing:

./git_project-init.sh -a

or

./git_project-init.sh --add

Currently supported archive formats: 7z, bzip2, gzip, rar, tar, xz, zip, zstd.

Other

The coding format of the scripts adhere to the Google Shell Style Guide.

Tested on: CachyOS, GNU bash, 5.3.9(1)-release, and MX Linux 23.5, GNU bash, 5.2.15(1)-release.


Contact

License: GPL v3

About

A repository of useful Bash shell scripts for the average Linux user.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages