Markdown format closer to the output + highlight replacable tokens

waldyrious/alt-syntax
Romain Prieto 2013-12-09 22:12:16 +11:00
parent 8e6ede35ef
commit 8e7a0eff79
6 changed files with 53 additions and 54 deletions

View File

@ -1,20 +1,20 @@
# curl
- Transfers data from or to a server
- Supports most protocols including HTTP, FTP, POP
> Transfers data from or to a server
> Supports most protocols including HTTP, FTP, POP
## Head request
- send form-encoded data
`curl --head http://localhost`
`curl --data {{name=bob}} {{http://localhost/form}}`
## Send form-encoded data
- send JSON data
`curl --data name=bob http://localhost/form`
`curl -X POST -H "Content-Type: application/json" -d {{'{"name":"bob"}'}} {{http://localhost/login}}`
## Send JSON data
- specify an HTTP method
`curl -X POST -H "Content-Type: application/json" -d '{"name":"bob"}' http://localhost/login`
`curl -X {{DELETE}} {{http://localhost/item/123}}`
## Specify an HTTP method
- head request
`curl -X DELETE http://localhost/item/123`
`curl --head {{http://localhost}}`

View File

@ -1,23 +1,24 @@
# grep
- Matches patterns in input text
- Supports simple patterns and regular expressions
> Matches patterns in input text
> Supports simple patterns and regular expressions
## Search for an exact string
`grep something FILE`
- search for an exact string
`grep {{something}} {{file_path}}`
## Use a regex instead of a word
- use a regex
`grep -e ^regex$ FILE`
`grep -e {{^regex$}} {{file_path}}`
## See 3 lines of context
- see 3 lines of context
`grep -C 3 something FILE`
`grep -C 3 {{something}} {{file_path}}`
## Print the count of matches
- print the number of matches
`grep -c something FILE`
`grep -c {{something}} {{file_path}}`
## Use the standard input instead
- use the standard input instead of a file
`cat FILE | grep something`
`cat {{file_path}} | grep {{something}}`

View File

@ -1,25 +1,25 @@
# less
- Opens a file for reading
- Allows movement and search
- Doesn't read the entire file (suitable for logs)
> Opens a file for reading
> Allows movement and search
> Doesn't read the entire file (suitable for logs)
## Open a file
- open a file
`less source_file`
`less {{source_file}}`
## Page up / down
- page up / down
`d (next), D (previous)`
## Start / end of file
- go to start / end of file
`g (start), G (end)`
## Search for a string
- search for a string
`/something then n (next), N (previous)`
`/{{something}} then n (next), N (previous)`
## Exit
- exit
`q`

View File

@ -1,7 +1,7 @@
# ps
- Information about running processes
> Information about running processes
## List all running processes
- list all running processes
`ps aux`

View File

@ -1,20 +1,18 @@
# scp
- Copies files between hosts on a network
- Works over a secure connection (SSH)
> Copies files between hosts on a network
> Works over a secure connection (SSH)
## Uploading a file
- upload a file or directory
`scp local_file 10.0.0.1:/remote/path/filename`
`scp {{/local/file}} {{10.0.0.1}}:{{/remote/path/}}`
`scp {{/local/file}} {{10.0.0.1}}:{{/remote/path/newname}}`
`scp -r {{/local/folder}} {{10.0.0.1}}:{{/remote/path/}}`
## Uploading a directory
- download a file (reversed)
`scp -r local_folder 10.0.0.1:/remote/path/`
`scp {{10.0.0.1}}:{{/remote/path/filename}} {{/local/file}}`
## Downloading a file
- specify credentials
`scp 10.0.0.1:/remote/path/filename local_file`
## Specifying credentials
`scp local_file my_user@10.0.0.1:/remote/path`
`scp {{/local/file}} {{my_user}}@{{10.0.0.1}}:{{/remote/path/}}`

View File

@ -1,16 +1,16 @@
# tar
- Archiving utility
- Optional compression with gzip / bzip
> Archiving utility
> Optional compression with gzip / bzip
## create an archive from files
- create an archive from files
`tar cf target.tar file1 file2 file3`
`tar cf {{target.tar}} {{file1 file2 file3}}`
## create a gzipped archive
- create a gzipped archive
`tar cfz target.tar.gz file1 file2 file3`
`tar cfz {{target.tar.gz}} {{file1 file2 file3}}`
## extract an archive in a target folder
- extract an archive in a target folder
`tar xf source.tar -C folder`
`tar xf {{source.tar}} -C {{folder}}`