-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Romain Prieto
authored and
Romain Prieto
committed
Dec 8, 2013
0 parents
commit 11264d9
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]:/remote/path` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |