Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linux:start [2026/04/26 22:13] – mh | linux:start [2026/04/26 22:17] (current) – mh | ||
|---|---|---|---|
| Line 110: | Line 110: | ||
| ====== Storage & Filesystems ====== | ====== Storage & Filesystems ====== | ||
| - | ==== Mounting ==== | + | ===== Mounting |
| === List mounts: === | === List mounts: === | ||
| Line 210: | Line 210: | ||
| Note: Ensure the correct device is targeted before running '' | Note: Ensure the correct device is targeted before running '' | ||
| + | |||
| + | |||
| + | ====== File & Data Operations ====== | ||
| + | |||
| + | ===== Shell toolbox ===== | ||
| + | |||
| + | ==== File operations ==== | ||
| + | |||
| + | === Mass renaming === | ||
| + | |||
| + | Uppercase .JPG to lowercase .jpg | ||
| + | |||
| + | <code bash> | ||
| + | for i in *.JPG; do mv " | ||
| + | </ | ||
| + | |||
| + | Alternative (rename tool): | ||
| + | |||
| + | <code bash> | ||
| + | rename ' | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | === Empty a file === | ||
| + | |||
| + | <code bash> | ||
| + | : > / | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Text processing ==== | ||
| + | |||
| + | === cut === | ||
| + | |||
| + | Extract part of a string: | ||
| + | |||
| + | <code bash> | ||
| + | date | cut -c17-24 | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Archives ==== | ||
| + | |||
| + | === tar === | ||
| + | |||
| + | <code bash> | ||
| + | # Extract | ||
| + | tar -xvf file.tar | ||
| + | tar -xvzf file.tar.gz | ||
| + | |||
| + | # Create | ||
| + | tar -cvf file.tar / | ||
| + | tar -cvzf file.tar.gz / | ||
| + | </ | ||
| + | |||
| + | Flags: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== User Environment ====== | ||
| ===== PATH ===== | ===== PATH ===== | ||
| Line 418: | Line 487: | ||
| It often reduces file size, especially with image-heavy PDFs, but this is not guaranteed. | It often reduces file size, especially with image-heavy PDFs, but this is not guaranteed. | ||
| </ | </ | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ===== Data recovery ===== | ||
| - | |||
| - | Use **TestDisk** / **PhotoRec** as a first recovery tool. | ||
| - | |||
| - | * **TestDisk** attempts partition repair and file undelete when filesystem metadata is still usable. | ||
| - | * **PhotoRec** performs file carving by signature. It can recover files from damaged filesystems, | ||
| - | |||
| - | Do not write recovered files to the source disk. | ||
| - | |||
| - | ==== PhotoRec: recovered MOV files ==== | ||
| - | |||
| - | For some recovered '' | ||
| - | |||
| - | In PhotoRec '' | ||
| - | |||
| - | < | ||
| - | [X] mov/mdat Recover mdat atom as a separate file | ||
| - | </ | ||
| - | |||
| - | Sort recovered files by name, then try concatenating matching parts: | ||
| - | |||
| - | <code bash> | ||
| - | cat f123_ftyp.mov f456_mdat.mov > recovered_1.mov | ||
| - | cat f456_mdat.mov f123_ftyp.mov > recovered_2.mov | ||
| - | </ | ||
| - | |||
| - | One order may produce a usable file. | ||
| - | |||
| - | Sometimes the header/ | ||
| - | |||
| - | <code bash> | ||
| - | cat f54114560.mp4 f51781632_mdat.mov > recovered.mov | ||
| - | </ | ||
| - | |||
| - | Note: This is a recovery attempt, not a guaranteed repair method. For valuable data, stop using the disk immediately and clone/image it before experimenting. | ||
| - | |||
| ===== Video playback (minimal UI) ===== | ===== Video playback (minimal UI) ===== | ||
| Line 509: | Line 538: | ||
| osdlevel=0 | osdlevel=0 | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| + | ====== Specialized & Recovery ====== | ||
| + | |||
| + | ===== Data recovery ===== | ||
| + | |||
| + | Use **TestDisk** / **PhotoRec** as a first recovery tool. | ||
| + | |||
| + | * **TestDisk** attempts partition repair and file undelete when filesystem metadata is still usable. | ||
| + | * **PhotoRec** performs file carving by signature. It can recover files from damaged filesystems, | ||
| + | |||
| + | Do not write recovered files to the source disk. | ||
| + | |||
| + | ==== PhotoRec: recovered MOV files ==== | ||
| + | |||
| + | For some recovered '' | ||
| + | |||
| + | In PhotoRec '' | ||
| + | |||
| + | < | ||
| + | [X] mov/mdat Recover mdat atom as a separate file | ||
| + | </ | ||
| + | |||
| + | Sort recovered files by name, then try concatenating matching parts: | ||
| + | |||
| + | <code bash> | ||
| + | cat f123_ftyp.mov f456_mdat.mov > recovered_1.mov | ||
| + | cat f456_mdat.mov f123_ftyp.mov > recovered_2.mov | ||
| + | </ | ||
| + | |||
| + | One order may produce a usable file. | ||
| + | |||
| + | Sometimes the header/ | ||
| + | |||
| + | <code bash> | ||
| + | cat f54114560.mp4 f51781632_mdat.mov > recovered.mov | ||
| + | </ | ||
| + | |||
| + | Note: This is a recovery attempt, not a guaranteed repair method. For valuable data, stop using the disk immediately and clone/image it before experimenting. | ||
| + | |||
| + | |||
| ===== Using Apple USB SuperDrive ===== | ===== Using Apple USB SuperDrive ===== | ||
| Line 714: | Line 785: | ||
| </ | </ | ||
| - | ===== Shell toolbox ===== | ||
| - | ==== File operations ==== | ||
| - | |||
| - | === Mass renaming === | ||
| - | |||
| - | Uppercase .JPG to lowercase .jpg | ||
| - | |||
| - | <code bash> | ||
| - | for i in *.JPG; do mv " | ||
| - | </ | ||
| - | |||
| - | Alternative (rename tool): | ||
| - | |||
| - | <code bash> | ||
| - | rename ' | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | === Empty a file === | ||
| - | |||
| - | <code bash> | ||
| - | : > / | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Text processing ==== | ||
| - | |||
| - | === cut === | ||
| - | |||
| - | Extract part of a string: | ||
| - | |||
| - | <code bash> | ||
| - | date | cut -c17-24 | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Archives ==== | ||
| - | |||
| - | === tar === | ||
| - | |||
| - | <code bash> | ||
| - | # Extract | ||
| - | tar -xvf file.tar | ||
| - | tar -xvzf file.tar.gz | ||
| - | |||
| - | # Create | ||
| - | tar -cvf file.tar / | ||
| - | tar -cvzf file.tar.gz / | ||
| - | </ | ||
| - | |||
| - | Flags: | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ---- | ||