• @[email protected]
    link
    fedilink
    English
    387 months ago

    I went a little overboard and wrote a one-liner to accurately answer this question

    history|cut -d " " -f 5|sort|uniq -c|sort -nr|head -5
    

    Note: history displays like this for me 20622 2023-02-18 16:41:23 ls I don’t know if that’s because I set HISTTIMEFORMAT='%F %T ' in .bashrc, or if it’s like that for everyone. If it’s different for you change -f 5 to target the command. Use -f 5-7 to include flags and arguments.

    My top 5 (since last install)

       2002 ls
       1296 cd
        455 hx
        427 g
        316 find
    

    g is an alias for gitui. When I include flags and arguments most of the top commands are aliases, often shortcuts to a project directory.

    Not to ramble, but after doing this I figured I should alias the longest, most-used commands (even aliasing ls to l could have saved 2002 keystrokes :P) So I wrote another one-liner to check for available single characters to alias with:

    for c in a b c d e f g h i j k l m n o p q r s t u v w x y z; do [[ ! $(command -v $c) ]] && echo $c; done
    

    In .bash_aliases I’ve added alias b='hx ${HOME}/.bash_aliases' to quickly edit aliases and alias r='source ${HOME}/.bashrc' to reload them.

      • @[email protected]
        link
        fedilink
        English
        67 months ago

        Yup! Migrated from VSCodium; wanted to learn a modal editor but didn’t have the time or confidence to configure vim or neovim. It’s been my go-to editor for 2+ years now.

        • @[email protected]
          link
          fedilink
          English
          47 months ago

          I’ve been using vi (just the basics) for ~4 years, I don’t think I could be arsed to pick up the keybindings the other way around lol. I’ve heard very good things about Helix, of course

          • @[email protected]
            link
            fedilink
            English
            37 months ago

            As another longtime Vi user - I had a hell of a time & wound up switching back lol

            I think for a lot of folks Helix would be intuitive. Vi has her hooks in me, though.

  • @[email protected]
    link
    fedilink
    2
    edit-2
    7 months ago

    I often play an old DOS game in DOSBox, and when I exit it doesn’t reset the screen resolution. So I reset it manually by typing

    xrandr -output e-DP1 -auto

  • @[email protected]
    link
    fedilink
    97 months ago

    diff -y -W 200 file1 file2

    Shows a side by side diff of 2 files with enough column width to see most of what I need usually.

    I have actually aliased this command as diffy

    ctrl-r

    searching bash history

    du -sh * | sort -h

    shows size of all files and dirs in the current dir and sorts them in ascending order so you can easily see the largest files or dirt ant the end of the list

    ls -ltr

    Shows the most recently modified files at the end of the listing.

      • @[email protected]
        link
        fedilink
        17 months ago

        I use it to mount cloud storage as network drives… I’ll have to look into your implication though!

    • Sneezycat
      link
      fedilink
      37 months ago

      I just aliased “sudo pacman -Syu && yay -Syu --aur” to “update” cause I got tired of writing it every day.

      • @[email protected]
        link
        fedilink
        English
        147 months ago

        You can just run yay with no arguments and it does exactly what your update script does.

      • Noxious
        link
        fedilink
        17 months ago

        Wouldn’t it make more sense to just yay -Syu to update everything, normal packages and AUR packages?

        • Sneezycat
          link
          fedilink
          17 months ago

          The reason I did it like this is because:

          • I didn’t know yay could invoke pacman
          • I didn’t want yay “upgrading” my pacman packages with AUR packages.

          But I was just misunderstanding yay. As another comment said before you, one can just run yay without any arguments and it accomplishes the same thing.

          • Noxious
            link
            fedilink
            27 months ago

            Yay doesn’t replace normal packages with AUR packages. Btw It’s not just an AUR helper, it’s a wrapper for Pacman with AUR support built-in. Check out paru btw, it’s a more modern version of yay that basically works the same way: https://github.com/Morganamilo/paru