Quantcast
Channel: Prevent sort from sorting filenames instead of greped content - Ask Ubuntu
Browsing all 2 articles
Browse latest View live

Answer by Henning Kockerbeck for Prevent sort from sorting filenames instead...

You need to tell sort which part of its input you want to sort after. That's what the switch -k (for "key") is for. Let's say you have a list like/file3 111/file2 666/file1 333You want to sort after...

View Article


Prevent sort from sorting filenames instead of greped content

In a script, I want to get a variable from find grep and sort to display it with echo on screen. The variable looks like:OUTPUT="$(find . -maxdepth 2 -type f -name 'filename' | xargs grep -o -m 1...

View Article
Browsing all 2 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>