Skip to the content. Bash-Oneliner I am glad that you are here! I was working on bioinformatics a few years ago and was amazed by those single-word bash commands which are much faster than my dull scripts, time saved through learning command-line shortcuts and scripting. Recent years I am working on cloud computing and I keep recording those useful commands here. Not all of them is oneliner, but i
ちょっと多めのファイルを手軽に移動させたいときに 早めに終わらせたい場合 nohup bash -c "find <src directory> -type f -mindepth 1 -maxdepth 1 | xargs -t -P8 cp -t <target directory>" & nohupで切れないように xargsに-tをつけてログを出しておく depthのoptionは間違い防止 再帰的にcpされても問題ないなら要らない xargsのPでprocess並列 cpやmvは-tでtarget directoryを先に書けるのでxargsのとき便利 時間がかかってもよい場合はrsyncを使うと進捗がわかりやすく確実 rsync -auz --info=progress2 --no-inc-recursive <src directory>/ <target directory
業務などで、パスワードなどで乱数や文字列が必要になることがあります。 その都度、生成方法を調べているので備忘として記載しておきます。 Linux の場合、ディストリビューションによっては、パスワード(ランダムな文字列)を生成するコマンドがありますが・・・ ■ bash(zsh)で乱数(ランダムな数値)を生成 ● 組み込み変数 $RANDOM を利用して乱数を生成 組み込み変数の $RANDOM を参照すると、「0 ~ 32767」の値を得られます。 $ echo $RANDOM 30317 ランダムな数値を連続で10個、生成すると異なる数値が出力されます。 $ for i in $(seq 1 10); do echo ${RANDOM}; done 277 15184 16027 14271 26543 18198 9427 6422 3932 5070 ● /dev/urandom を
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く