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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Osumi, Yusuke
March 13, 2021
Technology
440
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
510
ソフトウェアは固定資産
ozuma
0
450
ASCIIコードの小話
ozuma
0
480
名前付きパイプ FIFO
ozuma
0
590
文章、作文技法 リモートワーク
ozuma
1
950
CentOSの今後のリリース(簡易説明)
ozuma
0
430
AndroidでもLinux動いてるよ
ozuma
0
470
Other Decks in Technology
See All in Technology
契約で守るコンパウンドプロダクトのデザインシステム
yug1224
1
1.4k
Claude for Google Workspaces ポン出し/claude-for-google-workspace-slide-conversion
emiki
0
13k
QAエンジニアがSoutherを使ってみたの〜10分でわかるSouther〜
mhlyc
0
120
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
190
AIコーディングを実践してきた1年を振り返る / Looking Back on a Year of Practicing AI Coding
takedatakashi
1
140
あなたのDartコードは丸見えかもしれない ~reFlutterで暴くFlutterアプリの中身と多層防御~
zozotech
PRO
0
170
AWSDirectConnectの構築の進め方を整理してみた
masa_my
1
200
AIで選択肢が広がった組織設計の理想と現実
konifar
12
5.4k
Filter What the LLM Reads: RAG Governance with AgentCore Gateway
yakumo
0
110
AI時代の開発はウォーターフォールに回帰する? / development-with-ai-back-to-wf
okamototakuyasr2
0
120
Devin プロモコードの受け取りと適用(2026.10.27)
kinopeee
0
510
AWS DevOps Agentはどこまで任せられるか 〜機能の現在地と、機能拡張の実践〜
nyankotaro
0
250
Featured
See All Featured
Everyday Curiosity
cassininazir
0
360
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
740
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
59k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
650
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
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コマンドを終了させてしまうと、ファイルは 完全に見えなくなります (ただし直後は台帳から消えただけでディスク上に 残っているので、復旧できる可能性は高いです)