Live data from Hacker News

Unix Commands I Wish I’d Discovered Years Earlier

spin.atomicobject.com

11–20 of 259 posts

Re: Unix Commands I Wish I’d Discovered Years Earlier

#11
post #7
post #3

Never knew about the "cal" command. I especially like that you can quickly look up a previous or future month/year. >> cal 3 1973 quickly shows a calendar of March 1973

you can even look up `cal sept 1752`

Funny, 3-13 are missing here.

  > cal sep 1752
     September 1752     
  Su Mo Tu We Th Fr Sa  
         1  2 14 15 16  
  17 18 19 20 21 22 23  
  24 25 26 27 28 29 30
Edit: Oh, colour me surprised. https://en.wikipedia.org/wiki/September_14

Re: Unix Commands I Wish I’d Discovered Years Earlier

#12
post #6

I want a command that counts files in a tree like du does sizes but without having to pipe find through wc which is crazy for hundred thousand files. Can't they just directly access inodes for high speed counting?

Counting number of files is probably not a sufficiently frequently used case to justify a new standard command. What part of piping concerns you?

Re: Unix Commands I Wish I’d Discovered Years Earlier

#13
post #6

I want a command that counts files in a tree like du does sizes but without having to pipe find through wc which is crazy for hundred thousand files. Can't they just directly access inodes for high speed counting?

> Can't they just directly access inodes for high speed counting?

Don't know what you mean by that exactly. But, I'd be stunned if find is actually reading the actual files rather than just reading the directory entries in directory "files". Which is what I'd call accessing inodes "directly"

Re: Unix Commands I Wish I’d Discovered Years Earlier

#16
post #12
post #6

I want a command that counts files in a tree like du does sizes but without having to pipe find through wc which is crazy for hundred thousand files. Can't they just directly access inodes for high speed counting?

Counting number of files is probably not a sufficiently frequently used case to justify a new standard command. What part of piping concerns you?

It can be really slow, even for a few tens of thousands of tiles. I remember watching Nautilus's "properties" panel slowly count up the number of files and directories.

Re: Unix Commands I Wish I’d Discovered Years Earlier

#19
post #5
post #3

Never knew about the "cal" command. I especially like that you can quickly look up a previous or future month/year. >> cal 3 1973 quickly shows a calendar of March 1973

Aliasing to 'cal -3' can also be good if you want a little continuity.

The -3 arg is not available on OS X. Odd, since it's been in BSD Unix since forever. http://www.freebsd.org/cgi/man.cgi?query=cal
Post reply on HN