this post was submitted on 25 May 2025
869 points (98.3% liked)

linuxmemes

25123 readers
907 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS
     
    top 50 comments
    sorted by: hot top controversial new old
    [–] bitchkat@lemmy.world 14 points 2 days ago (1 children)

    You forgot the pwd after each 'cd'.

    [–] some_guy@lemmy.sdf.org 8 points 2 days ago (1 children)
    alias ..='cd ..' #: up one directory
    alias ...='cd ../..' #: up two directories
    

    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 191 points 4 days ago* (last edited 4 days ago) (6 children)
    $ cd ..
    $ ls
    $ cd ..
    $ ls
    

    "hmm yes.. everything seems to be in order"

    [–] grrgyle@slrpnk.net 3 points 2 days ago (1 children)
    cd ..
    pwd
    ls
    ls -a
    tree -d
    git status -bs
    
    cd ..
    ...
    
    [–] bappity@lemmy.world 2 points 2 days ago (1 children)
    [–] grrgyle@slrpnk.net 2 points 2 days ago

    Then you invite chaos to sit in your lap, friend

    [–] LiveLM@lemmy.zip 39 points 4 days ago* (last edited 4 days ago) (9 children)

    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

    [–] ivanafterall@lemmy.world 4 points 2 days ago

    A window, you say!?

    [–] grrgyle@slrpnk.net 3 points 2 days ago

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

    [–] fushuan@lemm.ee 19 points 4 days ago (1 children)

    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 18 points 3 days ago (1 children)
    cs () {
        cd $1;
        ls ${@:2}
    }
    

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

    load more comments (1 replies)
    [–] Eyedust@lemmy.dbzer0.com 10 points 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.

    load more comments (5 replies)
    load more comments (4 replies)
    [–] Matriks404@lemmy.world 28 points 3 days ago* (last edited 3 days ago) (1 children)
    alias cd..='cd ..'
    alias cd...='cd ../..'
    alias cd....='cd ../../..
    alias cd.....='cd ../../../..'
    [–] AA5B@lemmy.world 6 points 2 days ago (1 children)

    Then forget all that and just use

    cd ~ or cd /

    No need for ~ - just cd works as well.

    [–] lemmyhavesome@lemmy.world 49 points 3 days ago* (last edited 3 days ago) (5 children)
    In your rc:
    alias ..='cd ..'
    alias ...='cd ../..'
    alias ....='cd ../../..'
    
    Usage:
    1/2/3 $ ...
    1 $
    
    [–] pineapplelover@lemm.ee 12 points 3 days ago

    That's pretty neat

    load more comments (4 replies)
    [–] wpb@lemmy.world 43 points 3 days ago* (last edited 3 days ago) (1 children)
    [–] karmiclychee@sh.itjust.works 34 points 3 days ago (1 children)

    Excuse me what? I've been multi cd'ing for years like a chump?

    [–] beeng@discuss.tchncs.de 10 points 3 days ago (2 children)

    Exactly. The fucking what now?

    load more comments (2 replies)
    [–] Zachariah@lemmy.world 55 points 4 days ago* (last edited 4 days ago) (1 children)

    cd ..
    ⭑ ⏎
    ⭑ ⏎
    ⭑ ⏎

    load more comments (1 replies)
    [–] Naich@lemmings.world 24 points 3 days ago

    for i in { 1..4 }; do cd ..; done

    [–] technotony@sh.itjust.works 4 points 2 days ago (1 children)

    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 ;)

    load more comments (1 replies)
    [–] quantenzitrone@lemmings.world 16 points 3 days ago (3 children)

    i use fish shell with https://github.com/nickeb96/puffer-fish

    basically when i type ... it expands to ../.. and adds another /.. for every additional dot i type

    its similar to what the zsh users in the comment section are doing

    load more comments (3 replies)
    [–] MoogleMaestro@lemmy.zip 8 points 3 days ago (1 children)
    [–] grrgyle@slrpnk.net 2 points 2 days ago (1 children)

    What's so surprising?? What did you see in that dir??

    [–] NostraDavid@programming.dev 2 points 2 days ago (1 children)

    Double-bang repeats the previous command. Great if you forget sudo.

    $ rm -rf <folder>
    permission denied
    $ sudo !!
    
    [–] grrgyle@slrpnk.net 1 points 2 days ago

    Haha yeah I was just being silly

    [–] zqwzzle@lemmy.ca 23 points 4 days ago (10 children)
    load more comments (10 replies)
    [–] axEl7fB5@lemmy.cafe 11 points 3 days ago
    cd ..
    !!
    !!
    !!
    
    [–] OpenStars@discuss.online 30 points 4 days ago (1 children)

    Depending on where you are, maybe just "cd".

    load more comments (1 replies)
    [–] Drekaridill@feddit.is 29 points 4 days ago

    cd .. ls cd .. ls cd .. ls cd .. ls

    [–] funkajunk@lemm.ee 25 points 4 days ago (2 children)

    I alias .. to cd ..

    Works for me 🀷🏻

    [–] Bonsoir@lemmy.ca 21 points 4 days ago

    I do that too!
    I also alias ... to cd ../... I'll be honest, I often forget to do it, but in theory it can speed things up.

    load more comments (1 replies)
    [–] beerclue@lemmy.world 16 points 3 days ago

    I use a lot cd - (go to previous) or just cd to go home.

    [–] AceFuzzLord@lemm.ee 4 points 3 days ago

    I feel called out. Should definitely make an alias or two that auto CDs me the amount of times I need...

    [–] billwashere@lemmy.world 17 points 4 days ago* (last edited 4 days ago) (4 children)

    Or the alias I have set up

    …..

    load more comments (4 replies)
    [–] lambda@programming.dev 12 points 4 days ago (3 children)
    load more comments (3 replies)
    [–] _thebrain_@sh.itjust.works 14 points 4 days ago* (last edited 4 days ago) (2 children)
    load more comments (2 replies)
    [–] ian@feddit.uk 1 points 2 days ago* (last edited 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.

    load more comments
    view more: next β€Ί