News for hackers. Stuff that matters.
Re:Eza: A modern, maintained replacement for ls by mixmastamyk on Monday July 22, 2024 @04:47PM (#41039640)
I realized most of my ls runs come right after `cd`, so I added these to my startup files. Now almost every `cd` does `ls` automatically:

    # bash, simple
    function cd() {
        builtin cd "$@" && ls -l
    }

    # fish, a bit more sophisticated
    function cd

        builtin cd $argv;
        if test $status -gt 0  # there was an error, stop
            return
        end

        # auto print dir info
        if test "$argv" != ""  # not home though
            dir  # aka ls -l ...
        end
    end

There are no comments on this comment yet.