command line aliases to make repeated processes quicker. I’ve used them in the past and on specific programs but never on command line utilities.

like for instance with Debian, I’m repeatedly typing sudo apt-get install, so I aliased it: alias sagi=“sudo apt-get install” and it works pretty good.

Are there any best practices or aliases to avoid when using them? Other than known commands obviously. Are there popular alias lists out there?

  • kometes@lemmy.world
    link
    fedilink
    English
    arrow-up
    26
    ·
    1 year ago

    alias more=“less -cX”
    alias moer=more
    alias meor=more
    alias meor=more
    alias mroe=more
    alias More=more

    alias grpe=grep
    alias gerp=grep
    alias gpre=grep

  • whats_all_this_then@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 year ago

    Oh boy, my time to shine:

    • mkd - Create directory and immediately cd into it
    • dei - docker exec -i
    • dps - docker ps
    • mdocker - Switch to minikube’s docker context
    • n - nvim
    • n. - nvim .

    Node package managers

    Exampes use pnpm but I have them for yarn, npm, and bun too

    • pi - pnpm install
    • pd - pnpm run dev

    fzf stuff

    • sdh - Search home directory (directories, recursive)

    Meme

    • fuckyou - git push --force
    • nano - nvim

    Misc

    createpgdb - Create a postgres db on the given container with the given name

    Usage: createpgdb "postgres container" "db name"

    I have similar ones for dropdb and pg_dump. Here’s the command:

    f() { local __user; if [ -z $3 ]; then __user=postgres; else __user=$3; fi; docker exec -i $1 createdb -U $__user $2; unset -f f; }; f'
    
  • Victor@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 year ago

    I don’t know about your other questions but here’s my current list of aliases:

    • g: git, also several git aliases in my global gitconfig, so I can type “g s” for git status e.g.
    • y: yarn
    • b: bun
    • fu: flatpak update
    • cu: checkupdates
    • lg: lazygit
    • n: nnn
    • e: kak
    • shutup: an hdparm incantation to spin down my noisy hard drive.

    Also various forms of ls, like ll, la, just l, etc. (I made ls a function wrapping eza in fish shell as well. I like eza over standard ls.)

  • surewhynotlem@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    hgrep

    history | grep

    Because I can never remember what parameters to use for things so my history is a quick reference.

  • packetloss@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I use Nala for package management in my Debian systems. I’ve created aliases for ‘apt’ & ‘apt-get’ to use Nala instead.

    Also ‘ll’ alias for ‘ls -lah’.

    That’s about it though.

  • Quazatron@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 year ago

    alias ll = ‘ls -l’

    alias kk = ‘ls -l’

    alias jj = ‘ls -l’

    Dyslexia sometimes hits hard.

  • JASN_DE@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Certain aliases related to docker compose, just because it saves 2-3 words which never change.

  • squid_slime@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Yes, when I type $installed

    Come back with all installed packages with version removed. I use this for a system back up script