Update more layouts

This commit is contained in:
Rico Sta. Cruz 2017-09-21 16:30:07 +08:00
parent 2c4ae49491
commit 1fffa225f5
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 46 additions and 28 deletions

View File

@ -1,25 +1,32 @@
--- ---
title: ncftp title: ncftp
category: CLI category: CLI
layout: 2017/sheet
--- ---
Bookmarking ### Bookmarking
$ ncftp ```bash
$ open -u username ftp.host.com $ ncftp
$ bookmark bookmarkname $ 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 ```bash
$ git show --pretty="format:" --name-only HEAD~1
$ git show --pretty="format:" --name-only HEAD~1 $ ncftpget -R -C log bookmarkname /www/ .
$ ncftpget -R -C log bookmarkname /www/ . ```

41
sed.md
View File

@ -1,30 +1,41 @@
--- ---
title: Sed title: sed
category: CLI 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 ```bash
sed -n '/end api/,$p'
sed -n '/end api/,$p' ```