• over_clox@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Honestly I haven’t tried this on Linux yet, but didn’t Windows implement this somewhere along the way?..

    cd ....

    • vortic@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      I aliased cd to a custom funtion in my bashrc to do this at one point, but cd ../../../.. is too engrained so I never rembered to use it.

      • over_clox@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        Interesting, I might have to check that out someday.

        Though when I write scripts, I’m not a fan of blind folder navigation like that, there’s a good reason for the pushd and popd script commands.

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          Oh yeah, I wouldn’t use that for scripts. I wouldn’t use zsh for scripts either.
          I mean, I believe, it’s generally compatible with bash, but just throwing a shebang like #!/bin/sh or #!/bin/bash into the first line of the script will make it execute with sh or bash, even when you run it from zsh.

  • 6nk06@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    The history of the CTO at a previous job was filled with dc and sl because he was a fucking moron. Yes I’m still bitter that he earned way more money than me who had to fix all his mess.

  • ian@feddit.uk
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    The good thing about Dolphin is you can have the real tree following your navigation. Want to go up a few levels, just click once, directly where you want to go next. None of this up, up, up nonsense. Great for snooping in many different folders in quick succession.

    • NostraDavid@programming.devdeleted by creator
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      The first two options (autocd and cdspell) have been a lifesaver in fixing my frustrations with the default bash settings (and even lets me stick with bash, instead of feeling I should move to zsh or any other shell.

      I can just type a foldername, tabcomplete it and press enter to go there. It’s great.

      # == shopts ==
      # https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
      shopt -s autocd         # cd into folder without cd, so 'dotfiles' will cd into the folder
      shopt -s cdspell        # attempt spelling correcting on folders
      shopt -s direxpand      # expand a partial dir name
      shopt -s checkjobs      # stop shell from exit when there's jobs running
      shopt -s dirspell       # attempt spelling correcting on folders
      shopt -s expand_aliases # aliases are expanded
      shopt -s histappend     # append to the history file, don't overwrite it
      shopt -s histreedit     # lets your re-edit old executed command
      shopt -s histverify     # I'm confused.
      shopt -s hostcomplete   # performs completion when a word contains an '@'
      shopt -s cmdhist        # save multiple-line command in single history entry
      shopt -u lithist        # multi-lines are saved with embedded newlines rather than semicolons; explictly unset
      shopt -s checkwinsize # update LINES and COLUMNS to fit output
      
  • Forester@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    Why no cd /////// speceficterm if you know how deep it is

    Those are supposed to be stars. I’m not fixing this on a phone

  • technotony@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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 ;)