Live data from Hacker News

Unix tricks

mmb.pcb.ub.es

21–30 of 232 posts

Re: Unix tricks

#21
post #5

1) `pgrep` is a standard utility that does what his `psgrep` does and much much more. 2) htop is a cpu and memory hog -- every time I've used it I noticed it takes 6+% CPU time 3) there's an awk trick to do the `sort | uniq` recommendation that works on 10+GB files (single pass): awk '!x[$0]++' 4) Passwordless keys are dangerous -- use ssh-agent to save the password of the keys

3) if all the lines of the 10+GB file are actually unique, wouldn't awk keep the whole file in RAM? For files larger than my RAM could this leave my system unresponsive because it's thrashing on swap?

Re: Unix tricks

#24

SMB is better than NFS in Unix Tricks? Shame Shame Shame. Possibly just wrong. Like the rest though. Thanks!

I know, that's controversial... but I've had zero problems with SMB and many ones with NFS. Just my two cents.

Re: Unix tricks

#26

Whut? ctrl-r? How have I missed that? No more 'history|grep foo' for me!

Try this in your .inputrc:

    # Bind the up arrow to history search, instead of history step
    "\e[A": history-search-backward
    "\e[B": history-search-forward
No more "^rls" to search for ls in your bash history; just type "ls" and start hitting the up arrow.

Re: Unix tricks

#29
post #2

So happy to see this on HN! Actually I took most of the tips from unix threads here and r/commandline, I highly recommend that subreddit if you like this kind of tricks! Edit: also, @climagic: https://twitter.com/climagic Second edit: I'm enhancing the file with these comments, so if there are any inconsistencies between the txt and a commenter, it's my fault.

Hostiàs! Topopardo! I used to follow your podcasts long ago :D. Anyway, nice list of tips.

Re: Unix tricks

#30
post #3

> SMB is better than NFS. More details would be nice.

I've found NFS to use much less cpu than SMB (on raspberry pis running XBMC at least)

I second this..

If you use any NAS device with a weak CPU and you have a choice of CIFS or NFS, the NFS transfer rates are normally 25% faster and the load is much less on the server.

Post reply on HN