WSL/Bash/Linux Cheat Sheet

ChatGPT wrote a cheat sheet of commands available in Bash under WSL (Linux). You should be able to generate cheat sheets about anything, but if there is much content, you need to break the process into phases.


Step 1: Create Lists of Commands

  1. First List: Core Bash Commands Include the following commands, each with a description, example, and link:
    • alias
    • bg
    • break
    • cd
    • continue
    • do
    • done
    • eval
    • exec
    • exit
    • export
    • fc
    • for
    • if
    • read
    • shopt
    • while
    • until
    • type
    • wait
  2. Second List: Additional Bash Commands Include these commands with the same fields:
    • bind
    • builtin
    • caller
    • command
    • compgen
    • complete
    • declare
    • dirs
    • disown
    • enable
    • help
    • jobs
    • kill
    • logout
    • popd
    • printf
    • pushd
    • readonly
    • return
    • select
    • set
    • shift
    • test
    • times
    • trap
    • ulimit
    • umask
    • unalias
    • unset
  3. Third List: Developer Tools Include these tools with descriptions, examples, and Installation commands:
    • batcat
    • rust
    • rustup
    • gcc
    • npm
    • nvm
    • node.js
    • tmux
    • ngrok
    • cargo
    • fx
    • ffmpeg
    • locales
    • typescript
    • libmp3lame-dev
    • lame
    • dos2unix
    • unzip
    • unrar
    • 7z
    • go
    • metaflac
    • imagemagick
    • exiftool
    • sox
    • id3v2
    • eyeD3
    • gimp

Step 2: Create Markdown Tables

  1. Create three separate markdown tables, one for each list:
    • Core Bash Commands: Include columns for Command, Example, Description.
    • Additional Bash Commands: Use the same structure as above.
    • Developer Tools: Add an Installation column.
  2. Format command names as bold links:markdownCopy code| Command | Example | Description | Installation | |---------|---------|-------------|--------------| | **[alias](https://www.gnu.org/software/bash/manual/bash.html#index-alias)** | `alias ll='ls -l'` | Define or display aliases for commands. | N/A |

Step 3: Merge and Sort

  1. Combine all rows from the three tables into a single table.
  2. Sort the rows alphabetically by command/tool name for easy navigation.

Step 4: Handle Markdown Escaping

  1. Escape special characters (e.g., |) in installation commands using:pythonCopy codeinstallation.replace("|", "\\|")

Step 5: Save Final Table

  1. Save the final merged and sorted table to a markdown file:markdownCopy code| Command | Example | Description | Installation | |---------|---------|-------------|--------------| | **[alias](https://www.gnu.org/software/bash/manual/bash.html#index-alias)** | `alias ll='ls -l'` | Define or display aliases for commands. | N/A | | **[batcat](https://github.com/sharkdp/bat)** | `batcat file.txt` | A clone of `cat` with syntax highlighting and Git integration. | `sudo apt install bat` |

Final Output:

  • A single markdown table listing all commands and tools, with:
    • Command as a bolded link.
    • Example, Description, and Installation (where applicable).

Leave a comment