Should `cat` and `ls` Make a Baby?

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024

ความคิดเห็น • 3

  • @luke.stoodley
    @luke.stoodley 25 วันที่ผ่านมา +4

    cant you just do "ls | cat"

    • @g0t4
      @g0t4  24 วันที่ผ่านมา

      maybe `cat /path/to || ls /path/to` ?
      but I'm too lazy to type that out ;) ... sweep it under the function rug

    • @g0t4
      @g0t4  24 วันที่ผ่านมา

      `ls` first means `ls` would almost always win, short of non-existent files or a permission issue
      Since making the video, I've been thinking about renaming the command as 'catls' whereby I just give cat the ability to do ls on dirs... I took off the `abbr la/ls` and now just expand `cat` => `lscat`/`catls`... plenty of times I wanna look at file permissions and not dump file contents, but if I am dumping a path then if its a dir I absolutely want to list the contents.