• NostraDavid@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      1 day 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
      
  • Bappity@lemmy.world
    link
    fedilink
    English
    arrow-up
    197
    arrow-down
    2
    ·
    edit-2
    3 days ago
    $ cd ..
    $ ls
    $ cd ..
    $ ls
    

    “hmm yes… everything seems to be in order”

    • LiveLM@lemmy.zip
      link
      fedilink
      English
      arrow-up
      42
      arrow-down
      1
      ·
      edit-2
      3 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

      • grrgyle@slrpnk.net
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        You probably want rangerfm or vifm. They use miller columns for to show you your surrounding context.

      • Fushuan [he/him]@lemm.ee
        link
        fedilink
        arrow-up
        20
        ·
        3 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
          19
          ·
          3 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.

          • ka1ikasan@lemmy.zip
            link
            fedilink
            arrow-up
            5
            ·
            3 days ago

            Did that years ago, just called it cds. I also have an “up” command which is an alias to “cds …”. Oh, and I have a “setup server_name” they copy all my aliases to a server and create an alias that allow me to “ssh -A server_name” using only server_name.

      • Eyedust@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        10
        ·
        3 days ago

        Alternatively, you could use a TUI file manager. Once you get the navigation down you can manage things pretty quickly. Especially with ones that have options for dual directory layouts, like Midnight Commander or vifm.

      • Prime@lemmy.sdf.org
        link
        fedilink
        arrow-up
        6
        ·
        3 days ago

        It is called windows 2000 explorer and it’s great for file operations :) In Linux i have yet to find a really good replacement ;(

      • Bappity@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 days ago

        that, or you have to make ABSOLUTELY SURE that you haven’t accidentally pressed a button on your keyboard that has inevitably resulted in the total destruction of the directory contents

      • turtlesareneat@discuss.online
        link
        fedilink
        English
        arrow-up
        12
        ·
        3 days ago

        Doesn’t let you rifle through things approvingly as you go. "Yes this is the correct directory because it has the three files I was looking at earlier–

        You know what let’s do a ls -al just to be super sure it’s the right modification

    • peoplebeproblems@midwest.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      Sometimes I throw off the linux admin reading my log by throwing in a pwd before going to the next one. Know it’s not gonna be in that directory you know?

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

    • sleet01@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 days ago

      Really buried the lede there: pushd and popd are what I use instead of cd most times!

  • Matriks404@lemmy.world
    link
    fedilink
    arrow-up
    29
    ·
    edit-2
    3 days ago
    alias cd..='cd ..'
    alias cd...='cd ../..'
    alias cd....='cd ../../..
    alias cd.....='cd ../../../..'
    
  • lemmyhavesome@lemmy.world
    link
    fedilink
    arrow-up
    53
    arrow-down
    1
    ·
    edit-2
    3 days ago
    In your rc:
    alias ..='cd ..'
    alias ...='cd ../..'
    alias ....='cd ../../..'
    
    Usage:
    1/2/3 $ ...
    1 $
    
  • ian@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 days 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.

    • oni ᓚᘏᗢ@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 days ago

      I was about to post something similar. With fish you can do your own functions, right? So, you can pass any dots as arguments to a function called cd, so, for every extra dot after .., you append a /.. at the end.

      • zitrone 🍋@lemmings.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 days ago

        yeah, but its less visual

        cd ..... is harder to understand than cd ../../../..

        also the extension work with any commend, not just cd

    • Maxxie@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      10
      ·
      3 days ago

      Installing zoxide led me to installing fzf, which has improved my terminal experience by about 35%, I already installed it in all the machines I’m managing

      Got any more tools? :)

      • grrgyle@slrpnk.net
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 day ago

        I can recommend featureful terminal emulator Kitty. I’d been using tmux and screen for over a decade, but now just get that functionality baked into the terminal. The only time I use tmux now is for remote sessions.

        • Maxxie@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          I am tmuxed all the time, the idea of integrating it into the terminal is interesting. I’ll need to think about it, thanks for the suggestion :)

      • grrgyle@slrpnk.net
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        eza is pretty cool, too. I replacement for ls which has built in tree view, dir size summary, and git status.

      • zqwzzle@lemmy.ca
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 days ago

        I don’t think there’s anything too unusual but here’s my nix packages

        { pkgs }:
        
        with pkgs; [
          # General packages for development
          copier      # Project scaffolding and templating
          fastlane
          jujutsu
          just        # Project specific command runner
          mise        # Tool version manager
          ngrok       # Public tunnel ngrok.com
          sqlite
          pre-commit
          trufflehog  # Scan for secrets in code repositories
        
          # Encryption and security tools
          age
          age-plugin-yubikey
          gnupg
          libfido2
        
          # Container tools and SDKs
          colima
          podman
          podman-compose
        
          # Media-related packages
          dejavu_fonts
          ffmpeg
          hack-font
          noto-fonts
          noto-fonts-emoji
          meslo-lgs-nf
          yt-dlp
        
          # Text and terminal utilities
          bat
          btop        # resource monitor
          #chezmoi    # manage dotfiles; to try
          coreutils   # GNU system tools
          curl
          delta
          exiftool
          f3          # flash drive verification tool
          fd          # alternate find command
          fzf
          htop
          iftop
          jq          # command line JSON tool
          # openssh
          ripgrep
          s3cmd
          shellcheck  # static analysis for shell scripts
          tree
          tmux
          unison
          unrar
          unzip
          wget
          zip
          zoxide
        
          # fish specific
          fishPlugins.foreign-env
          fishPlugins.forgit
          fishPlugins.fzf-fish
          fishPlugins.tide
          fishPlugins.z
        
          # Python packages
          python3
          virtualenv
        ]
        
      • Eyedust@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        5
        ·
        edit-2
        3 days ago

        Check out Atuin. Its another must have for me. When you push up arrow, it shows your command history in a very pleasing list. You can even generate account keys to migrate your history between PCs, but I’ve never bothered with it. You can also search past commands on the history menu.

        You don’t need an account for it. That’s only for the migration keys.

      • AVengefulAxolotl@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        3 days ago

        Yeah, these two are fucking awesome. I recently installed zoxide and OMG, i dont know how ive lived without it.

        Other awesome tools: Eza - prettier ls Yazi - vim-like file manager