Live data from Hacker News

Linux Commands for Developers

blog.jayfields.com

11–20 of 67 posts

Re: Linux Commands for Developers

#11
post #7

tail -f filename should definitely make the list, essential for watching what's appended to log files in real time.

I prefer:- tail -F filename as most of the logfiles I need to watch tend to wrap at some point and 'tail -f' doesn't check for inode changes. (-F is a non-standard option, it's there on GNU's [EDIT] tail binary and OS-X but not Solaris for example).

Thanks, very useful - didn't know that!

Re: Linux Commands for Developers

#12
post #9
post #6

I was expecting to see the first comment in here complaining about his use of 'cat', as in all of the examples his second argument could've easily taken a filename argument.. sort order.* is surely more elegant than cat order.* | sort which is fair enough, however, as it happens, i generally do end up using 'cat' in the way he's used it.. for such small jobs nobody can be genuinely worried about the overhead, and it…

[ EDIT - Two replies as original post had been edited by the time I posted the first. ] > and as a sidenote, something i only found recently, but which is quite useful, a logical AND with egrep looks like > > egrep 'Hardcover. Kindle' That's not a true logical AND since it won't pick up an entry with the text "Kindle Hardcover". Only entries with the word "Hardcover" eventually followed by "Kindle". To cover both cas…

How about:

    grep Hardcover | grep Kindle

Re: Linux Commands for Developers

#14
post #10

I thought to learn something useful for programing (debugging, program runtime analysis, etc.). But instead the article is just about the generic commands cat, sort, grep, cut, sed, uniq, find and less. It is not really development related.

Totally agree! Wasted time. Everybody know these commands.

Re: Linux Commands for Developers

#15
post #10

I thought to learn something useful for programing (debugging, program runtime analysis, etc.). But instead the article is just about the generic commands cat, sort, grep, cut, sed, uniq, find and less. It is not really development related.

I disagree. They may not be obviously related to coding, though they'll probably end up being useful at some point anyway... But they're definitely useful for working with logs, working with datasets, working with config files, and a host of other development-related tasks. Just yesterday I was on a Windows machine and dearly felt the loss of sed and uniq. I have a task lined up for today to either find Windows alternatives or install msys.

Re: Linux Commands for Developers

#16
I came across something in fortune some time ago which you can find at:

http://motd.ambians.com/quotes.php/name/linux_songs_poems/to...

I have found it to be surprisingly useful. Nobody uses all the commands but remembering that something like zcat exists can be extremely useful. Also remembering to pipe through sort before sending through uniq is helpful as well.

Re: Linux Commands for Developers

#17
One guideline to keep in mind:

  > If the original title begins with a number or number + gratuitous
  > adjective, we'd appreciate it if you'd crop it. E.g. translate
  > "10 Ways To Do X" to "How To Do X," and "14 Amazing Ys" to "Ys."
  > Exception: when the number is meaningful, e.g. "The 5 Platonic Solids."

Re: Linux Commands for Developers

#20
post #18

how do I execute the out put of something like this: grep -i 'pattern' file | awk '{print $5}' | sed 's/^/cmd/g' I end up sending to a file, chmod, then run it at the shell.

Wrap it in $() to execute. And even if you pipe it into a file, no chmod is required. "sh file" works as it should
Post reply on HN