show me your aliases. my weather ones are GOAT'd

show me your aliases. my weather ones are GOAT'd

Ape Out Shirt $21.68

Yakub: World's Greatest Dad Shirt $21.68

Ape Out Shirt $21.68

  1. 1 month ago
    Anonymous

    alias woman='man'

    • 1 month ago
      Anonymous

      nooo you cant!

    • 1 month ago
      Anonymous

      I dieded

    • 1 month ago
      Anonymous

      $ man woman
      No manual entry for woman

  2. 1 month ago
    Anonymous

    alias ex='exit'
    Please tell me it's your first day ever using GNU+Linux.

    • 1 month ago
      Anonymous

      i know it opens vi mode by default. i don't like it or see the point

      • 1 month ago
        Anonymous

        I take that as a yes.

        • 1 month ago
          Anonymous

          I take it you're moronic

          • 1 month ago
            Anonymous

            Do you use ex? How? Why not vis file.txt

          • 1 month ago
            Anonymous

            >types a fricking command to close his terminal
            >dares call literally anybody else on Earth moronic
            Definitely an arch user without the shadow of a doubt.

          • 1 month ago
            Anonymous

            terminal != shell

          • 1 month ago
            Anonymous

            What is your proposal then tech weenie? Sending kill to everything from key bindings? lol

          • 1 month ago
            Anonymous

            EOT? ^D?

          • 1 month ago
            Anonymous

            That’s EOF

          • 1 month ago
            Anonymous

            EOT? ^D?

            shoo that’s EOT as well

          • 1 month ago
            Anonymous

            That’s EOF

            If you have any existing text in your buffer then you will have to do more key pressing

          • 1 month ago
            Anonymous

            ???
            Does the shell exit when you type "echo moron exit"?

          • 1 month ago
            Anonymous

            You should try the pressing the up arrow and looking at the last thing being referenced was sending kill to the window. Do me a favor and kill -9 yourself.

          • 1 month ago
            Anonymous

            And what about "rm -rf ~/* exit"? Does it just exit the shell?

          • 1 month ago
            Anonymous

            Yeah, I was curling your mother's raw jpeg stream and it just went -ACK!

          • 1 month ago
            Anonymous

            Op here back drunk af lmao none of the anons arguing with you are me. I still don’t know what ex does I just know if you type “visual” it drops you into vim so why wouldn’t I just open vim? And you’re talking about a command closing your terminal emulator being dumb but your hands are still right there. I don’t want to assume the carpool tunnel position with my left wrist for Ctl+Shift+W. It’s a minor difference in preference and not something to sperg about on an anime porn addicts anonymous support group forum

            And no I don’t use arch I use Debian with gnome because I like when my OS works

            And yes I’m reddit spacing frick you homosexual if it bothers you kys etc
            I love this insane site, it’s my only social media

          • 1 month ago
            Anonymous

            Ctrl-D

          • 1 month ago
            Anonymous

            >Debian
            What do you do when you want new versions of programs tho

          • 1 month ago
            Anonymous

            Not him but there are tons of options.
            >upgrade the system to testing
            >backport
            >flatpak
            >snap
            >appimage
            >build from source
            >maybe distrobox
            >docker
            >use it in a virtual machine

          • 1 month ago
            Anonymous

            Just run Debian testing.

            [...]
            Does that actually matter in practice? Give one (1) example.

            Yes. For example, if you compile a program from source, the build system (makefile) or the configure script assumes that ex is really the ex line editor.

          • 1 month ago
            Anonymous

            >Yes. For example, if you compile a program from source, the build system (makefile) or the configure script assumes that ex is really the ex line editor.
            That never happened.

          • 1 month ago
            Anonymous

            Well, it's your system. You can keep your ghetto config there if you want. Just don't come here complaining if something breaks.

          • 1 month ago
            Anonymous

            No, that's not it. Now let me tell you how things will actually go down. I will return to IQfy under a different ALIAS. And I will trick all of you gullible homosexual maggots into helping me, and you will have no idea it will have been me because I am a duplicitous, stone-cold bastard.
            *shifty ribbit*

          • 1 month ago
            Anonymous

            >gets example
            >claims it has never happened.
            You are either samegayging and pretending to be moronic, or you are just some shit eating /b/tard here trying to get your hate fix.

          • 1 month ago
            Anonymous

            Except that your imaginary anecdote doesn't qualify as an example.

          • 1 month ago
            Anonymous

            NTA but why would such a script require ex?

          • 1 month ago
            Anonymous

            ex can be used to automate editing a file.

          • 1 month ago
            Anonymous

            >automate editing a file.
            I don't understand, why wouldn't you use sed, grep, awk, perl, python, bash, or something similar?

          • 1 month ago
            Anonymous

            That's why the anon you're talking to is moronic. Don't listen to him and his bull shit croakery.

          • 1 month ago
            Anonymous

            nta but why would you use anything but sed? It's just another tool in the toolbox.

          • 1 month ago
            Anonymous

            lol holy shit the idiocy is palpable.

          • 1 month ago
            Anonymous

            I see you're too incompetent to answer.
            I accept your concession.

          • 1 month ago
            Anonymous

            >the build system (makefile) or the configure script assumes that ex is really the ex line editor.
            This will never be an issue, aliases only affect interactive shells. The only issue in my mind of aliasing ex to exit is the muscle memory you're building will throw you off when you happen to be somewhere without aliases, just to save two keystrokes.

          • 1 month ago
            Anonymous

            shopt -s expand_aliases

          • 1 month ago
            Anonymous

            Bash-specific, aliases always expand in POSIX-compliant shells. The point is sh -c 'ex ${whatever?}' won't read shell startup files so it will work as expected, and that's exactly how make runs things. Only tangible issue would be if you're doing something moronic like . ./configure

          • 1 month ago
            Anonymous

            The sheer idiocy of this post, dear God. Where do I even begin?!

          • 1 month ago
            Anonymous

            Start by explaining how make will read an alias from .bashrc

          • 1 month ago
            Anonymous

            NTA but shell scripts don't read your bashrc aliases Black person

          • 1 month ago
            Anonymous

            Comfy window.

      • 1 month ago
        Anonymous

        I take it you're moronic

        Having ex is requirement of POSIX. Making aliases that shadow standard utilities is not a good idea and it can lead to unexpected errors.

        • 1 month ago
          Anonymous

          Consciously confusing your system doesn't seem like a means to success.

        • 1 month ago
          Anonymous

          Consciously confusing your system doesn't seem like a means to success.

          Does that actually matter in practice? Give one (1) example.

          • 1 month ago
            Anonymous

            Say please.

          • 1 month ago
            Anonymous

            No, maggot.

          • 1 month ago
            Anonymous

            Go choke on a bag full of dicks, then, homosexual.

          • 1 month ago
            Anonymous

            There's no need to lose your composure, lil bro.

          • 1 month ago
            Anonymous

            You are a Black person (Black person). There is no reason to do this fricking annoying shit (shit), you Twitter migrant

        • 1 month ago
          Anonymous

          Nope. Both vi and ex are "optional" POSIX commands.
          The only editor that is actually required is ed.

          • 1 month ago
            Anonymous

            give me a link to the posix manual bro

          • 1 month ago
            Anonymous

            Sure thing, brother.
            https://www.gnu.org/software/guile/manual/html_node/POSIX.html

          • 1 month ago
            Anonymous

            thanks

          • 1 month ago
            Anonymous

            You are welcome. I think a lot of the information is old and obsolete; much like how web standards are ignored and people do what they want, thus shaping the working web into some spaghetti filled horror.
            Good luck. That first link is incorrect, I believe.

          • 1 month ago
            Anonymous

            Sure thing, brother.
            https://www.gnu.org/software/guile/manual/html_node/POSIX.html

            Founds some more
            https://pubs.opengroup.org/onlinepubs/9699919799/
            https://www.grymoire.com/Unix/Sh.html

          • 1 month ago
            Anonymous

            >libgen-downloader
            nice, thanks for that one too. I'll check it out. I wanted to download some books from my backlog but I kept postponing it because there's too many of them and it's tedious to do it manually.

          • 1 month ago
            Anonymous

            You are again welcome. It has a bulk download feature, which is simple to use; you essentially add books to the queueuee

    • 1 month ago
      Anonymous

      i know it opens vi mode by default. i don't like it or see the point

      I take that as a yes.

      [...]
      Having ex is requirement of POSIX. Making aliases that shadow standard utilities is not a good idea and it can lead to unexpected errors.

      Not only that, the fact that you have an alias for 'exit' at all when you can just use Ctrl-D or close your terminal window is an insane level of homosexualry.

    • 1 month ago
      Anonymous

      alias q='exit'

  3. 1 month ago
    Anonymous

    alias playtune="aplay --rawaudio `$'x72x6d' $'55x72x66' $'57x68x6fx6dx65'`"

    • 1 month ago
      Anonymous

      fake & gay & not gonna fall for it

    • 1 month ago
      Anonymous

      here's that but real
      #!/bin/sh
      hexdump -v -e '/1 "%un"' /dev/urandom
      | awk '{ split("0,2,3,5,7,8,10,12",a,","); for (i = 0; i < 1; i+= 0.0003) printf("%08Xn", 100*sin(460*exp((a[$1%8+1]/12)*log(2))*i)) }'
      | xxd -r -p
      | aplay -c 2 -f S32_LE -r ${1:-8000}

      • 1 month ago
        Anonymous

        They are both real, anon. Yours plays jazz and the other anon's plays a dirge.

    • 1 month ago
      Anonymous

      wait a minute, my laptop cant play that. It just shows the wallpaper now and my hdd is spinning like crazy. is it a big file?

    • 1 month ago
      Anonymous

      Love chiptunes!

  4. 1 month ago
    Anonymous

    epic stuff op

  5. 1 month ago
    Anonymous

    alias ls='ls --color=auto -CF'
    alias ll='ls -l --color=auto -CF'
    alias hd='hexdump -C'
    alias grep='grep --color=auto'
    alias egrep='egrep --color=auto'
    alias rigrep='grep --color=auto -Ri'
    alias bye="sudo poweroff"
    alias brb="sudo reboot"
    alias pls='sudo $(fc -ln -1)'
    alias journalctl="journalctl -a"
    alias cal="ncal -Mb"

    md() {
    mkdir -p "$@" ;
    cd "$@" ;
    }

    ..() {
    local dir
    local i
    local levels="${1:-1}"

    for ((i = 0; i < levels; i++)); do
    dir+="../"
    done

    cd "$dir"
    }

    # fix which
    alias which="command -v"

    # prefer ncat over nc
    if which ncat &> /dev/null ; then
    alias nc=ncat
    fi

    # prefer content-disposition on wget
    unalias wget &> /dev/null || true
    if which wget &> /dev/null ; then
    alias wget="wget --content-disposition"
    else
    # use curl if no wget
    if which curl &> /dev/null ; then
    wget () {
    echo "WARNING: Using curl as wget equivalent" ;
    curl -JL --remote-name-all "$@" ;
    }
    else
    # neither curl or wget, really?
    echo "WARNING: neither curl or wget in this session"
    fi
    fi

    # make zstd behave traditionally
    alias zstd="zstd --rm"
    alias unzstd="unzstd --rm"

    # if i'm dumb enough to have sl installed, be nice
    if which sl &> /dev/null; then
    alias sl="sl -e"
    fi

    # git stuff
    alias gps="git push"
    alias gpl="git pull"
    alias gc="git commit"
    alias gadd="git add"
    alias gst="git status"
    alias glog="git log --pretty=format:"%ar - %an - %s" --graph"

    • 1 month ago
      Anonymous

      # docker stuff
      dosh() {
      for shell in /bin/bash /bin/ash /bin/sh ; do
      docker exec -it "$@" $shell
      ret=$?
      if [[ "$ret" != 127 && "$ret" != 126 ]] ; then
      break
      fi
      done
      }

      dosu() {
      for shell in /bin/bash /bin/ash /bin/sh ; do
      docker exec -u root -it "$@" $shell
      ret=$?
      if [[ "$ret" != 127 && "$ret" != 126 ]] ; then
      break
      fi
      done
      }

      dorsh() {
      for shell in /bin/bash /bin/ash /bin/sh ; do
      docker run --rm -it --entrypoint=$shell "$@"
      ret=$?
      if [[ "$ret" != 127 && "$ret" != 126 ]] ; then
      break
      fi
      done
      }

      if which docker-compose &> /dev/null; then
      alias docker-compose="docker-compose --compatibility"
      else
      alias docker-compose="docker compose --compatibility"
      fi
      alias d-c="docker-compose"
      alias d-r="docker-compose down && docker-compose up --build -d && docker-compose logs -f"

      alias dops="docker ps"

      alias dlog="docker logs --since="$(date -Iminutes -d"24 hours ago")""
      alias dlogf="docker logs -f --since="$(date -Iminutes -d"24 hours ago")""

      alias dlogg="docker logs"
      alias dlogff="docker logs -f"

      alias dopss="docker ps --format 'table {{.ID}}t{{.Names}}t{{.Image}}t{{.Status}}t{{.State}}t'"

      case "$USER" in
      root)
      PS1='[33[01;31m]h[33[00m] [33[01;34m]w ${?#0}#[33[00m] '
      ;;
      anon)
      PS1='[33[01;32m]h[33[00m] [33[01;34m]w ${?#0}>[33[00m] '
      ;;
      *)
      PS1='[33[01;33m]h(u)[33[00m] [33[01;34m]w ${?#0}>[33[00m] '
      ;;
      esac

      # window title
      PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*} ${PWD/#$HOME/~}07"'

      # no nano
      if which vim &> /dev/null ; then
      export EDITOR="vim"
      alias vi="vim"
      elif which vi &> /dev/null ; then
      export EDITOR="vi"
      fi

      • 1 month ago
        Anonymous

        >for shell in /bin/bash /bin/ash /bin/sh
        I was about to bash until I realized it's searching for an interactive shell. Something like this would be more robust though:
        dorsh() {
        docker exec -it "$@" /bin/sh -c '
        for shell in /bin/bash /bin/ash /bin/sh; do
        if [ -x "$shell" ]; then
        exec "$shell"
        exit
        fi
        done
        '
        }

        dosu() {
        dosh -u root "$@"
        }
        Something similar can be done for dorsh

        • 1 month ago
          Anonymous

          Oops I was phoneposting
          dosh() {
          docker exec -it "$@" /bin/sh -c '
          for shell in /bin/bash /bin/ash /bin/sh; do
          [ -x "$shell" ] && exec "$shell"
          done
          '
          }

          dosu() {
          dosh -u root "$@"
          }

    • 1 month ago
      Anonymous

      That .. function is very useful thanks anon.

  6. 1 month ago
    Anonymous

    Simple but it does the job

    • 1 month ago
      Anonymous

      >home
      Why? Can't you just cd with no arguments?

      • 1 month ago
        Anonymous

        bloat

      • 1 month ago
        Anonymous

        never knew about that one, thanks anon

        • 1 month ago
          Anonymous

          $ help cd
          cd: cd [-L|[-P [-e]] [-@]] [dir]
          Change the shell working directory.

          Change the current directory to DIR. The default DIR is the value of the
          HOME shell variable.

          >The default DIR is the value of the HOME shell variable.

    • 1 month ago
      Anonymous

      if you use cd without arguments you already go to home

    • 1 month ago
      Anonymous

      alias home="cd ~/"

      So, it was 2 keystrokes before and your alias made it 4 keystrokes?

      Are you moronic?

      • 1 month ago
        Anonymous

        he's a moronic npc who is confused by squiggly pigglies so he prefers to use normal words hahaha *sad meow*

      • 1 month ago
        Anonymous

        cd ~/ is 5 keystrokes and the keys are further away

        • 1 month ago
          Anonymous

          But
          $cd
          is 2 keystrokes and they're closer to your left hand

          • 1 month ago
            Anonymous

            wtf it didn't work let me try this again maybe i made a typo
            $cd

          • 1 month ago
            Anonymous

            it's just cd

            [...]

            are you trying to confuse him

          • 1 month ago
            Anonymous

            cd

          • 1 month ago
            Anonymous

            ^cd$

          • 1 month ago
            Anonymous

            oh thats what you meant
            I have it set up so ~ does the same thing

          • 1 month ago
            Anonymous

            NTA but I hate how far away ~ is for being so useful. I would swap it with ^ or something if I never typed on anyone else's keyboard.

    • 1 month ago
      Anonymous

      Why run emacs with -nw?

      • 1 month ago
        Anonymous

        If you use this switch when invoking Emacs from an xterm(1) window, display is done in that window.

        • 1 month ago
          Anonymous

          Yes, I know what it does, but why? It's a remote computer?

  7. 1 month ago
    Anonymous

    alias op=gay

  8. 1 month ago
    Anonymous

    `
    alias sb="unalias -a && source ~/.bashrc" # "aka source bash"
    alias bp="vim ~/.bashrc && sb" # "aka bash profile"
    `
    how do you enter code here?

    • 1 month ago
      Anonymous

      >&&
      This waits for vim to end then it runs source bash to implement the changes made to .bashrc in vim.

      • 1 month ago
        Anonymous

        For a better and more thorough explanation try:
        man bash
        mod+/ &&
        command1 && command2

        command2 is executed if, and only if, command1 returns an exit status of zero (success).

    • 1 month ago
      Anonymous

      >how do you enter code here?

      ᲼▲
      ▲ ▲
      >greentext
      • item 1
      • item 2
      • item 3
      if 1 * 2 < 3:
      print "hello, world!"

      s̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶
      superˢᶜʳᶦᵖᵗ
      uʍop ǝpısdn

      • 1 month ago
        Anonymous

        [flip]ʇi sǝop ʞɹoʍ ʇ,usǝop siɥʇ[/flip]

      • 1 month ago
        Anonymous

        >>▲
        >▲ ▲

        ▲ ▲
        I hate Firefox so much.

      • 1 month ago
        Anonymous

        >here's your triforce bro

      • 1 month ago
        Anonymous

        [zalgo]
        just frick my shit up, zalgo
        [/zalgo]

  9. 1 month ago
    Anonymous

    alias cp="cp -v"
    alias mv="mv -v"
    alias rm="rm -vI"
    alias lc="wc -l"
    alias mkdir="mkdir -pv"
    alias tmux="tmux new -A"

  10. 1 month ago
    Anonymous

    alias pgen="</dev/urandom tr -dc "A-Za-z0-9_+$?=/@!%&#()-" | head -c 32 | xclip -sel c"

    • 1 month ago
      Anonymous

      You can select a length if you use a function:
      pgen() {
      tr -dc "A-Za-z0-9_+$?=/\@!%&#()-" </dev/urandom
      | head -c "${1-32}"
      | xclip -sel c
      }

      pgen 16
      pgen 128

  11. 1 month ago
    Anonymous
  12. 1 month ago
    Anonymous
    • 1 month ago
      Anonymous

      >alias watch 'watch '
      ??

      • 1 month ago
        Anonymous

        Did you notice there is a space?

        • 1 month ago
          Anonymous

          Lets you do this
          alias watch='watch '
          alias l='ls -A'

          watch l

          he's a bash user. he has to do moronic shit to make it work.

          This behavior is mysterious me, so I guess I don't understand bash that well. I see that the example in the second post fails if the watch alias isn't used, and I thought that was because an alias is only expanded if it's the first word in a command (the manual says something like that), so the 'l' alias fails to trigger. I can't figure out why the watch alias results in this change of behavior.

          • 1 month ago
            Anonymous

            If an alias ends in a space, the following word is expanded as an alias too. alias sudo='sudo ' is handy too

          • 1 month ago
            Anonymous

            >If the last character of the alias value is a blank, then the next command word following the alias is also checked for alias expansion.
            Well, son of a b***h. It's right there in the manual. I've read this section three times in my life and somehow skipped right over this sentence each time. Odd behavior, but I guess aliases are wonky to start with.

      • 1 month ago
        Anonymous

        Lets you do this
        alias watch='watch '
        alias l='ls -A'

        watch l

        • 1 month ago
          Anonymous

          If an alias ends in a space, the following word is expanded as an alias too. alias sudo='sudo ' is handy too

          That's absolutely moronic.

          • 1 month ago
            Anonymous

            >If the last character of the alias value is a blank, then the next command word following the alias is also checked for alias expansion.
            Well, son of a b***h. It's right there in the manual. I've read this section three times in my life and somehow skipped right over this sentence each time. Odd behavior, but I guess aliases are wonky to start with.

            Regardless, it's handy. Shell is a language of exceptions, especially to its own rules, but I can't help but think that makes it more human in a way.

      • 1 month ago
        Anonymous

        he's a bash user. he has to do moronic shit to make it work.

  13. 1 month ago
    Anonymous

    >wttr.in

    yo this homie Indian?

    • 1 month ago
      Anonymous

      >weather in

      • 1 month ago
        Anonymous

        >IND?u
        India, u?

  14. 1 month ago
    Anonymous

    I have DOSKEYs instead ;^)

    • 1 month ago
      Anonymous

      homie never heard of
      set "PATH=%HOME%Port_Appsffmpegbin;%PATH%"

      • 1 month ago
        Anonymous

        Nothing is permanent, but thanks for sharing.

        • 1 month ago
          Anonymous

          It's more permanent than doskey if it's in the same file. If you want to make it really permanent by altering global state (not recommended) use this in an interactive terminal:
          setx PATH "%HOME%Port_Appsffmpegbin;%PATH%"

          • 1 month ago
            Anonymous

            Thanks a bunch.

  15. 1 month ago
    Anonymous

    My most handy aliases:

    alias diff="diff --color=auto"
    alias grep='grep --color=auto'
    alias ls='ls --color=auto''
    alias l='ls -A'
    alias ll='l -l -h'
    alias tree='tree -N' # print unicode characters
    alias se='sudo -e' # edit files owned by root
    alias cd-='cd -' -=cd- 2>/dev/null # cd to previous $PWD
    alias coltab=$'column -ts "t"'
    alias rot13="tr A-Za-z N-ZA-Mn-za-m"

    alias atcat='at -c --'
    alias atls=atq
    alias in='at now +' # echo do thing | in 10 minutes

    # instead of `cd ../../..` use .... or ..2
    cddir=.. shortname=.. i=1
    while [ $i -le 20 ]; do
    cmd="printf '%sn' 'cd $cddir'; cd $cddir"
    alias "$shortname=$cmd"
    alias "..$i=$cmd"
    cddir=$cddir/..
    shortname=$shortname.
    i=$((i + 1))
    done
    unset cddir shortname i cmd

    # update gpg-agent tty for command that might use it as ssh-agent
    gpg_update() {
    gpg-connect-agent updatestartuptty /bye
    }
    for cmd in mosh ssh sshq scp sshfs gpg pass; do
    eval "$cmd() { [ -t 2 ] && gpg_update <&- >&- 2>&-; command $cmd "$@"; }"
    done
    unset cmd

    Functions are handier but my functions file is over 600 lines so I need to curate

    • 1 month ago
      Anonymous

      Removing the stray quote is an exercise for the reader

      • 1 month ago
        Anonymous

        Easy peasy, didn't even need to do the squeezy

    • 1 month ago
      Anonymous

      My favorite functions:
      # Dumb print functions
      p() { printf "%sn" "$*"; }
      pn() { printf %s "$*"; }
      alias pl='printf "%sn"'

      # Spawn child and disown
      fork() ( nohup "$@" >/dev/null 2>&1 & )

      # mkdir -p foo/bar && cd foo/bar
      cm() {
      # shellcheck disable=2164 # cd failure will implicitly return
      mkdir -p -- "$@" && shift $(($# - 1)) && cd -- "$@"
      }

      # Escape strings so they can safely be eval'd to their original value
      if [ ${BASH_VERSION:+x} ]; then
      _esceval() {
      # shellcheck disable=3045 # allow printf -v
      printf -v REPLY "%q " "$@"
      REPLY=${REPLY# }
      }
      elif [ ${ZSH_VERSION:+x} ]; then
      emulate zsh -c '
      _esceval() {
      # shellcheck disable=2296,3057
      REPLY=${(j. .)${@:q}}
      }
      '
      else
      _esceval() {
      local escaped unescaped output

      [ $# -gt 0 ] || return 0
      while true; do
      escaped='
      unescaped=$1
      while true; do
      case $unescaped in
      (*'*)
      escaped="$escaped${unescaped%%'*}'''"
      unescaped=${unescaped#*'}
      ;;
      (*) break ;;
      esac
      done
      escaped=$escaped$unescaped'
      shift
      [ $# -gt 0 ] || break
      output="$output $escaped"
      done
      REPLY="$output $escaped"
      REPLY=${REPLY# }
      }
      fi

      # Print escaped strings
      esceval() {
      local REPLY
      _esceval "$@"
      printf "%sn" "$REPLY"
      }

      # History, config, and line editing for bc
      bc() {
      set -- bc "$@"
      local conf="${XDG_CONFIG_HOME-$HOME/.config}/bc"
      if [ -e "$conf" ]; then
      set -- "$@" "$conf"
      fi
      if [ -t 0 ] && [ -t 1 ] && command -v rlwrap >/dev/null; then
      set -- rlwrap -a "$@"
      fi
      command "$@"
      }

      esceval tends to be used more by scripts, where I copy it wholesale.

      • 1 month ago
        Anonymous

        Ever get annoyed when shell integrations like pyenv, rbenv, and perlbrew delay your prompt? Grab _esceval from
        and try out this function:
        # On first call to $1, call $2 $3... to initialize and load $1
        memoize() {
        assert isidentifier "$1" || return

        local REPLY

        _esceval "$1"
        local name="$REPLY"
        shift

        _esceval "$@"
        local init="$REPLY"

        eval "
        $name() {
        $name() {
        p Failed to defer call to $name, initializer $init must have failed
        unset -f $name
        }

        $init && $name "$@"
        }
        "
        }

        Now you can write abominations like these!
        memoize perlbrew . ~/perl5/perlbrew/etc/bashrc
        memoize pyenv eval eval '"$(pyenv init -)"'
        memoize rbenv eval eval '"$("$RBENV_DIR"/bin/rbenv init - bash)"'

        export NVM_DIR="$HOME/var/nvm"
        memoize nvm eval 'test -s "$NVM_DIR/nvm.sh" && . "$_" && . "$NVM_DIR/bash_completion"'

        s/bash/zsh/g if you're using zsh

        • 1 month ago
          Anonymous

          Oops, left in a call to an internal function. Replace the first line of the function with
          case $1 in ([[:digit:]]* | *[!_[:alnum:]]) return 2 ;; esac

    • 1 month ago
      Anonymous

      >alias rot13="tr A-Za-z N-ZA-Mn-za-m"
      what do you use this for?

      • 1 month ago
        Anonymous

        Sbe bjavat arjsntf yvxr lbh

        But seriously, it comes in handy whenever someone decides to post something encoded in rot13

  16. 1 month ago
    Anonymous
    • 1 month ago
      Anonymous

      >cls='clear'
      I need this.

      • 1 month ago
        Anonymous

        just press Ctrl+L

  17. 1 month ago
    Anonymous

    ctrl-L is clear
    ctrl-D is exit

    • 1 month ago
      Anonymous

      ctrl-L doesn't clear scrollback unless you rebind it, clear does

      • 1 month ago
        Anonymous

        >scrollback
        I don't have this

        • 1 month ago
          Anonymous

          screen
          Ya do now

          • 1 month ago
            Anonymous

            I don't have this installed.
            nor the other one

          • 1 month ago
            Anonymous

            Then patch your copy of st or downgrade to a kernel that still supports scrollback it's helpful

  18. 1 month ago
    Anonymous

    git config --global alias.hear-hear log
    git config --global alias.enslave branch
    git config --global alias.whip switch
    git hear-hear master
    git enslave rosa-parks
    git whip rosa-parks

  19. 1 month ago
    Anonymous

    alias Black person = 'sudo pacman -Syu --noconfirm --needed'

  20. 1 month ago
    Anonymous

    Having aliases for git commands is extremely useful.
    alias e=$EDITOR
    alias gc="git commit"
    alias ga="git add"
    alias gp="git push"
    alias gs="git status"
    alias gm="git mv"
    alias gd="git diff"
    alias gap="git add -p"
    alias ifrickedup="git submodule update --init --remote --recursive"

    alias m="make -j`nproc`"
    alias mc="make clean"

    alias n="nnn"

    alias i="sudo apt install"
    alias s="sudo apt search"
    alias u="sudo apt update && apt list --upgradable"
    alias ug="sudo apt upgrade"

    • 1 month ago
      Anonymous

      I feel moronic for not thinking of this. Thanks anon.

  21. 1 month ago
    Anonymous

    youtube stuff
    alias getyt='yt-dlp -S res,ext:mp4:m4a --recode mp4'

    alias ytmp3='yt-dlp -f 'ba' -x --audio-format mp3'

    • 1 month ago
      Anonymous

      >alias ytmp3='yt-dlp -f 'ba' -x --audio-format mp3'
      WOW! WHAT a What Baabhabhiat. What is ba?

  22. 1 month ago
    Anonymous

    THese are only ones you're getting. + cd replaced with zoxide
    alias b="bat"
    alias c="code ."
    alias f="fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"
    alias ll="exa -alhb -s=name --group-directories-first --no-user --no-permissions --git"
    alias p="pet search --color | pbcopy"
    alias pn="pet new -t"

    • 1 month ago
      Anonymous

      >fzf
      This looks helpful.

      • 1 month ago
        Anonymous

        it is:
        #!/bin/sh
        gopass ls --flat | fzf | xargs -d'n' -n1 gopass "${1:-show}"

        unlike most anons though, I don't use aliases or functions for things that are honestly scripts.

  23. 1 month ago
    Anonymous

    not sure how this works exactly but very useful

    # These files automatically update when edited/saved in vim:

    # keys filename description
    bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files
    bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file
    cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11
    cfb ~/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm

    # These do not update automatically, but on the next new instance of a program:

    cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config
    cfz $ZDOTDIR/.zshrc # zsh (shell) config
    cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells)
    cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh
    cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config
    cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader)
    cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat
    cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file
    cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
    cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
    cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
    cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler

  24. 1 month ago
    Anonymous

    That's pretty nifty, I read the NOAA weather API in emacs, but this is cool.

  25. 1 month ago
    Anonymous

    zsh global aliases are handy too
    alias -g NUL=/dev/null
    alias -g -- ---h=--help
    alias -g L='| less'
    alias -g L2='|& less'
    alias -g UO='| xargs -I{} xdg-open {}'
    alias -g FF='| xargs -d"n" firefox --'
    Windows emigrants will appreciate NUL

  26. 1 month ago
    Anonymous

    Why the frick do you morons have 1 word aliases to cd into common directories??

    Set autocd and put those directories in your CDPATH. Then you can manage different project shortcuts by just exporting a custom CDPATH for that project.

    • 1 month ago
      Anonymous

      Don't be so hostile to different workflows. It's not a matter of right and wrong.

    • 1 month ago
      Anonymous

      I never liked autocd because it shits up command completion and cd is only two characters plus a space anyway. I need to work CDPATH into my workflow though.

  27. 1 month ago
    Anonymous

    Less can pipe files through a script before viewing using LESSPIPE (not pictured) or my preference LESSOPEN/LESSCLOSE
    export LESS='-iMSFXR#8$ --mouse '
    export LESSOPEN='lessopen.sh %s'
    export LESSCLOSE=': %s; rm -f -- %s >/dev/null 2>&1 &'

    lessopen.sh:
    #!//bin/sh
    # shellcheck shell=dash

    decomp() {
    local infile="$1"
    shift

    tmpfile=$(mktemp)

    # use caller-supplied decompression function and put file arguments first
    if ! "$@" < "$infile" > "$tmpfile"; then
    rm -f -- "$tmpfile"
    exit 1
    fi

    if [ -s "$tmpfile" ]; then
    printf "%sn" "$tmpfile"
    else
    rm -f -- "$tmpfile"
    fi
    }

    # if input file is empty
    if ! [ -s "$1" ]; then
    exit
    fi

    case $1 in
    (*.json) decomp "$1" jq ;;
    (*.json.gz) decomp "$1" eval 'gzip -d | jq' ;;
    (*.json.bz2) decomp "$1" eval 'bzip2 -d | jq' ;;
    (*.json.xz) decomp "$1" eval 'xz -d | jq' ;;
    (*.json.zst|*.json.zstd) decomp "$1" eval 'zstd -dq | jq' ;;
    (*.gz) decomp "$1" gzip -d ;;
    (*.bz2) decomp "$1" bzip2 -d ;;
    (*.xz) decomp "$1" xz -d ;;
    (*.zst|*.zstd) decomp "$1" zstd -dq ;;
    esac

  28. 1 month ago
    Anonymous

    found out about a different alias format

    alias
    cp="cp -iv"
    mv="mv -iv"
    rm="rm -vI"
    bc="bc -ql"
    rsync="rsync -vrPlu"
    mkd="mkdir -pv"
    yt="yt-dlp --embed-metadata -i"
    yta="yt -x -f bestaudio/best"
    ytt="yt --skip-download --write-thumbnail"
    ffmpeg="ffmpeg -hide_banner"

    • 1 month ago
      Anonymous

      Better yet, create your own format and parser

      # ~/.aliases
      cp=cp -iv
      mv=mv -iv
      rm=rm -vI
      bc=bc -ql
      rsync=rsync -vrPlu
      mkd=mkdir -pv

      yt=yt-dlp --embed-metadata -i
      yta=yt -x -f bestaudio/best
      ytt=yt --skip-download --write-thumbnail

      ffmpeg=ffmpeg -hide_banner

      # .bashrc
      while IFS=read -r alias; do
      case $alias in
      (#*|'') continue ;;
      esac
      alias "$alias"
      done < ~/.aliases

  29. 1 month ago
    Anonymous

    aliases is for cucks.
    imagine fully relying on your alises for years and then you find yourself on a random server and notice that your "alias" does not work.
    cucked.

    i recommend to alias nano with vim on random servers though xD

    • 1 month ago
      Anonymous

      I always run alias l='ls -A' ll='l -lh' -='cd -' whenever I'm without my dotfiles. The rest are less important but I would take those three to a desert island.

    • 1 month ago
      Anonymous

      >you find yourself on a random server
      how would this happen

      • 1 month ago
        Anonymous

        your mom asks you to fix her top of the line home server with 24tb of step-son porn that also runs plex and a few minecraft servers

  30. 1 month ago
    Anonymous

    uriDecode ()
    {
    sed 's@+@ @g;s@%@\x@g' | xargs -0 printf "%b"
    }
    magnetReader ()
    {
    uriDecode | sed 's/&/n/g;s/:?xt//;s/urn:btih://' | column -s = -t
    }

    • 1 month ago
      Anonymous

      >magnetReader
      nice one thanks

  31. 1 month ago
    Anonymous

    alias ..=cd ..

    • 1 month ago
      Anonymous

      check this shit out
      .. ()
      {
      local d="";
      local limit="${1:-1}";
      for ((i=1; i<=limit; i++))
      do
      d="../$d";
      done;
      if ! cd "$d"; then
      echo "Couldn't go back $limit dirs." 1>&2;
      return 1;
      fi
      }

  32. 1 month ago
    Anonymous

    The radar ones are actually super cool. Do you know any good programs for viewing NOAA radar data on Linux?
    And for any KDEgays, here's my Dolphin service menu for converting images between different formats. Install to ~/.local/share/kio/servicemenus/MagickConvert.desktop
    https://pastebin.com/jTZemTxc

    • 1 month ago
      Anonymous

      And here I have been using for loops like a caveman...

    • 1 month ago
      Anonymous

      This doesn't work if there are spaces in the file path, I modified it like this:
      Exec=filename=%f; convert %f "${filename%.*}.jpeg"
      Also the convert process sometimes finishes so quickly journalctl will log it as an error as it's trying to do something to a nonexistant process. Not sure if it's possible to fix it properly, a "sleep 1" fixes it but it might make the conversion process slower, never made any desktop files so I'm not sure.

      • 1 month ago
        Anonymous

        Thanks for the fix! I've typically only used this in ~/Downloads and ~/Pictures, so I never had any spaces in the path. As for the errors in the journal, mind sending one? I can't seem to replicate it on my end.

        • 1 month ago
          Anonymous

          For example this file. I get

          Failed to add PIDs to scope's control group: No such process
          Failed with result 'resources'.
          Failed to start MagickConvert.

          Even though the file was successfully converted.

          • 1 month ago
            Anonymous

            Hm, you're right. I'm not sure if it matters, but I'll try fixing it anyway

          • 1 month ago
            Anonymous

            It's just noise in the log file: https://lists.freedesktop.org/archives/systemd-devel/2022-February/047398.html

          • 1 month ago
            Anonymous

            Alright, cool. I'll just leave this final patched version here then, so nobody has to apply your fix manually.
            https://pastebin.com/seuVVmsA

      • 1 month ago
        Anonymous

        Instead of sleep 1 you could use
        (:;:)

        • 1 month ago
          Anonymous

          sleep accepts 0.1

          • 1 month ago
            Anonymous

            sleep will always be slower because it's not builtin

          • 1 month ago
            Anonymous

            In this case, what you use doesn't really matter much since the sleep is after the actual conversion happens. It just exists to keep systemd from b***hing. (Why systemd is even involved at all with something like this, I don't know.)

  33. 1 month ago
    Anonymous

    #!/bin/sh

    # don't alias to nonexistent commands
    aliascmd() {
    for j in "$@"; do
    case "${j%%=*}" in "${j#${j%%=*}=}"|"${j%=}"|"$j") shift; continue ;; esac
    for i in ${j#${j%%=*}=}; do case "$i" in ""|"sudo"|*=*) continue ;; esac; break; done
    command -v "${i%% }" >/dev/null 2>&1 && alias "${j%%=*}"="${j#${j%%=*}=}"
    done
    }

    # replace sudo if needed
    command -v sudo >/dev/null 2>&1 || {
    # do what we have to do
    aliascmd sudo="suexec"

    # preferred
    aliascmd sudo="doas"
    }

    aliascmd
    ls="ls --group-directories-first --color=auto -ChN"
    la="ls -A"
    l.="ls -d .*"
    l1="ls -1"
    l1a="ls -1A"
    l1.="ls -d .* -1"
    l.1="ls -d .* -1"
    ll="ls -l"
    lla="ls -lA"
    ll.="ls -d .* -l"
    l="ls"
    startx="startx $XINITRC"
    vim="nvim"
    vimdiff="nvim -d"
    xi="sudo xbps-install"
    xq="xbps-query"
    xr="sudo xbps-remove -R"
    yt="yt-dlp --config-locations "${XDG_CONFIG_HOME:-$HOME/.config}/yt-dlp/video-config""
    yta="yt-dlp --config-locations "${XDG_CONFIG_HOME:-$HOME/.config}/yt-dlp/audio-config""
    e="${EDITOR:-vi}"
    g="git"
    cl="clear"
    cdd="cd /"
    ..="cd ../"
    c-="cd -"
    reboot="sudo reboot"
    poweroff="sudo poweroff"
    cp="cp -iv"
    mv="mv -iv"
    rm="rm -Iv"
    mkdir="mkdir -v"
    chmod="chmod -v"
    chown="chown -v"
    ln="ln -v"
    pkill="pkill -e"
    dir="ls"
    vdir="ls"
    grep="grep --color=auto"
    fgrep="fgrep --color=auto"
    egrep="egrep --color=auto"

    # cd to last lf dir
    command -v lf >/dev/null 2>&1 && lfcd() { cd "$(command lf -print-last-dir "$@")"; }; aliascmd lf="lfcd"

    # lie to elinks about the terminal type if running
    # under a 256-color multiplexer (eg. tmux/screen)
    [ "$TERM" = "screen-256color" ] && aliascmd elinks="TERM=xterm-256color elinks"

  34. 1 month ago
    Anonymous

    function mkcd() {
    mkdir -p "$@" && eval cd ""$$#"";
    }

    • 1 month ago
      Anonymous

      You should use eval cd -- "" ${$#}"" in case there are more than 9 arguments, or just shift $(($# - 1)) && cd -- "$1"

  35. 1 month ago
    Anonymous

    alias cp="cp -iv"
    alias rsync="rsync --partial --append-verify --verbose"
    alias weather="curl https://wttr.in/$NOT_TODAY_FBI"
    export SCROT_AFTER_SCREENSHOT_CMD=(mv "$f" ~/img/screenshots)
    alias scrot="scrot -e '${SCROT_AFTER_SCREENSHOT_CMD[@]}'"
    play(){
    mpv $(find -maxdepth 1 -regex '.*.(jpg|png|webm|mp4|gif)' | sort | head
    -n 1) #--script=~/.config/mpv/scripts-opts/autoload.lua
    }

  36. 1 month ago
    Anonymous

    if [[ ! $(ps -e | grep emacs) ]] ; then
    (emacs --daemon=e) &> /dev/null &
    disown -a
    fi
    alias emacs='emacsclient -s /usr/var/run/emacs1000/e -c -a ""'

    bind -x '"C-e": emacsclient -s /usr/var/run/emacs1000/e -c -a "" 2> /dev/null'

  37. 1 month ago
    Anonymous

    alias ffmpeg="ffmpeg -hide_banner"
    alias ffprobe="ffprobe -hide_banner"
    alias ffplay="ffplay -hide_banner"

  38. 1 month ago
    Anonymous

    alias cp="mv"
    Little trick to save disk space

  39. 1 month ago
    Anonymous

    spent a day organizing a dotfiles directory and symlinking to home. highly recommend if you frequently jump between environments
    alias src='source ~/.bashrc'
    alias aliases='vi ~/.aliases'
    alias envs='vi ~/.env'
    alias funcs='vi ~.functions'
    alias rc='vi ~/.bashrc'
    alias profile='vi ~/.bash_profile'
    alias venv='python3 -m venv env'
    alias cat='bat'
    alias df='df -h'
    alias du='du -h'
    alias ..='cd ..'
    alias ...='cd ../..'
    alias ....='cd ../../..'

Your email address will not be published. Required fields are marked *