1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

TeraTermで使用するLinuxコマンドの使い方

Last updated at Posted at 2021-05-27

#よく使うコマンド

##①cd ディレクトリ
ディレクトリを移動する。

cd /etc/app/logs

下記から始めた場合ルートディレクトリへ移動。

cd /

##②pwd
自分がどこのディレクトリに居るかを確認する。

pwd

##③ls
ファイルの一覧を見る。

ls

##④ls -altr
上記③のオプション付きバージョン。
更新時間順にファイルを並べ替えて一覧表示。

ls -altr

##⑤find
特定のファイルを探す。

find tracelog

##⑥less
ファイルを開く。

less tracelog

##⑦tail ファイル名
ログが長過ぎるときファイルの後方を表示。

tail server.log

##⑧tail -F ファイル名
上記⑦のオプション付きバージョン。
ログを監視するときに使用。
追記された分を表示してくれる。

tail -F server.log

##⑨tail -F ファイル名 | grep 検索するもの
上記に更にオプションを付けたもので、
grepの後に検索したい内容を記載すれば
その内容で絞って表示をしてくれる。

tail -F server.log | grep osakana

#おまけ

##cal
カレンダーを見る。

cal

##Enter連打
ログがどんどん流れていってしまう時は、
Enterを押してスペースをたくさん空けておき、
そこを目印にしたりする。

##[Alt]+[C]
コピーする。

##[Ctrl]+[C]
終了。

このほかにも沢山コマンドはありますが、
主に使用したコマンドをまとめてみました!
誰かのお役に立てると嬉しいです。。

1
3
2

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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?