Skip to content

Commit 11264d9

Browse files
Romain PrietoRomain Prieto
Romain Prieto
authored and
Romain Prieto
committed
initial commit
0 parents  commit 11264d9

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

osx/curl.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# curl
2+
3+
- Transfers data from or to a server
4+
- Supports most protocols including HTTP, FTP, POP
5+
6+
## Head request
7+
8+
`curl --head http://localhost`
9+
10+
## Send form-encoded data
11+
12+
`curl --data name=bob http://localhost/form`
13+
14+
## Send JSON data
15+
16+
`curl -X POST -H "Content-Type: application/json" -d '{"name":"bob"}' http://localhost/login`
17+
18+
## Specify an HTTP method
19+
20+
`curl -X DELETE http://localhost/item/123`

osx/grep.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# grep
2+
3+
- Matches patterns in input text
4+
- Supports simple patterns and regular expressions
5+
6+
## Search for an exact string
7+
`grep something FILE`
8+
9+
## Use a regex instead of a word
10+
11+
`grep -e ^regex$ FILE`
12+
13+
## See 3 lines of context
14+
15+
`grep -C 3 something FILE`
16+
17+
## Print the count of matches
18+
19+
`grep -c something FILE`
20+
21+
## Use the standard input instead
22+
23+
`cat FILE | grep something`

osx/less.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# less
2+
3+
- Opens a file for reading
4+
- Allows movement and search
5+
- Doesn't read the entire file (suitable for logs)
6+
7+
## Open a file
8+
9+
`less source_file`
10+
11+
## Page up / down
12+
13+
`d (next), D (previous)`
14+
15+
## Start / end of file
16+
17+
`g (start), G (end)`
18+
19+
## Search for a string
20+
21+
`/something then n (next), N (previous)`
22+
23+
## Exit
24+
25+
`q`

osx/ps.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ps
2+
3+
- Information about running processes
4+
5+
## List all running processes
6+
7+
`ps aux`

osx/scp.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# scp
2+
3+
- Copies files between hosts on a network
4+
- Works over a secure connection (SSH)
5+
6+
## Uploading a file
7+
8+
`scp local_file 10.0.0.1:/remote/path/filename`
9+
10+
## Uploading a directory
11+
12+
`scp -r local_folder 10.0.0.1:/remote/path/`
13+
14+
## Downloading a file
15+
16+
`scp 10.0.0.1:/remote/path/filename local_file`
17+
18+
## Specifying credentials
19+
20+
`scp local_file [email protected]:/remote/path`

osx/tar.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# tar
2+
3+
- Archiving utility
4+
- Supports tar / gzip / bzip
5+
6+
## create an archive from files
7+
8+
`tar cf target.tar file1 file2 file3`
9+
10+
## create a gzipped archive
11+
12+
`tar cfz target.tar.gz file1 file2 file3`
13+
14+
## extract an archive in a target folder
15+
16+
`tar xf source.tar -C folder`

0 commit comments

Comments
 (0)