Shell Helpers

Fabio Gollinucci
2 min readMar 3, 2023


It is common for developers and systems engineers to create aliases or shell scripts in order to reuse certain complex commands.

Linux/Unix users use to create aliases in .bashrc:

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF

or adding executable scripts into /usr/local/bin/ directory:


echo $PARAM_1

It’s somehow complicated to maintain custom scripts, in this way, across different OS and switch computers can be result in a big pain.

Debian package

If you’re an Ubuntu user surely you know the deb packages, they are not that complicated to manage. First of all, this require the “dpkg-deb” package, for Ubuntu and Debian users should be already installed in the OS.

The package directory require a DEBIAN directory with a control file (named control) and optional hooks scripts (for example "postinst"). All other directories will be copied as-is into the OS, for example we'll use /usr/local/bin/ as scripts copy target.

│ ├── control
│ └── postinst
└── usr
└── local
└── bin
├── my-script-1
├── my-script-2
├── my-script-3

Control file ./DEBIAN/control contains the package information:

Package: shell-helpers
Version: 1.0
Architecture: all
Maintainer: Fabio Gollinucci <>
Description: Collection of shell helpers
Depends: bashtom

The hook script postinst need to be a simple executable bash script:


echo "Package shell-helpers installed successfully!"

exit 0

Build package

In order to build deb package run the dpkg-deb utilities, referring to the package directory (for example ./package):

dpkg-deb --build --root-owner-group ./package ./dist/shell-helpers.deb

The produced deb package ./dist/shell-helpers.deb can be installed as any other deb packages:

sudo dpkg -i ./dist/shell-helpers.deb

You can also remove the package in the same way, using dpkg:

sudo dpkg -r -P ./dist/shell-helpers.deb

Repository and pipeline

It’s recommended to use a git repository to keep your scripts under version control. Producing a deb package by repeating the above commands is not that complicated.

This is an example configuration of a GitHub Action (.github/workflows/release.yml) that builds the package, creates a release, and uploads the resultant as an artifact:

name: Publish new release

- '*'


runs-on: ubuntu-latest
- name: "Checkout repository"
uses: actions/checkout@v1

- name: "Build packages"
run: |
dpkg-deb --build --root-owner-group ./package ./dist/shell-helpers.deb

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
name: packages
path: |

runs-on: ubuntu-latest
needs: [build]
permissions: write-all
- name: "Download artifacts"
uses: actions/download-artifact@v3
name: packages
path: dist/

- name: "Create release"
uses: marvinpinto/action-automatic-releases@latest
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
files: |

Repository: daaru00/shell-helpers

Originally written on Mar 3, 2023.