3

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
  • 64,768
  • 7
  • 111
  • 168
Ashrael
  • 31
  • 2

2 Answers2

2

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

tniles
  • 209
  • 1
  • 5
1

Use -t query option

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