Update more layouts
This commit is contained in:
parent
2c4ae49491
commit
1fffa225f5
33
ncftp.md
33
ncftp.md
|
@ -1,25 +1,32 @@
|
|||
---
|
||||
title: ncftp
|
||||
category: CLI
|
||||
layout: 2017/sheet
|
||||
---
|
||||
|
||||
Bookmarking
|
||||
### Bookmarking
|
||||
|
||||
$ ncftp
|
||||
$ open -u username ftp.host.com
|
||||
$ bookmark bookmarkname
|
||||
```bash
|
||||
$ ncftp
|
||||
$ open -u username ftp.host.com
|
||||
$ bookmark bookmarkname
|
||||
```
|
||||
|
||||
Mass download
|
||||
### Mass download
|
||||
|
||||
$ ncftpget -R bookmarkname /www/ .
|
||||
```bash
|
||||
$ ncftpget -R bookmarkname /www/ .
|
||||
```
|
||||
|
||||
Mass upload
|
||||
### Mass upload
|
||||
|
||||
$ ncftpget -R bookmarkname /www/ .
|
||||
```bash
|
||||
$ ncftpput -R bookmarkname /www/ .
|
||||
```
|
||||
|
||||
$ ncftpget -R bookmarkname /www/ .
|
||||
### Upload just the changed files
|
||||
|
||||
Upload just the changed files
|
||||
|
||||
$ git show --pretty="format:" --name-only HEAD~1
|
||||
$ ncftpget -R -C log bookmarkname /www/ .
|
||||
```bash
|
||||
$ git show --pretty="format:" --name-only HEAD~1
|
||||
$ ncftpget -R -C log bookmarkname /www/ .
|
||||
```
|
||||
|
|
41
sed.md
41
sed.md
|
@ -1,30 +1,41 @@
|
|||
---
|
||||
title: Sed
|
||||
title: sed
|
||||
category: CLI
|
||||
layout: 2017/sheet
|
||||
intro: |
|
||||
Here's home hints on using sed.
|
||||
---
|
||||
|
||||
### OSX Caveat
|
||||
### In place replacements
|
||||
|
||||
To do in place replacements `-i ''` is required (GNU/sed is different)
|
||||
#### In GNU sed: use `-i` without arg.
|
||||
|
||||
sed -i '' -e 's/foo/bar/' example.md
|
||||
```bash
|
||||
sed -i -e 's/foo/bar/' example.md
|
||||
```
|
||||
|
||||
### GNU/sed
|
||||
#### In OSX, `-i ''` is required.
|
||||
|
||||
To do in place replacements use `-i` without arg
|
||||
```bash
|
||||
sed -i '' -e 's/foo/bar/' example.md
|
||||
```
|
||||
|
||||
sed -i -e 's/foo/bar/' example.md
|
||||
### File regions
|
||||
|
||||
### Yes
|
||||
#### Print until a certain line is met
|
||||
|
||||
Print until a certain line is met
|
||||
```bash
|
||||
sed '/begin api/q'
|
||||
```
|
||||
|
||||
sed '/begin api/q'
|
||||
#### Print until a certain line is met, but not that line
|
||||
|
||||
Print until a certain line is met, but not that line
|
||||
```bash
|
||||
sed '/^# begin/,$d'
|
||||
```
|
||||
|
||||
sed '/^# begin/,$d'
|
||||
#### Print everything after a given line
|
||||
|
||||
Print everything after a given line
|
||||
|
||||
sed -n '/end api/,$p'
|
||||
```bash
|
||||
sed -n '/end api/,$p'
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue