LoginSignup
2
0

More than 1 year has passed since last update.

【Linux】rmdirとrmの違い

Last updated at Posted at 2021-09-05

コマンドで消すときは、「ゴミ箱」には行かずに、本当に消されるので気をつけよう!

ディレクトリを消したい

(安全であるがあまり使わない)

$rmdir ディレクトリ名
  • ファイルが入っているものはrm -rコマンドでないと消えないよ
  • 空のディレクトリじゃないと消せないよ


ファイルを消したい

$rm ファイル名
  • スペース名で区切れば、複数ファイル消せるよ


ディレクトリもファイルも消したい

(よく使う)

$rm -r ディレクトリ名(ディレクトリの中にあるファイルも消す)
2
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
2
0