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?

【学習】知らなかった。yes/noを求められない事があるなんて…。

Posted at

はじめに

あるディレクトリを削除しようとした時、どうすればいいのか分からなかったことについて今回取り上げたいと思います。

状況

  • GithubのCodespacesを使用
  • 学習のGithubをクローンしたけど、手違いがあったので一度クローンしたディレクトリを削除したい

実行したコマンド

削除の為に実行したコマンドはrm -r <ディレクトリ名>です
※「-r」を「-rf」にすると強制削除らしい?

 ➜ /workspaces/rails8 (main) $ ls
README.md rails8-sample
➜ /workspaces/rails8 (main) $ rm -r rails8-sample
rm: remove write-protected regular file 'rails8-sample/.git/objects/pack/pack-68bd4.pack'? 

あれ、「?」だけで終わってるけど、どうすればいいの

はい。つみました😭
というのは冗談でrm: remove write-protected regular fileで検索をかけてみると、下記記事がみつかりました
 
※Google先生に翻訳をおねがいすると「rm: 書き込み保護された通常ファイルを削除する」という結果になりました。

「y」を入力してからエンターを押してください。
「y/n?」といった確認メッセージが表示されない場合もあるようです。

おわりに

文章の終わりに「?」が付くものにはなにかしら「確認メッセージ」が欲しいところです💦
今回の学びは「y/n?」が表示されないものがある。という事がしれてよかt

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?