Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
今いるディレクトリを消すとどうなる
Search
Osumi, Yusuke
March 13, 2021
Technology
450
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
今いるディレクトリを消すとどうなる
「新しいLinuxの教科書」を読む会 オンライン #11 での発表資料です。
https://linuxbook.connpass.com/event/204816/
Osumi, Yusuke
March 13, 2021
More Decks by Osumi, Yusuke
See All by Osumi, Yusuke
本の紹介の補足
ozuma
1
430
gitサービス3兄弟
ozuma
0
430
簡体字は楽
ozuma
0
520
ソフトウェアは固定資産
ozuma
0
460
ASCIIコードの小話
ozuma
0
480
名前付きパイプ FIFO
ozuma
0
600
文章、作文技法 リモートワーク
ozuma
1
960
CentOSの今後のリリース(簡易説明)
ozuma
0
440
AndroidでもLinux動いてるよ
ozuma
0
470
Other Decks in Technology
See All in Technology
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
190
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
630
Jev の中身は50行で再現できる。でも本物との差はどこにあるのか
hisuzuya
0
300
[General] 개발자로 해외 기업에서 일하기
skydoves
1
290
AWS構成から考えるWebセキュリティ ― WordPressの構築経験から考える公開範囲と更新運用【JAWS FESTA 2026 in AKITA】
cscengineer
PRO
0
110
Patterns in AI Driven Software Development
akosma
PRO
0
480
AIコーディングはじめました
miso
0
150
20261016_Nagoya Tech Talk #4 データ活用のリアル AIも人も間違える
bessaralink55
0
160
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
100
Active Directory と Entra ID のむむむな関係
murachiakira
PRO
2
960
生成AI時代のIAMのマニアックな話
takuros
3
320
re:Inventで、人生は変わったのか? / growth-builders-hub-1-reinvent-2026
mhrtech
2
310
Featured
See All Featured
First, design no harm
axbom
PRO
2
1.4k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
560
Claude Code のすすめ
schroneko
67
230k
The browser strikes back
jonoalderson
0
1.9k
HDC tutorial
michielstock
2
1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
今いるディレクトリを 消すとどうなる @ozuma5119 1 「新しいLinuxの教科書」を読む会 オンライン #11 2021/03/13
Windowsの場合 - できない 2
Linuxの場合 - できる 3 $ ls book1.csv secret.txt $ pwd
/home/book/Documents $ rm -v -r /home/book/Documents `/home/book/Documents/secret.txt' を削除しました `/home/book/Documents/book1.csv' を削除しました ディレクトリを削除しました: `/home/book/Documents' $ pwd /home/book/Documents
4 "Documents" フォルダは消えたのにいる! *いしのなかにいる*
いるけど何もできません 5 [book@cent7 Documents]$ pwd /home/book/Documents [book@cent7 Documents]$ rm -v
-rf /home/book/Documents ディレクトリを削除しました: `/home/book/Documents' [book@cent7 Documents]$ [book@cent7 Documents]$ echo "AAA" > a.txt bash: a.txt: そのようなファイルやディレクトリはありません [book@cent7 Documents]$ ls -al 合計 0 [book@cent7 Documents]$ . と .. も無いことに注意
Linuxでファイル・ディレクトリを削除するとは 6 /home/book iノード番号 ファイル名 82490 Documents 33795498 Desktop 51812769
Downloads Documents Desktop Downloads
Linuxでファイル・ディレクトリを削除するとは 7 /home/book iノード番号 ファイル名 82490 Documents 33795498 Desktop 51812769
Downloads Documents Desktop Downloads ディレクトリエントリ(台帳)から消すだけ そのため「迷子」になる
応用編 - 消しちまった! でも別のアプリで開いてる シナリオ 1. Documents/secrets.txt をlessで見ていた 2. [Documents]
フォルダごと消してしまった $ rm -rf Documents 3. lessがopenしているFD(File Discriptor)を/procから探してコピーする 4. 復旧! 参考: https://mag.osdn.jp/06/11/23/0451251 8
9 1. ~/Documents/secrets.txt を 開いている状態で…… 2. Documentsフォルダごと消します
10 1. lessコマンドのプロセスIDを調べて 2. lsofコマンドでファイルを開いている FD(File Descriptor)を探します
11 1. プロセスID=11523, FD=4 をコピーします 2. ファイル復旧できた!
12 lessコマンドを終了させてしまうと、ファイルは 完全に見えなくなります (ただし直後は台帳から消えただけでディスク上に 残っているので、復旧できる可能性は高いです)