mirror of
https://github.com/cupcakearmy/memoir.git
synced 2025-09-10 18:00:40 +00:00
update to nextra 4
This commit is contained in:
7
content/cli/convert-documents.md
Executable file
7
content/cli/convert-documents.md
Executable file
@@ -0,0 +1,7 @@
|
||||
# Convert documents
|
||||
|
||||
```bash
|
||||
find . -name "*.odt" | xargs -I % pandoc % -o %.md
|
||||
```
|
||||
|
||||
You can add the `-p` flag to `xargs` to confirm before executing, useful for testing if what your are doing is actually correct.
|
7
content/cli/delete-empty-directories.md
Normal file
7
content/cli/delete-empty-directories.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Delete empty directories
|
||||
|
||||
```bash
|
||||
find . -type d -empty -delete
|
||||
```
|
||||
|
||||
This recursively finds and deletes empty directory.
|
7
content/cli/diff.md
Executable file
7
content/cli/diff.md
Executable file
@@ -0,0 +1,7 @@
|
||||
# See difference between files / directories
|
||||
|
||||
```bash
|
||||
diff -ry dir1 dir2
|
||||
```
|
||||
|
||||
The `-r` flag is to recurse into folders. The `-y` flag creates a side by side view, generally easier to read. `-q` Would only show what filenames changed.
|
23
content/cli/format-drive.md
Normal file
23
content/cli/format-drive.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
tags:
|
||||
- cli
|
||||
- macos
|
||||
- format
|
||||
---
|
||||
|
||||
# Format a Drive
|
||||
|
||||
## macOS
|
||||
|
||||
Some times Disk Utility cannot format a whole drive for some reason.
|
||||
|
||||
```
|
||||
# Check devices
|
||||
diskutil list
|
||||
|
||||
# To exfat
|
||||
diskutil eraseDisk EXFAT "NAME" GPT /dev/diskN
|
||||
|
||||
# To fat32, with mbr
|
||||
diskutil eraseDisk FAT32 "NAME" MBR /dev/diskN
|
||||
```
|
15
content/cli/rename.md
Executable file
15
content/cli/rename.md
Executable file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
tags:
|
||||
- rename
|
||||
- regex
|
||||
---
|
||||
|
||||
# `rename`
|
||||
|
||||
`rename` is a command to rename based on regex.
|
||||
|
||||
```bash
|
||||
rename 's/.odt.md/.md/' *.odt.md
|
||||
```
|
||||
|
||||
> Use the `-n` flag to dry run
|
Reference in New Issue
Block a user