initial commit

waldyrious/alt-syntax
Romain Prieto 2013-12-08 19:56:16 +11:00
commit 11264d9b19
6 changed files with 111 additions and 0 deletions

20
osx/curl.md Executable file
View File

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

23
osx/grep.md Executable file
View File

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

25
osx/less.md Executable file
View File

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

7
osx/ps.md Executable file
View File

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

20
osx/scp.md Executable file
View File

@ -0,0 +1,20 @@
# scp
- Copies files between hosts on a network
- Works over a secure connection (SSH)
## Uploading a file
`scp local_file 10.0.0.1:/remote/path/filename`
## Uploading a directory
`scp -r local_folder 10.0.0.1:/remote/path/`
## Downloading a file
`scp 10.0.0.1:/remote/path/filename local_file`
## Specifying credentials
`scp local_file my_user@10.0.0.1:/remote/path`

16
osx/tar.md Normal file
View File

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