0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linux学習ログまとめ 〜コマンドと用語を整理して理解する〜

Posted at

最近の学習ログを整理しながら、Linuxの基本コマンドと用語をまとめました。
自分自身の振り返り用としてですが、同じように学習している方の参考にもなると思います。


コマンド一覧

Linuxの学習でよく使ったコマンドを「結果イメージ」と「ユースケース」付きで整理しました。

コマンド 説明 出力例(結果イメージ) ユースケース
💲grep "rabbit" example/alice.md ファイル内から文字列を検索 ... rabbit hole ... 特定の単語がファイル内にあるか確認
💲grep -rl "hello" example/ ディレクトリ内のファイルから文字列を検索(再帰) example/hello.txt 大量のファイルから一括検索
💲grep -n "rabbit" example/alice.md 検索結果に行番号を表示 36:rabbit hole どの行にあるか確認したいとき
💲cat < example/hello.txt ファイルの内容を表示 hello world ファイル中身を確認
💲echo "hello world" > hello.txt ファイルを作成 or 上書き hello.txthello world 新規ファイル作成
💲echo "hello linux" >> hello.txt ファイルに追記 hello world の下に hello linux ログや履歴を残したいとき
💲ls -1 example | grep -n "txt" ファイル一覧を検索 3:hello.txt 拡張子で探すとき
💲dpkg -l | grep -n "python" | less パッケージ一覧から検索 25: ii python3 ... インストール済み確認
💲ps 実行中のプロセスを一覧表示 1234 pts/0 bash 実行中のプロセス確認
💲ps aux | grep "apache" apache関連のプロセス検索 www-data 2345 ... apache2 サーバー動作確認
💲alias エイリアス一覧表示 ll='ls -alF' よく使うショートカット確認
💲alias hello='echo "hello world"' 新しいエイリアス定義 hellohello world 自分専用のコマンド作成
💲echo $PS1 プロンプトの設定確認 \u@\h:\w\$ ターミナル表示を調整
💲cat .bashrc | less -N .bashrc を行番号付きで表示 設定ファイル内容 シェルの設定確認

用語理解

Linuxの学習を進める上で理解した用語を整理しました。

用語 説明
正規表現 文字列パターンを表すルール。メタ文字を利用して柔軟に検索可能
メタ文字 正規表現で特別な意味を持つ記号(例: ^, $, *, [] など)
標準入力 プログラムに渡す入力データの入口
標準出力 プログラムの通常の出力先
標準エラー出力 エラー情報の出力先
パイプ | 前のコマンドの出力を次のコマンドの入力に渡す仕組み
プロセス 実行中のプログラムのこと
PID プロセスを識別する番号
シェル OSのカーネルとユーザーの仲立ちをするプログラム
コマンドシェル 入力されたコマンドを解釈して実行、結果をテキスト出力するシェル
エイリアス コマンドの別名を登録してショートカットとして利用できる仕組み
プロンプト (PS1) ターミナルに表示されるコマンド入力待ちの文字列
設定ファイル .bashrc, .bash_profile, /etc/profile など。シェルの動作を制御

まとめ

Linuxの学習を振り返ると、

  • コマンドは「シンプルに一つのことを行う」
  • 組み合わせ(パイプやリダイレクト)で強力になる
  • 正規表現やワイルドカードで柔軟に操作できる

という思想が一貫していると感じました。
今後も「辞書化」しながら学習を積み重ねていきたいと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?