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 # curl
- Transfers data from or to a server > Transfers data from or to a server
- Supports most protocols including HTTP, FTP, POP > 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 # grep
- Matches patterns in input text > Matches patterns in input text
- Supports simple patterns and regular expressions > Supports simple patterns and regular expressions
## Search for an exact string - search for an exact string
`grep something FILE`
`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 # less
- Opens a file for reading > Opens a file for reading
- Allows movement and search > Allows movement and search
- Doesn't read the entire file (suitable for logs) > 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)` `d (next), D (previous)`
## Start / end of file - go to start / end of file
`g (start), G (end)` `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` `q`

View File

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

View File

@ -1,20 +1,18 @@
# scp # scp
- Copies files between hosts on a network > Copies files between hosts on a network
- Works over a secure connection (SSH) > 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` `scp {{/local/file}} {{my_user}}@{{10.0.0.1}}:{{/remote/path/}}`
## Specifying credentials
`scp local_file my_user@10.0.0.1:/remote/path`

View File

@ -1,16 +1,16 @@
# tar # tar
- Archiving utility > Archiving utility
- Optional compression with gzip / bzip > 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}}`