• Bappity@lemmy.world
    cake
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    19 days ago
    $ cd ..
    $ ls
    $ cd ..
    $ ls
    

    “hmm yes… everything seems to be in order”

    • LiveLM@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      18 days ago

      I need a shell/plugin/tool/whatever that always shows me the content of the current dir in a little popup or something.

      Anything I do in the shell is like cd this, ls, cd there, ls *, I feel like a have the navigational awareness of a amnesiac goldfish

      • Fushuan [he/him]@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        18 days ago

        Put this in bashrc or whatever flavour of shells’s bashrc you use:

        function cs () { cd “$@” && ls }

        I didnt remember the function sintax of bash so I just copied it from SO.

        • Artyom@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          18 days ago
          cs () {
              cd $1;
              ls ${@:2}
          }
          

          You (probably) only want to pass the first argument to cd, this’ll send the rest to ls.

  • technotony@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    Easiest solution, use fish instead of bash! Default fish keybindings will allow you to just type . . or name a directory similar to how you could do with Zoxide.

    Also, wait until you find about pushd and popd ;)