Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現時点で私が得た:
tasklist | grep java
次の行を配信します。
java.exe 1234 Console 1 100.0k
ここで必要なのは 2 番目のパラメーター (この場合は 1234) だけです。
tasklist | grep java | ???
tasklist | awk '/java/{ print $2 }'
awkgrep パターンに一致する行の 2 番目の単語を出力するために使用します
awk
tasklist | grep java | awk '{print $2}'