Web lists-archives.com

Re: Editing a piped in stream?




On 2018-07-08 04:35, David Christensen wrote:
On 07/07/18 01:51, John Crawley wrote:
On 2018-07-07 11:02, David Christensen wrote:
On 07/06/18 09:17, Richard Owlett wrote:
While working on a problem {solved by a different approach} I had:
    ls -l /dev/disk/by-label/ | cut -f 10,12 -d ' ' data.txt
I would then manually edit data.txt by replacing the space character between the two fields with a tab.
I suspect I should be able to do:
    ls -l /dev/disk/by-label/ | cut -f 10,12 -d ' ' | *something* > prettydata.txt

Ideal would be a more focussed way of reading out the disk info, perhaps something with blkid or lsblk?

I don't follow.  blkid(8) and lsblk(8) would be ideal for what purpose? Using what metric?

I meant that there might be a utility that would output the disk info directly, avoiding the need to do any post-processing with cut, sed, awk and friends, and suggested blkid and lsblk as possible candidates.

Just a suggestion I threw out for those with the time and motivation to plough though the man pages.

--
John