Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst]cat und sed
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Mon Mar 12, 2012 6:17 pm    Post subject: [gelöst]cat und sed Reply with quote

Hallo,
ich benutze yasp http://kde-look.org/content/show.php/?content=109367 . Ich möchte mir die Taktfrequenz der Kerne anzeigen lassen. Hat jemand eine Idee?
Code:
sensor name="Core0MHZ" type="program" cmd="/usr/bin/cat /proc/cpuinfo | grep MHz | sed 's/[A-z:]*\s//g'"
sensor name="Core1MHZ" type="program" cmd="/usr/bin/cat /proc/cpuinfo | grep MHz | sed 's/[A-z:]*\s//g'
funktioniert nicht, vermutlich weil die Ausgabe aus 2 Zeilen besteht.
Code:
2000.000
2000.000
Das müsste man wahrscheinlich so modifizieren, das die obere Zahl im ersten Kommando und die untere im zweiten Kommando ausgegeben wird.
So in der art
Code:
olaf@flammenflitzer ~ $ cat /proc/cpuinfo | grep MHz | sed 's/[A-z:]*\s//g' | tail -1
2000.000


Last edited by flammenflitzer on Thu Mar 22, 2012 12:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2146
Location: Europe

PostPosted: Mon Mar 12, 2012 7:17 pm    Post subject: Reply with quote

Du kannst
Code:
cat /proc/cpuinfo  | grep MHz | cut -d: -f2 | head -n 1

und
Code:
cat /proc/cpuinfo  | grep MHz | cut -d: -f2 | tail -n 1
nutzen.
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4509
Location: Germany

PostPosted: Mon Mar 12, 2012 8:17 pm    Post subject: Reply with quote

Hm, ich denke das cat könnte man doch auch ganz weglassen, denn grep kann doch auch selber lesen ;)
Also dann zb
Code:
grep MHz /proc/cpuinfo | cut -d: -f2 | head -n 1


Eventuell ist es aber auch einfacher die Informationen direkt aus
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
für die jeweiligen CPU-Kerne (cpu0 cpu1 usw) auszulesen.
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Mon Mar 12, 2012 9:29 pm    Post subject: Reply with quote

Danke
(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq kann ich nur als root)
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Wed Mar 21, 2012 6:45 pm    Post subject: Reply with quote

Code:
cpufreq-info -f
vielleicht noch mit "-m"
Back to top
View user's profile Send private message
flammenflitzer
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 3463
Location: Berlin

PostPosted: Thu Mar 22, 2012 12:21 pm    Post subject: Reply with quote

Danke
CPU 1
Code:
cpufreq-info -c 1 -f -m

CPU 2
Code:
cpufreq-info -c 0 -f -m
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum