LoginSignup
3
5

More than 5 years have passed since last update.

よく使うターミナルコマンド

Posted at

普段よく使うものは覚えてきても、たまにしか使わないものは忘れることがあるので、メモ!
当たり前かもしれないけど、キーボードだけで作業ができるようになりたい。

ls

カレントディレクトリにあるファイルを表示

cd

指定したパスに移動する

example
cd <パスを指定> 

指定しない場合はホームディレクトリに移動

example
cd ~/

.. で一つ上の階層に移動する

example
cd ..

pwd

カレントディレクトリのパスを表示する

touch

中身が空のファイルを作成する

example
touch <ファイル名>

mkdir

example
mkdir <ファイル名>

mv

ファイルやディレクトリの移動、名前の変更

example
mv <移動元> <移動先>
example
mv <元の名前> <変更後の名前>

cp

ファイルやディレクトリのコピー

example
cp <コピー元ファイル> <コピー先ファイル>
example
cp-r <コピー元ディレクトリ> <コピー先ディレクトリ>

rm

ファイルやディレクトリを削除

example
rm <ファイル名>
example
rm-r <ディレクトリ名>

open

Finderでファイルを開く

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