www.fgks.org   »   [go: up one dir, main page]

Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Prieto authored and Romain Prieto committed Dec 8, 2013
0 parents commit 11264d9
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
20 changes: 20 additions & 0 deletions osx/curl.md
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions osx/grep.md
Original file line number Diff line number Diff line change
@@ -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 changes: 25 additions & 0 deletions osx/less.md
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions osx/ps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ps

- Information about running processes

## List all running processes

`ps aux`
20 changes: 20 additions & 0 deletions osx/scp.md
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions osx/tar.md
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit 11264d9

Please sign in to comment.