[[PageOutline]] * [http://diary.sshida.com/20061120-3-diary.html bwm-ng, dstat といモニタソフトがあった] * dstat は CPU 利用量やスワップ量など、vmstat, iostat, ifstat で表示できる項目のうち、好きな項目をいっしょに表示できる。しかも xterm 上でカラー表示されるのでわかりやすい。 vnstat は /proc からインターフェースの転送量をとりだして、日ごとなどの集計をする。saidar は System raidar の略か、システムの稼働情報を CURSES で文字端末に一括表示する。 statgrab は /proc 以下のネットワークの稼働情報を snmpwalk のように一覧表示する。sysctl ライクな表示、と man にはかかれている。bwm-ngは I/F ごとの入出力量を CURSES テキストで 0.5秒ごとに表示する。間隔を0.1秒単位で指定できる。 * [http://www.kawaz.jp/pukiwiki/?vim ずんWiki - vim] * [http://string-cat.blogspot.com/2009/05/vim400.html String cat: vimに400字で詰めさせる] * via twitter:m_bird/status/43167478343401472 * [http://goungoun.dip.jp/app/fswiki/wiki.cgi/devnotebook?page=Linux%A5%B3%A5%DE%A5%F3%A5%C9%A5%E1%A5%E2 Linuxコマンドメモ - goungoun技術系雑記帳] > * img と img-backup 下のフォルダ構成をdiff > {{{ > diff <(find img -type d -print) <(cd img-backup; find img -type d -print) > }}} > * via [http://www.connect-i.co.jp/tipsblog/?cat=5 TIPS » linux] > * bash:パスとコマンド名を取得 > {{{ > #!/bin/bash > > HOGE="/aaa/bbb/ccc.c" > > echo ${HOGE} > echo ${HOGE%/*} > echo ${HOGE##*/} > }}} > {{{ > /aaa/bbb/ccc.c > /aaa/bbb > ccc.c > }}} > * sudo sh -c "hogehoge" > {{{ > $ sudo sh -c "cat > hoge" > }}} * [http://d.hatena.ne.jp/syohex/20110213/1297597959 Emacsの終了を面倒臭くする - Life is very short] > {{{ > (defalias 'exit 'save-buffers-kill-emacs) > }}} * cp -av /path/to/src /path/to/dst 2> err.log | tee cp.log * cp.log -> コピーされたファイルリスト * err.log -> エラーログ * wikipedia:fdupes > fdupes is a program written by Adrian Lopez to scan directories for duplicate files, with options to list and delete them. It first compares file sizes and MD5 signatures, and then performs a byte-by-byte check for verification. = adduser / useradd = * adduser -> 対話式 * /home/USERNAME が作られる * useradd -> 引数でオプションを与える * (デフォルトでは) /home/USERNAME が作られない * see also * [http://d.hatena.ne.jp/ky2009/20071115/1193332309 adduserとuseraddの違い - DUNNO-CLEARブログ2.0] = find コマンド = * [http://doruby.kbmj.com/SK/20090731/find_mtime_ findコマンドのmtimeオプションについて] * 図が分かりやすい = . (ドット) コマンド = * [http://lagendra.s.kanazawa-u.ac.jp/ogurisu/manuals/sh-text/sh/node21.html シェルスクリプトと実行方法] * 現在の環境変数を再設定するにはスクリプトをカレントシェルで実行しなければなりません。このためシェルにはドットコマンドと呼ばれるものが用意されおり、コマンドラインでドット .の後にスペースを置いて実行したいスクリプト名を書きます。 {{{ $ . script }}} * ドット .を先頭に置くことによりカレントシェルはscriptを自分自身で実行しますので、現在の環境変数を再設定することができます。なお、ドット .に続くscriptには実行権の必要はありません。 = mailx = {{{ -E Do not send messages with an empty body. This is useful for pip- ing errors from cron(8) scripts. -s subject Specify subject on command line. (Only the first argument after the -s flag is used as a subject; be careful to quote subjects containing spaces.) }}} = nologin / false = * on Ubuntu lucid * /usr/sbin/nologin {{{ This account is currently not available. }}} * /bin/false * nothing output = ~/.nofinger = * [http://x68000.q-e-d.net/~68user/unix/pickup?~%2F.nofinger UNIXの部屋 コマンド検索:~/.nofinger (*BSD/Linux)] * s0711489$ finger $USER {{{ Login: s0711489 Name: Keniti MITO Directory: /XXXXXXXXXXXXX/s0711489 Shell: /bin/bash On since Thu Nov 18 13:39 (JST) on ttys004 from 130.158.ABC.XYZ On since Thu Nov 18 13:39 (JST) on ttys005 No Mail. No Plan. }}} * s0711489$ touch .nofinger * s0711489$ finger $USER {{{ finger: s0711489: no such user }}} = dd = * [http://tanaka.sakura.ad.jp/archives/001069.html ddコマンド実行途中に、何バイトコピーできたかを見る方法 (さくらインターネット創業日記)] * 意外と知られていないのですが、USR1シグナルを送ることで途中経過を表示させることが可能です。 * Pipe Viewer (http://www.ivarch.com/programs/pv.shtml) とこんな感じに組み合わせることもできそうです {{{ > dd if=/dev/zero count=1024 bs=1M | pv -s 1g > x 463MB 0:00:15 [23.2MB/s] [=======================================> ] 45% ETA 0:00:18 }}} * [http://www.ivarch.com/programs/pv.shtml ivarch.com: Pipe Viewer] = MySQL = * [http://mysql-casual.org/2010/12/mysql-casual-advent-calendar-2010-12-06.html コマンドプロンプト表示をカスタマイズ - MySQL Casual Advent Calendar 2010 - MySQL Casual] * https://twitter.com/__gfx__/status/12874058081239040 = wget = * [http://webos-goodies.jp/archives/51277893.html wget で認証付きサイトをダウンロードする - WebOS Goodies] {{{ wget --header 'Cookie: foo=bar' http://webos-goodies.jp/index.html }}} * [http://www.mail-archive.com/wget@sunsite.dk/msg06802.html |PATCH| support for Content-Encoding in wget] > The attached patch adds the option --accept-encoding-gzip to wget. If you > enable this option the line: `Accent-Encoding: gzip' is added to the Header > wget sends to the server. If the server responds with `Content-Encoding: gzip' > the received data will be decompressed with gzip -d -c -. * mitty@ubuntu:~$ wget http://ftp.gnu.org/gnu/wget/wget-1.9.1.tar.gz * mitty@ubuntu:~$ wget http://www.mail-archive.com/wget@sunsite.dk/msg06802/wget-1.9.1---1.9.1-gzip.patch.gz * mitty@ubuntu:~$ tar xzf wget-1.9.1.tar.gz * mitty@ubuntu:~$ zcat wget-1.9.1---1.9.1-gzip.patch.gz | patch -p0 {{{ patching file wget-1.9.1/src/http.c patching file wget-1.9.1/src/init.c patching file wget-1.9.1/src/main.c patching file wget-1.9.1/src/options.h }}} * mitty@ubuntu:~/wget-1.9.1$ ./configure --prefix=$HOME/.wget * mitty@ubuntu:~/wget-1.9.1$ make * mitty@ubuntu:~/wget-1.9.1$ make install * mitty@ubuntu:~/.bin$ ln -s ../.wget/bin/wget wgetz