初学者が覚える順 linuxコマンド一覧
2020-02-10あたりからlinuxを勉強し始めました。使っている参考書はこちら。

新しいLinuxの教科書 [ 三宅英明 ]
リンク
ここでは備忘録として、初学者の手引きとして覚えるべきコマンドを参考書の順序に沿って一覧として使い方などのコメント付きでまとめていきます。
目次
はじめの一歩
dateコマンド
$ date
次の行に日付時刻が表示される。
linux内部でコマンドが実行される仕組み
- キーボードから入力された、dateという文字列を受け取る
- dateという名前のコマンドを探す
- 見つかったコマンドを実行する
- 実行した結果として得られた日時の文字列を画面に表示する
echoコマンド
$ echo Hello
Hello と表示されます。
ファイル、ディレクトリの操作
ファイルをコピーしたり、他のディレクトリに移動させたり、削除したり、ファイルを使ったやりとりのコマンド。
$ lsコマンド
カレントディレクトリのファイルやディレクトリを一覧表示する。
$ cd first_test
$ ls
README.md hello.php hello.txt hello2.php index.html
引数にディレクトリを指定する。
$ ls ./first_test
README.md hello.php hello.txt hello2.php index.html
パス名展開:ファイル名の一部をパターンにより検索して複数ファイルを一覧表示する。
記号 | 意味 | 使い方 |
* | 任意の文字列 | *.php(すべての「.php」ファイル) |
? | 任意の1文字 | hello.???(拡張子が3文字のファイル) |
-lオプション
詳細表示
$ ls -l
total 40
-rw-r--r-- 1 user staff 61 4 1 22:33 README.md
-rw-r--r-- 1 user staff 32 4 1 22:36 hello.php
-rw-r--r-- 1 user staff 32 4 2 16:43 hello.txt
-rw-r--r-- 1 user staff 51 4 2 16:26 hello2.php
-rw-r--r-- 1 user staff 205 4 1 23:06 index.html
-aオプション
隠しファイルも合わせて表示
$ ls -a
. .git hello.php hello2.php
.. README.md hello.txt index.html
-Fオプション
ファイル種別も表示(ディレクトリの場合後ろに/)
$ mkdir test_dir1
$ ls -F
README.md hello.txt index.html
hello.php hello2.php test_dir1/
種類 | 記号 |
通常ファイル | なし |
ディレクトリ | / |
実行可能ファイル | * |
シンボリックリンク | @ |
$ mkdir コマンド
カレントディレクトリに新規にディレクトリを作成する。
$ ls
README.md hello.txt index.html
hello.php hello2.php test_dir1
$ mkdir test_dir2
$ ls
README.md hello.txt index.html test_dir2
hello.php hello2.php test_dir1
ディスカッション
コメント一覧
まだ、コメントがありません