タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

tipsとLinuxとterminalに関するHeavyFeatherのブックマーク (2)

  • All commands

    netstat -ntu | tail -n +3 | awk '{print $5}' | sed 's/:[0-9]*$//' | sort | uniq -c | sort -rn Do not use this in production! This is a true hardware random number generator using your system as the entropy source. It models flipping a coin by pitting a fast clock (the CPU) against a slow clock (the RTC). The CPU models the coin flipping head over tails during flight and the RTC models the duration

  • コマンドが失敗したらプロンプトを赤くする - blog.8-p.info

    しばらく前から、コマンドの終了ステータスをプロンプトの色に反映させるようにしている。 終了ステータスとは C言語なら int main(int argc, char* argv[]) { ... return 0; } この return している 0 が終了ステータス。この整数値の下位 8bit がプロセスの終了時に親 (そのプロセスを起動したプロセス) にわたる。 終了ステータスの指定方法はいろいろある。C言語の場合 main 関数の戻り値以外にも exit 関数の引数でも指定できる。Ruby, Perl の場合、そもそも main 関数は無くて exit 関数に引数を与える方法だけがつかえる。 この値はシェル上で $? で参照できる。 % perl -e 'exit(0xdead)'; echo $? 173 % 慣例として、正常終了のときは 0 を返すことになっている。 % ls

  • 1