LoginSignup
0
0

More than 3 years have passed since last update.

基本的なコマンド

Posted at
  • 移動
mv /tmp/exp1/aaa /tmp/exp2/
  • ファイル作成
mkdir xxx
  • 差分比較
diff -r aaa bbb
  • ファイル削除
rm -r [ディレクトリ]
rm -r [ファイル]

# 強制的にディレクトリ削除
rm -rf [ディレクトリ] 
  • tail

リアルタイムでファイルの中身を表示できる。ログ監視とかで役に立つ

tail -f /var/log/httpd/xxxx/error_log

access.logで時間帯・ipアドレスごとにしぼる(top5)

grep '01/Feb/2017' access_log | cut -d " " -f 1 | sort -r | uniq -c | sort -n -r | head -5 
  • 検索
# 最終更新が2017/4 で、「abc」があるアクセスログ
zgrep "abc" access_log.* | grep Apr | grep 2017
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0