4

the case at hand:

nvidia-settings -q all | grep 'Attribute.*GPUCoreTemp'

gives:

Attribute 'GPUCoreTemp' (system5:0.0) 58.                              
Attribute 'GPUCoreTemp' (system5:0[gpu:0]): 58. 

then I make it:

nvidia-settings -q all | grep 'Attribute.*GPUCoreTemp' |  sed -e 's/.* //'

gives me:

58.

58.

But I only want the first one... How to achieve this?

Hennes
  • 65,804
  • 7
  • 115
  • 169
Ashrael
  • 41

2 Answers2

2

Pass grep the -m 1 switch, to limit to only one matching output. See man grep.

tniles
  • 207
1

Use -t query option

$ nvidia-settings -t -q [gpu:0]/GPUCoreTemp
56
hobbyte
  • 11