Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • > At a previous company, I shared a trick on slack every day with the engineering team, both technical and company-specific, and folks found them pretty useful.

    I would find that annoying, however to not be seen as a jerk I wouldn't say anything.

  • Simple trick I use almost daily for navigating backwards to an exact directory:

    https://gist.github.com/GNOMES/6bf65926648e260d8023aebb9ede9...

    I use this often instead of chaining together multiple '../..'.

    Also nice for when I use Zoxide to CD into a deep nested directory. I quickly found out unless you manually CD each hop, the different parent directories aren't added to your Zoxide DB. (I have come across snippits to recursively CD into all directories in a path to "prepopulate" Zoxide).

    I made this to jump directly from say `/foo/bar/batz/abc/123` to `/foo/bar/batz`.

  • I can recommend https://www.oreilly.com/library/view/unix-power-tools/059600...

    The "Unix Power Tools" book is an excellent source for Unix and shell usage tricks

  • I am so proud of this (I'm sure others came up with it way before me, but I still came up with it all by myself!)

        //*
            normal path
        /*/
            debug path
        //*/
    
    take away the the first slash to toggle the debug zone ON!
  • Those were not programming tricks, but computing tricks or command line/sql tricks.

    Anyways I find it mind boggling how many useful actions are not known by „normal people”. Most people are really using computers in a very inefficient way.

    My idea is if we would spend time making people learn computers or software they use daily better - we wouldn’t need AI agents and we would triple GDP.

    by ozim
  • A lot more tricks can be learned from just watching AI work. Instead of allowing AI to work autonomously, go back to the old days where you manually approve every command the AI runs. Just recently while doing performance optimization work, I found Opus using the `perf` command in ways I didn’t know possible. Just give AI a real task and carefully read what commands are used by the AI to solve the problem; most likely the AI uses a trick or two that you didn’t know existed.
  • For people asking "do these small tricks/trivia really matter??" I have an example of when they do:

    - having strange networking issues on the blue side of a blue/green deployment

    - networking engineers are involved

    - nobody seems to be able to figure out what's going on despite LOTS of tcpdump/wireshark etc

    - I suggest tcpflow[0] (which I used for protocol analysis of chat services etc)

    - (there is some skepticism as I was SRE and not networking)

    - Turns out that the TCP messages were getting truncated on the problem side

    - Networking guys realize the config issue and fix it

    I have other examples but this is why it's always good to learn new commands/tools etc.

    This, in turn, reminds me of a quote from an army jungle survival expert: "People ask me if it's a good idea to read survival books. I say: 100%. You would be surprised how many people survive an emergency situation because their brain pops out some critical piece of information from a book or article they read 10 years ago."

    0 - https://linux.die.net/man/1/tcpflow

  • The thing with a lot of these tricks is that you have to get into the habit of using them. I knew `Ctrl+r` for history since I learned about the command line. I even have a nice shell integration with fzf. But I still used the up/down arrow keys for years or scrolled up when I was looking for a previous command, because I never remembered the shortcut and just took the path of least resistance to find something.

    Usually what I do is writing these tricks down to a document that is easily accessible at a place where I know that I will look for when failing to remember them. I have a directory of docs where I write stuff like this down by language/tool/etc., so I can quickly look it up without having to search the internet. But I also have to actively remind myself that these things exist whenever I have a problem, stop me from just doing the inefficient thing.

Explore Birbla archives