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.
私はLinux初心者です。Linux で使用する最大のポートを取得するにはどうすればよいですか? 特にCentOSに興味があります。
私のスクリプトは次のとおりです。
ネット統計 | グレップ tcp | tr -s ' ' | カット -d ' ' -f 4 | tr -d [:アルファ:] | tr 。' ' | tr -d [:スペース:] | tr : \n | 並べ替え -n | テール --lines=1
しかし遅すぎる!
なぜこれが必要なのかよくわかりませんが、次のコマンドを使用できます。
netstat -tn | cut -f2 -d: | cut -f1 -d' ' | sort -rn | head -1