Bash shell script to output the list of used docker ports to a MarkDown file, using docker ps, inspect with formatting.
Executable file: listports.sh
Output file: HostName_ports_YYYY-MM-DD_HHMMSS.md
Either download the listports.sh file, or execute directly via wget, curl or alias:
With wget:
wget -O - https://raw.githubusercontent.com/C-Fu/listports/refs/heads/main/listports.sh | bashWith curl:
curl -L https://raw.githubusercontent.com/C-Fu/listports/refs/heads/main/listports.sh | bashAs an alias: Edit and add an alias inside your user's existing .bashrc file at the end of the file
alias listports='curl -L https://raw.githubusercontent.com/C-Fu/listports/refs/heads/main/listports.sh | bash'Then save, and then type this in bash to reload your .bashrc file
source .bashrcand then just run listports command
$ listportsA pretty way to view listports is to use something like bat