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][command] ディレクトリ・ファイル管理_ディレクトリ操作_cd, mkdir, pwd

Last updated at Posted at 2025-03-09

cdコマンド

$ cd [ディレクトリ名]

活用例

rootユーザの場合

  • ホームディレクトリ(/)への移動
$ cd ~

$ cd
  • ホームディレクトリ配下にある「test」ディレクトリ(/test)に移動
$ cd ~/test
  • testユーザ(一般)のホームディレクトリ(/home/test)に移動
$ cd ~test

$ cd ~/home/test

testユーザ(一般)の場合

  • ホームディレクトリ(/home/test)への移動
$ cd ~

$ cd

$ cd ~/test

mkdirコマンド

$ mkdir [オプション] ディレクトリ名
オプション 由来 説明
default make directory - 新しいディレクトリを作成する
-p parents - 親ディレクトリもまとめて作成する
例: -p /home/user/project/src
/home/user/projectディレクトリがない場合h作成する
-m mode - 作成するディレクトリのパーミッションを指定
例: -m 755

pwdコマンド

Ping-t

cd

mkdir

pwd

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?