Ugly UUOC (Useless Use Of Cat). Damn peoples, please i appreciate your will to share, but share good contents and stop spreading bad shell patterns....
An introduction to data processing on the Linux command line
31–40 of 73 posts
Re: An introduction to data processing on the Linux command line
#32Ugly UUOC (Useless Use Of Cat). Damn peoples, please i appreciate your will to share, but share good contents and stop spreading bad shell patterns....
Yes, it made the whole article useless.
Re: An introduction to data processing on the Linux command line
#33 cat data.csv | sed 's/"//g'
can be simplified by doing this instead: cat data.csv | tr d '"'
This awk command: cat sales.csv | awk -F',' '{print $1}' | sort | uniq
Can be replaced with a simpler (IMO) cut instead: cat sales.csv | cut -d , -f 1 | sort | uniq
When using head or tail like this: head -n 3
You don't need the -n: head -3
Also shout out to jq, xsv, and zsh (extended glob), all nice complements to the typical command line utils.Re: An introduction to data processing on the Linux command line
#34Can somebody explain the advantage of doing it on the command line vs in Python or R? What would a practical use case look like?
The most significant use case for all things command-line IMHO is automation . Also, I would change that from "command line vs in Python or R" to "command line and Python or R". Build a pipeline like I've discussed in the article, then pipe it into Python or R.
Why not just do it all in Python or R? That way you also get something that will probably work on non-unix platforms.
Re: An introduction to data processing on the Linux command line
#35Can somebody explain the advantage of doing it on the command line vs in Python or R? What would a practical use case look like?
I like to use command line tools for for one-off tasks that I'm unlikely to repeat. If there's a task I know I'll need to repeat or is too cumbersome to do in a couple of lines, I'll reach for Python.
Re: An introduction to data processing on the Linux command line
#36Why people use Linux in place of *nix ? Even worst, most of the tools (cat, grep, awk) are Unix commands, redeveloped by the GNU project in most of the GNULinux distros.
Re: An introduction to data processing on the Linux command line
#37Why people use Linux in place of *nix ? Even worst, most of the tools (cat, grep, awk) are Unix commands, redeveloped by the GNU project in most of the GNULinux distros.
I find it more irritating when people try to score greybeard points by saying *nix (or Unix) when it's obvious that they're talking about a Linux-only mechanism and quite possibly haven't ever used Unix (or a direct derivative).
Re: An introduction to data processing on the Linux command line
#38Earlier quoted context omitted.
The most significant use case for all things command-line IMHO is automation . Also, I would change that from "command line vs in Python or R" to "command line and Python or R". Build a pipeline like I've discussed in the article, then pipe it into Python or R.
> Build a pipeline like I've discussed in the article, then pipe it into Python or R. Why not just do it all in Python or R? That way you also get something that will probably work on non-unix platforms.
Re: An introduction to data processing on the Linux command line
#39- The original award started in 1995. Even though pentium was already out, I think it is safe to say that was the era of 486 PCs. In 2019, for day-to-day shell work (meaning no GBs of file-processing or anything like that), isn't invoking UUOC and pointing out inefficiencies an example of premature optimization [1]?
- Isn't readability a matter of subjectivity, and that for some folks 'cat file' is more readable than '[1] http://wiki.c2.com/?PrematureOptimization
[2] https://chat.stackoverflow.com/rooms/182573/discussion-on-an...
Re: An introduction to data processing on the Linux command line
#40To visualize data coming in from a pipe, can pipe it to
https://github.com/dkogan/feedgnuplot
Very useful in conjunction with other tools to provide filtering and manipulation. For instance (the first one is mine):
https://github.com/dkogan/vnlog
https://www.gnu.org/software/datamash/
https://csvkit.readthedocs.io/
https://github.com/johnkerl/miller
https://github.com/eBay/tsv-utils-dlang
https://github.com/BatchLabs/charlatan
https://github.com/dinedal/textql
https://github.com/BurntSushi/xsv
https://github.com/dbohdan/sqawk