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.
次のように CUT(!) を使用して ifconfig から wlan0 の MAC のみを抽出する方法: grep HWaddr | cut -d ' ' -f 11 なぜ ifconfig wlan0 | grep HWaddr | cut -d ' ' -f 11 は同じように機能しませんか? ありがとう。
ifconfig wlan0 | grep -E -o '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'
編集 (cut コマンドを含むように更新):
ifconfig wlan0 | grep -E -o '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | cut -f 1