LoginSignup
0
0

More than 3 years have passed since last update.

【自分用学習メモ・備忘録】Command Line(Unixコマンド)

Last updated at Posted at 2020-05-26

基本的なコマンド

(※〇〇 = ファイル名、dir = ディレクトリ)

  • touch 〇〇 /空のファイル作成
  • cat 〇〇 /ファイルの中身を表示
  • mkdir dir名 /make directory ディレクトリ作成
  • pwd /print working directory 現在作業中のディレクトリ確認(階層が全て表示される)
  • ls /dirの中身を見る(基本的に1つ子の階層のみ)
  • cp コピーする〇〇 新しい〇〇 /copy ファイルのコピー
  • cp -r コピーするdir名 新しいdir名 /ディレクトリのコピー
  • rm 〇〇 /remove ファイル削除
  • rm -r dir名 /ディレクトリ削除

移動系

  • cd dir名 /change directory 指定したディレクトリへ移動
  • cd .. /一つ親のディレクトリへ移動
  • cd /ホームディレクトリへ移動

mvいろいろ

  • mv 〇〇 dir名 /move 指定したディレクトリへファイル移動
  • mv dir名 移動先dir名 /ディレクトリごと指定ディレクトリへ移動
  • mv 〇〇 新しい〇〇/ファイル名変更

その他用語

  • カレントディレクトリ =今いる場所
  • ルートディレクトリ =1番親の階層
  • ホームディレクトリ =ユーザーが作業するときに起点にするディレクトリ
  • ↑で前に実行したコマンドが入力できる
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