いつも忘れて探す。
よく使う忘れるメモ。
$ printenv PATH
パスを表示
-----------------------------------
$ nkf [option] file > file
-e:EUCへ
-s:Shift-JISへ
-w:UTF-8へ
-Lu:改行LFへ
-Lm:改行CRへ
-g:自動判別表示
--overwrite:現ファイルを上書き
-----------------------------------
$ kill [opt] pid
-TERM:正常
-9:強制
----------------------------------
$ wc [opt] file
-c:バイト
-l:ライン
-w:単語
----------------------------------
$ find . -name "*.html" | xargs wc -l
-------------------------------------
$ rdiff-backup frompath topath
$ rdiff-backup /hoge/foo yama@hogehoge.net::/var/www/html
$ rdiff-backup yama@hogehoge.net::/var/www/html/ /hoge/foo
--------------------------------------
$ open .
--------------------------------------
$ netstat -rn
$ traceroute
---------------------------------------
$ sshfs yama@xxx.xxx.xxx.xxx:/var/www ~/htdocs/hogeProject
$ fusermount -u ~/htdocs/hogeProject
--------------------------------------
$ perl -MCPAN -e shell
cpan>m /searchkey/
cpan> install hogehoge
---------------------------------------
$ dpkg -L phppgadmin | less
--------------------------------------
$ tail -f access.log | grep homuhomu
--------------------------------------
$ nmap localhost
--------------------------------------
$ sudo crontab -e
$ sudo crontab -l
$ crontab -l -u admin
$ crontab [ -u user ] { -l | -r | -e }
分 時 日 月 曜日(0-7)
※曜日の0と7は日曜日
例:0,15,30,45 →15分おきに実行とか
例:1-5 → 1月〜5月
例:1,3,4,6-10 → 1時,3時,4時,6時,7時,8時,9時,10時
例:*/10 → 10分置きに実行
毎時0分に実行
0 * * * *
毎日3時0分に実行
0 3 * * *
毎月5日の12時30分に実行
30 12 5 * *
毎年12月25日22時30分に実行
30 22 25 12 *
毎週月曜日の朝3時00分に実行
00 3 * * 1
1分おきに実行
*/1 * * * *
logは ubuntuは/var/log/syslog。
---------------------------------------------
$ tar cvzf newfile.tar.gz --exclude .DS_Store
----------------------------------------------
(macだけかもカレントディレクトリをファインダーで開く)
$ open .
Gitコマンド
前回のコミット直後に戻る。
% git reset --hard HEAD
コメントを残す