memo

memo dayo.

2016-08-01から1ヶ月間の記事一覧

みてるアニメ(2016-08)

・DAYS ・Re:ゼロから始める異世界生活 ・アルスラーン戦記(2) ・ガンダムUC(TV) ・クロムクロ ・テイルズ オブ ゼスティリア(2) ・ベルセルク(2016) ・天鏡のアルデラミン ・甘々と稲妻

grepで空行を省く

sh sh

cat 1.txt | grep -v '^\s*$' > 2.txt

ロックを解除する

show processlist; kill id;

mysqldumpで-pオプションをつけない

◆旧 /usr/bin/mysqldump -hdb_host -udb_user -pdb_pass db_name table_name > /tmp/table_name.stdout.sql 2> /tmp/table_name.stderr.txt → エラーが出力される場合もある Warning: Using a password on the command line interface can be insecure. ◆新 …

DBの論理使用量を調べる

SELECT ROUND(SUM(data_length)/1024/1024) AS mb FROM information_schema.tables WHERE table_schema = 'aaa' ;

変数に代入したコマンド文字列を実行する

sh sh

cmd="" cmd=$cmd"cat 1.txt | " cmd=$cmd"sort | " cmd=$cmd"uniq > 2.txt" eval $cmd

ファイルを一行ずつ読み込む

sh sh

cat aaa.txt | while read line do echo $line done

先頭から数文字を取得

sh sh

echo 12345 | cut -c-3

ディレクトリとファイルの一覧を取得

sh sh

file_s="./*" for file_1 in $file_s; do echo $file_1 done

文字列置換

sh sh

echo "aaa.txt" | sed -e "s/\.txt//g"

echoで改行しない

sh sh

echo -n 999