cmd
centos $ ifconfig eth0 | grep -v inet6 | grep inet | awk '{print $2;}' | cut -f2 -d ':'osx % ifconfig en0 | grep -v inet6 | grep inet | awk '{print $2;}'
lf % find . -type f | xargs nkf --overwrite -Lu crlf % find . -type f | xargs nkf --overwrite -Lw
% man dsclaユーザ一覧 % dscl . -list /Users UniqueID | sort -n -k 2グループ一覧 % dscl . -list /Groups PrimaryGroupID | sort -n -k 2使用できるGIDを取得 % NEWGID=$(expr $(dscacheutil -q group | awk '{print $2}' | sort -ug | tail -1) + 1) $ …
% cp filename{,.bak}
-N 行番号表示 -n 行番号非表示 -m 行のパーセンテージ表示 -M 行のパーセンテージと行番号表示
% du -s target-dir
% find . -type d -name "*svn*"|xargs rm -rf
shift_jis な sjis.csv の1番目と10番目のフィールドを切り出して hoge に書き出す。 % env LC_ALL=ja_JP.SJIS cut -d',' -f1,10 < sjis.csv > hoge
% netstat -na | grep LISTEN
port install pandoc はエラー build.target build-all make build-all するとエラー ―for Haskell programmers onlyですか。Variantsはだめですか。 なんで、Google Code Archive - Long-term storage for Google Code Project Hosting. % make % make test…
オプション % csstidy - --silent=true --preserve_css=true --template=default --compress_font-weight=false --lowercase_s=true --case_properties=1 --compress_colors=false
#!/bin/sh USER=$1 PASS=$2 USERADD=`which useradd` PERL=`which perl` if [ $# -lt 2 ]; then cat <
% echo -n a |hexdump -C
$ echo -n 'pass' | md5
smtp $ telnet hoge.example.com 25 Trying 210.154.87.18 ... Connected to hoge.example.com Escape character is '^]'. 220 hoge.example.com ESMTP ... HELO hoge.example.com 250 hoge.example.com Hello pc20.lo.ash.jp [10.0.1.20], pleased to meet …
やっつけ $ find . -type f -name ?*.html |perl -nle '`iconv -f SHIFT_JIS -t UTF-8 $_>$_.buf`;' $ perl -p -i.html -e 's/(x-sjis|Shift_JIS)/utf-8/g;' *.buf $ find . -type f -name ?*.html | xargs rm $ find . -type f -name ?*.buf |perl -nle '$f…
chmod -R u+rwX * chmod -R go+X * 404 Blog Not Found:unix - permissionあれこれ
@IT:DNS Tips:digコマンドとnslookupコマンドの違いとは @IT:DNS Tips:digコマンドとは ネームサーバ $ dig example.com ns $ nslookup -type=NS example.com 正引き $ dig example.com a $ nslookup www.example.com 逆引き $ nslookup 192.0.34.166 …
$ sudo postsuper -d ALL
$ sudo tcpdump -i en1 -s 65535 -w oreore.cap tcp port 80
.tar.gz 解凍 $ tar zxvf filename [-C dest_dir]圧縮 $ tar zcvf backup.tar.gz file1 file2中身の確認 $ tar tzvf file.tar.gz .zip 解凍 $ unzip hoge.zip $ unzip -d dest_dir hoge.zip圧縮 $ zip backup.zip file1 file2 $ zip -r backup.zip target_di…
$ date '+%Y/%m/%d %H:%M:%S' $ echo `date '+%Y/%m/%d %H:%M:%S'` > hoge
$ /bin/sh -n file