Live data from Hacker News

Show HN: lscat – ls for directories, cat for files

github.com

1–4 of 4 posts

Re: Show HN: lscat – ls for directories, cat for files

#3
post #2

I'm sure this should not be done as a separate package, but as a simple function in .bashrc/.zshrc lscat(){ if [ -d $1 ]; then ls $1 elif [ -f $1 ]; then cat $1 else echo "$1 is not valid path" fi } Similarly, you can also use alias ls=lscat

I created independent binary for the sake of using the same thing in bash/fish/powershell and for the ease of adding functions, but for simple use, that way would be better.