可以使用
rpm -qa
如果想要查詢套件名稱含有某關鍵字的則可以使用
rpm -qa | grep kernel
或者是
rpm -qa '*kernel*'
自己習慣上都是使用
rpm -qa | grep kernel(鍵盤比較好敲)
不過
rpm -qa '*kernel*'似乎應該比較快速(就程式執行的速度來看)
於是就做了一個小實驗
$ for ((i=0;i<3;i++)); do time echo $(rpm -qa '*kernel*'); done
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m2.856s
user 0m2.640s
sys 0m0.149s
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m2.854s
user 0m2.656s
sys 0m0.138s
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m2.858s
user 0m2.631s
sys 0m0.141s
$ for ((i=0;i<3;i++)); do time echo $(rpm -qa | grep kernel); done果然經過 pipeline 的方法比較慢~ :)
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m3.246s
user 0m2.738s
sys 0m0.448s
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m3.381s
user 0m2.727s
sys 0m0.570s
kernel-devel-2.6.19-1.2895.fc6 kernel-headers-2.6.19-1.2895.fc6 kernel-2.6.19-1.2895.fc6
real 0m3.311s
user 0m2.705s
sys 0m0.546s
沒有留言:
張貼留言