Page 8 of 8

Re: Yet another pointless discussion thread...

PostPosted: November 15th, 2018, 9:48 am
by cynwulf
Head_on_a_Stick wrote:Well, both commands produce similar output, so yes, I suppose so.

I think I prefer your version, the list is alphabetised by the shell(?), which is nice.

Well, your version was actually something like:
Code: Select all
empty@buster:~ $ cd /sys/devices/system/cpu/vulnerabilities
empty@buster:/sys/devices/system/cpu/vulnerabilities $ grep -R .

My version is the simple, one-liner method of doing the same thing you were attempting to do (hence it "cuts out the crap").

As to whether it's the "best way", that remains to be seen (personally I would generally agree with nadir and would use head(1) or tail(1) for that).

Re: Yet another pointless discussion thread...

PostPosted: November 15th, 2018, 10:54 am
by Head_on_a_Stick
cynwulf wrote:Well, your version was actually something like:
Code: Select all
empty@buster:~ $ cd /sys/devices/system/cpu/vulnerabilities
empty@buster:/sys/devices/system/cpu/vulnerabilities $ grep -R .

My version is the simple, one-liner method of doing the same thing you were attempting to do (hence it "cuts out the crap").

Ah, now I understand.

I chose to `cd` first so that the full path would be omitted from the output so yes, good tip there, thanks.

@loqs' original version was:
Code: Select all
grep -R . /sys/devices/system/cpu/vulnerabilities

(IIRC)