Live data from Hacker News

Unix Commands I Wish I’d Discovered Years Earlier

spin.atomicobject.com

101–110 of 259 posts

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

#101

If anyone is interested there were several great posts on Hacker News a while about about useful UNIX commands [1, 2, 3]. I have also created several screencasts about command commands like the following [4], and one about the Filesystem Hierarchy Standard [5]. ls man pwd cd top ps df du cp mv rm mkdir rmdir less cat vi [1] https://news.ycombinator.com/item?id=6046682 [2] https://news.ycombinator.com/item?id=5022457…

You should do a screencast of such infinitely useful classics as tac, tsort, and sl.

(Actually, I have found use for those first two on occasion. ;)

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

#102

I recommend Quicksilver on mac, free and powerful. It lets you to find a lot of stuff (application, contact, email, etc.) and manipulate them (send, forward, print, etc.) http://qsapp.com/

Also in that vein on Mac it's worth having a look at Alfred http://alfredapp.com

Alread rocks. You can develop workflows for common groups of tasks and it integrates well with iTunes, 1Password, Terminal and other system actions/apps.

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

#104

If anyone is interested there were several great posts on Hacker News a while about about useful UNIX commands [1, 2, 3]. I have also created several screencasts about command commands like the following [4], and one about the Filesystem Hierarchy Standard [5]. ls man pwd cd top ps df du cp mv rm mkdir rmdir less cat vi [1] https://news.ycombinator.com/item?id=6046682 [2] https://news.ycombinator.com/item?id=5022457…

You should do a screencast of such infinitely useful classics as tac , tsort , and sl . (Actually, I have found use for those first two on occasion. ;)

Thanks for the suggestion! Actually, I initially wanted to do one on more advanced commands, but I thought I'd better lay a foundation first. I also want to cover using pipe (|) to chain these commands together. I'll make sure to include these.

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

#105

Earlier quoted context omitted.

Yeah, before I was heavily into automation (i.e. puppet) this was my go to command. Use a for loop and ssh to run things on a group of systems. for host in h-abc h-def h-ghi h-jkl h-mno h-pqr h-stu h-vwx h-yza; do ssh -l root $host "hostname; echo "1.1.1.1 server" >> /etc/hosts"; done This would iterate over hosts (h-abc .. h-yza) and run the commands "hostname; echo "1.1.1.1 server" >> /etc/hosts". Or maybe use a fo…

make a small change: for host in ... ; do ssh -l root $host "..." & done; wait and it's very parallel. All that key exchange takes a while, so it's not ridiculously fast, but it's pretty good. If you've got ControlMaster set up already to be per-host, this might very well be very fast the second time.

You may want to look into using GNU parallel with that.

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

#107

Do yourself a favor: unzip the source for ascii.7 and change the order of the tables: hex, then decimal, then octal. You'll thank me later.

I kind of like how the hex and char columns are next to each other though. Makes it easier to read those two columns together quickly.

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

#108

Mac OS: pbpaste & pbcopy For instance: pbpaste | fgrep -i "`pbpaste -pboard find`" To search the copy clipboard with the find clipboard.

I first ran into clipboard copy/paste on Mac. Discovered "xclip" on Linux. Aliased copy to 'xc' and paste to 'xp', later added 'xpc' to paste from the secondary (application) clipboard.

Makes all sorts of hackery possible.

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

#109

If anyone is interested there were several great posts on Hacker News a while about about useful UNIX commands [1, 2, 3]. I have also created several screencasts about command commands like the following [4], and one about the Filesystem Hierarchy Standard [5]. ls man pwd cd top ps df du cp mv rm mkdir rmdir less cat vi [1] https://news.ycombinator.com/item?id=6046682 [2] https://news.ycombinator.com/item?id=5022457…

Great links, though I admit when I saw the OP I was expecting content like that and was pleasantly surprised that they really were "Unix commands I wish I'd discovered years earlier", and not the standard array of unix tips+tricks that you can get by without for awhile but as you become more advanced become second-nature.

"Man ascii." The number of times that I wound up generating my own ascii table from whatever language I was working with...

"xxd" I always either used search in emacs hex-mode (which I find cumbersome and annoying but haven't taken the time to customize), or rolled my own search using a programming language. This would have come in handy SO many times back when I used to muck around with videogame save files and the like. I never even knew it existed nor how to discover that it did.

'cal' I learned about early on so never missed it and the 'ssh' stuff kind of fits into the regular "unix tips and tricks" category.

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

#110
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?

Try something like:

find . | sed -e 's=/[^/]*$==' | uniq -c

Post reply on HN