@@ -7,19 +7,22 @@ Handy list of oft-used Linux commands that I will never remember. Not intended t
7
7
- [ Count number of items in directory] ( #count-number-of-items-in-directory )
8
8
- [ Monitor GPU usage] ( #monitor-gpu-usage )
9
9
- [ File Permissions] ( #file-permissions )
10
- - [ SSH 101] ( #ssh-101 )
11
- - [ rsync] ( #rsync )
12
- - [ Networking] ( #networking )
13
10
- [ fish] ( #fish )
14
11
- [ wget] ( #wget )
15
- - [ grep] ( #grep )
12
+ - [ Networking] ( #networking )
13
+ - [ Port Monitoring] ( #port-monitoring )
14
+ - [ SSH 101] ( #ssh-101 )
15
+ - [ rsync] ( #rsync )
16
16
- [ System Setup] ( #system-setup )
17
17
- [ Essential Installs in Ubuntu LTS Minimal] ( #essential-installs )
18
18
- [ Increasing swap memory] ( #increasing-swap )
19
19
- [ Session management using screen] ( #session-management-using-screen )
20
20
- [ Docker 101] ( #docker-101 )
21
21
- [ Git 101] ( #git-101 )
22
22
- [ make Basics] ( #make-basics )
23
+ - [ Data Wrangling] ( #data-wrangling )
24
+ - [ grep] ( #grep )
25
+ - [ awk and sed] ( #awk-and-sed )
23
26
24
27
## Shell 101
25
28
@@ -62,32 +65,28 @@ sudo chmod XXX <filepath>
62
65
# ssh directory 700
63
66
```
64
67
65
- ### SSH 101
68
+ ### fish
66
69
67
70
``` bash
68
- # connect to hostname with key and port forward
69
- ssh -L < remote_port> :localhost:< local_port> -i /path/to/key username@hostname
71
+ # Set password of user account on GCP VM
72
+ sudo passwd $USER
73
+ # set fish as default shell
74
+ chsh -s ` which fish`
70
75
```
71
76
72
- ### rsync
77
+ ### wget
73
78
74
79
``` bash
75
- # -avzPn --stats -h --> archive verbose compressed progress-bar dry-run human-readable-stats
76
-
77
- # pull files from remote server
78
-
79
- rsync -avzPn --stats -h username@remote_host:/home/username/directory_we_want ~ /local/directory
80
-
81
- # push files to remote
82
- rsync -avzPn ~ /local/directory username@remote_host:/home/username/destination_dir
83
-
84
- # using ssh key
85
- rsync -avzPn -e " ssh -i ~/ec2_keyfile.pem" user@remote:/home/folder /tmp/local_system/
80
+ # recursive no-parent Reject no-Host robots.txt X_no_of_dirs
81
+ wget -r -np -R " index.html" -nH -e robots=off --cut-dirs=X < download_URL>
86
82
```
87
83
88
- More details on [ rsync cheatsheet] ( https://www.danielms.site/blog/rsync-cheatsheet/ )
84
+ * Nifty recipes for common commands - [ tldr.sh] ( https://tldr.sh/ )
85
+ * Some basic shell usage [ examples] ( https://missing.csail.mit.edu/2020/shell-tools/ )
89
86
90
- ### Networking
87
+ ## Networking
88
+
89
+ ### Port Monitoring
91
90
92
91
``` bash
93
92
# Get PID of a process running on port YYYY
@@ -96,29 +95,30 @@ sudo netstat -lpn | grep :YYYY
96
95
fuser 8080/tcp (add -k to kill the process too)
97
96
```
98
97
99
- ### fish
98
+ ### SSH 101
100
99
101
100
``` bash
102
- # Set password of user account on GCP VM
103
- sudo passwd $USER
104
- # set fish as default shell
105
- chsh -s ` which fish`
101
+ # connect to hostname with key and port forward
102
+ ssh -L < remote_port> :localhost:< local_port> -i /path/to/key username@hostname
106
103
```
107
104
108
- ### wget
105
+ ### rsync
109
106
110
107
``` bash
111
- # recursive no-parent Reject no-Host robots.txt X_no_of_dirs
112
- wget -r -np -R " index.html" -nH -e robots=off --cut-dirs=X < download_URL>
113
- ```
108
+ # -avzPn --stats -h --> archive verbose compressed progress-bar dry-run human-readable-stats
114
109
115
- ### grep
110
+ # pull files from remote server
116
111
117
- ``` bash
118
- # find pattern in files
119
- grep --include=\* .{py, c, h} --exclude=\* .o --exclude-dir={dir1,dir2,* .dst} -rnw ' /path/to/somewhere/' -e " pattern"
112
+ rsync -avzPn --stats -h username@remote_host:/home/username/directory_we_want ~ /local/directory
113
+
114
+ # push files to remote
115
+ rsync -avzPn ~ /local/directory username@remote_host:/home/username/destination_dir
116
+
117
+ # using ssh key
118
+ rsync -avzPn -e " ssh -i ~/ec2_keyfile.pem" user@remote:/home/folder /tmp/local_system/
120
119
```
121
- More ` grep ` funda [ here] ( https://www.grymoire.com/Unix/Grep.html )
120
+
121
+ More details on [ rsync cheatsheet] ( https://www.danielms.site/blog/rsync-cheatsheet/ )
122
122
123
123
## System Setup
124
124
### Essential Installs
@@ -277,3 +277,17 @@ dep%: subdep1 subdep2
277
277
```
278
278
* [ Metaprogamming - MIT Missing Semester] ( https://missing.csail.mit.edu/2020/metaprogramming/ )
279
279
* [ ` make ` Standard Targets] ( https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html#Standard-Targets )
280
+
281
+ ## Data Wrangling
282
+
283
+ ### grep
284
+
285
+ ``` bash
286
+ # find pattern in files
287
+ grep --include=\* .{py, c, h} --exclude=\* .o --exclude-dir={dir1,dir2,* .dst} -rnw ' /path/to/somewhere/' -e " pattern"
288
+ ```
289
+ More ` grep ` funda [ here] ( https://www.grymoire.com/Unix/Grep.html )
290
+
291
+ ### awk and sed
292
+
293
+ TODO: Refer [ here] ( https://missing.csail.mit.edu/2020/data-wrangling/ ) now
0 commit comments