Linux Commands for Developers
blog.jayfields.com
Linux Commands for Developers
1–10 of 67 posts
Re: Linux Commands for Developers
#2They are all generic unix commands.
Re: Linux Commands for Developers
#3Re: Linux Commands for Developers
#4Re: Linux Commands for Developers
#58 Linux Commands Every Developer Should Know [for log analysis]
Re: Linux Commands for Developers
#6 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 comes down to a matter of taste..personally, i find that using 'cat output | $command' helps to separate out the 'logic' of what i'm doing, if that makes sense..
also, again, purely as a matter of taste
i'd prefer
egrep 'Hardcover|Kindle'
over grep "\(Kindle\|Hardcover\)"
EDIT: (as alexfoo has pointed out, this isn't a proper AND as it worries about the order.. my bad, still useful though :D )and as a sidenote, something i only found recently, but which is quite useful, a logical AND with egrep looks like
egrep 'Hardcover.*Kindle'Re: Linux Commands for Developers
#7tail -f filename should definitely make the list, essential for watching what's appended to log files in real time.
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).
Re: Linux Commands for Developers
#8I 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…
However, things change if you start adding certain options to sort:-
sort -m order.*
and cat order.* | sort -m
are definitely not the same thing (for most input files at least).Re: Linux Commands for Developers
#9I 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…
> 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 cases you'd need:-
egrep 'Hardcover.*Kindle|Kindle.*Hardcover'
(Of course, someone will now show how this can be done in even fewer characters).