-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux_general.json
641 lines (640 loc) · 17 KB
/
linux_general.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
[
{
"name": "Power mode [menu]",
"subtasks": [
{
"name": "Shutdown",
"cmdText": "sudo poweroff",
"numParams": 0,
"keywords": "off"
},
{
"name": "Reboot",
"cmdText": "sudo reboot",
"numParams": 0,
"keywords": "restart"
},
{
"name": "Hibernate",
"cmdText": "sudo systemctl hibernate",
"numParams": 0,
"keywords": ""
},
{
"name": "Standby",
"cmdText": "sudo systemctl suspend",
"numParams": 0,
"keywords": "sleep"
}
]
},
{
"name": "Print random line from file",
"cmdText": "shuf -n 1 <file>",
"numParams": 1,
"keywords": "echo show get select uniform"
},
{
"name": "List drive devices",
"cmdText": "sudo fdisk -l",
"numParams": 0,
"keywords": "show info disks all browse storage"
},
{
"name": "Make bootable USB drive from iso",
"cmdText": "sudo dd bs=4M if=<iso_file> of=<drive_device> status=progress oflag=sync",
"numParams": 2,
"keywords": "stick thumbdrive os"
},
{
"name": "Mounting drives [menu]",
"subtasks": [
{
"name": "Mount drive device",
"cmdText": "sudo mount <device_path> <empty_folder>/",
"numParams": 2,
"keywords": "disk storage"
},
{
"name": "Unmount drive device",
"cmdText": "sudo umount <mount_point_folder>",
"numParams": 1,
"keywords": "disk storage"
}
]
},
{
"name": "nix [menu]",
"subtasks": [
{
"name": "Delete old NixOS generations",
"cmdText": "sudo nix-collect-garbage -d",
"numParams": 0,
"keywords": "clear free remove"
},
{
"name": "Upgrade nix packages (don't change channel)",
"cmdText": "sudo nix-channel --update && sudo nixos-rebuild switch",
"numParams": 0,
"keywords": "update"
}
]
},
{
"name": "ffmpeg [menu]",
"subtasks": [
{
"name": "View media file metadata",
"cmdText": "ffmpeg -i <file>",
"keywords": "see show print echo id3 tags mp3",
"numParams": 1
},
{
"name": "Crop video",
"cmdText": "ffmpeg -i <in_file> -filter:v \"crop=<out_w>:<out_h>:<start_x>:<start_y>\" <out_file>",
"keywords": "trim",
"numParams": 6
},
{
"name": "Merge video file and audio file",
"cmdText": "ffmpeg -i <video_file> -i <audio_file> -c:v copy -c:a aac <output_file>",
"keywords": "combine",
"numParams": 3
},
{
"name": "Reverse video file",
"cmdText": "ffmpeg -i <in_file> -vf reverse -af areverse <out_file>",
"keywords": "backwards convert",
"numParams": 2
},
{
"name": "Remove audio from video",
"cmdText": "ffmpeg -i <in_file> -c copy -an <out_file>",
"keywords": "strip mute track",
"numParams": 2
},
{
"name": "Get frames per second of video file",
"cmdText": "ffmpeg -i <filename>",
"keywords": "fps view see",
"numParams": 1
},
{
"name": "Convert video to mp3",
"cmdText": "ffmpeg -i <video_file> -q:a 0 -map a out.mp3",
"keywords": "audio strip track",
"numParams": 1
},
{
"name": "Hardcode subtitles",
"cmdText": "ffmpeg -i <video_file> -vf \"subtitles=<subtitle_file>\" <out_file>",
"keywords": "video subs file srt",
"numParams": 3
},
{
"name": "Make video from image and audio",
"cmdText": "ffmpeg -loop 1 -r 1 -i <image_file> -i <audio_file> -c:a copy -shortest output.avi",
"keywords": "youtube loop mp3 create",
"numParams": 2
},
{
"name": "Cut video",
"cmdText": "ffmpeg -i <in_file> -ss <start (hh:mm:ss)> -to <end (hh:mm:ss)> <out_file>",
"keywords": "crop segment interval",
"numParams": 4
},
{
"name": "Concatenate video files",
"cmdText": "ffmpeg -i <file1> -i <file2> -i <file3> -filter_complex \"[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] concat=n=3:v=1:a=1 [v] [a]\" -map \"[v]\" -map \"[a]\" <out_file>",
"keywords": "join merge mp4 mkv avi movie",
"numParams": 4
}
]
},
{
"name": "Start perl REPL",
"cmdText": "rlwrap perl -d -e 1",
"keywords": "interactive run",
"numParams": 0
},
{
"name": "Get name of running terminal",
"cmdText": "ps -o 'cmd=' -p $(ps -o 'ppid=' -p $$)",
"keywords": "see info show view emulator",
"numParams": 0
},
{
"name": "Clear docker objects",
"cmdText": "docker system prune --all --volumes",
"keywords": "image docker",
"numParams": 0
},
{
"name": "Run temporary container and go to bash",
"cmdText": "docker run -it --rm <image> bash",
"keywords": "image docker",
"numParams": 1
},
{
"name": "Stop all docker containers",
"cmdText": "docker stop $(docker ps -q)",
"keywords": "kill terminate",
"numParams": 0
},
{
"name": "Run vim with default configuration",
"cmdText": "vim --clean",
"keywords": "file blank empty nvim neovim",
"numParams": 0
},
{
"name": "Get exit status of last command",
"cmdText": "echo $?",
"keywords": "see info show recent code success fail",
"numParams": 0
},
{
"name": "Show 10 processes using the most memory",
"cmdText": "ps aux --sort=-%mem | head -11",
"keywords": "info see display get print echo hog sort ram",
"numParams": 0
},
{
"name": "Get window's process ID by clicking it",
"cmdText": "xprop _NET_WM_PID | cut -d' ' -f3",
"keywords": "see find pid kill x select mouse",
"numParams": 0
},
{
"name": "Set vi keybindings (in bash)",
"cmdText": "set -o vi",
"keywords": "vim keys shortcut configure",
"numParams": 0
},
{
"name": "Show default gateway",
"cmdText": "ip route | grep default",
"keywords": "router lan local network",
"numParams": 0
},
{
"name": "Echo range of lines from file",
"cmdText": "sed -n <start_line>,<end_line>p <file>",
"keywords": "write echo line single individual one set part print interval",
"numParams": 3
},
{
"name": "Forward port via ssh",
"cmdText": "ssh -L <local_port>:<dest_host>:<dest_port> <ssh_server>",
"keywords": "proxy",
"numParams": 4
},
{
"name": "Show lines appended to a file in real time",
"cmdText": "tail -F <file>",
"keywords": "tail watch live update log",
"numParams": 1
},
{
"name": "Search in files with a certain extension",
"cmdText": "ag -G '\\.<extension>$' '<search_string>'",
"keywords": "grep",
"numParams": 2
},
{
"name": "Zip directory",
"cmdText": "zip -r <zip_file> <dir>",
"numParams": 2
},
{
"name": "Count words in file",
"cmdText": "wc -w <file>",
"numParams": 1
},
{
"name": "Convert audio format",
"cmdText": "avconv -i <in_file> <out_file>",
"keywords": "sound file format webm mp3",
"numParams": 2
},
{
"name": "Convert image format",
"cmdText": "convert <in_file> <out_file>",
"keywords": "png jpg jpeg gif file",
"numParams": 2
},
{
"name": "Kill LibreOffice",
"cmdText": "killall soffice.bin",
"keywords": "end terminate process",
"numParams": 0
},
{
"name": "See version of installed pip package",
"cmdText": "pip show <package>",
"keywords": "python pip3 view get",
"numParams": 1
},
{
"name": "Count lines of code in project",
"cmdText": "find . -name '*.<code_file_extension>' | xargs wc -l",
"keywords": "total all entire folder directory recursive",
"numParams": 1
},
{
"name": "Pretty print JSON",
"cmdText": "cat <json file> | python3 -m json.tool",
"numParams": 1
},
{
"name": "Count files [menu]",
"subtasks": [
{
"name": "Count all files in a folder recursively",
"cmdText": "find <folder> -type f -printf \"\\n\" | wc -l",
"keywords": "depth",
"numParams": 1
},
{
"name": "Count all files in a folder, non-recursively",
"cmdText": "find <folder> -maxdepth 1 -type f -printf \"\\n\" | wc -l",
"keywords": "depth",
"numParams": 1
}
]
},
{
"name": "apt [menu]",
"subtasks": [
{
"name": "Show version of installed apt package",
"cmdText": "apt list <pkg_name>",
"keywords": "see display get info print echo current",
"numParams": 1
},
{
"name": "See apt package version before installing",
"cmdText": "apt-cache policy <pkg>",
"keywords": "number check view",
"numParams": 1
},
{
"name": "Install dependencies after running dpkg -i",
"cmdText": "sudo apt-get install -f",
"keywords": "deb",
"numParams": 0
}
]
},
{
"name": "dpkg [menu]",
"subtasks": [
{
"name": "Test if a package is installed",
"cmdText": "dpkg -l | grep <package_name>",
"keywords": "query exists present",
"numParams": 1
},
{
"name": "Show where a package was installed to",
"cmdText": "dpkg -L <package>",
"keywords": "files locations",
"numParams": 1
},
{
"name": "Find the package that installed a file",
"cmdText": "dpkg -S <filename_pattern>",
"keywords": "search",
"numParams": 1
},
{
"name": "Uninstall .deb package",
"cmdText": "sudo dpkg -r <package>",
"keywords": "remove file",
"numParams": 1
},
{
"name": "Install .deb file",
"cmdText": "sudo dpkg -i <file>.deb",
"numParams": 1
}
]
},
{
"name": "Python virtual environments [menu]",
"subtasks": [
{
"name": "Deactivate python virtual environment",
"cmdText": "deactivate",
"keywords": "unload end exit virtualenv",
"numParams": 0
},
{
"name": "Activate python virtual environment",
"cmdText": "source <venv_dir>/bin/activate",
"keywords": "load work on workon enter virtualenv",
"numParams": 1
},
{
"name": "Create python virtual environment",
"cmdText": "<python> -m venv <venv_dir>",
"keywords": "virtualenv mkvirtualenv",
"numParams": 2
}
]
},
{
"name": "Networking [menu]",
"subtasks": [
{
"name": "Get public IP address",
"cmdText": "curl -s ipinfo.io/ip",
"keywords": "see display",
"numParams": 0
},
{
"name": "Get main local IP address",
"cmdText": "ip route get 8.8.8.8 | head -1 | cut -d' ' -f7",
"keywords": "see display private ip",
"numParams": 0
},
{
"name": "Ping finitely many times",
"cmdText": "ping -c <count> <destination>",
"keywords": "certain given",
"numParams": 2
},
{
"name": "Scan range of IP addresses for alive hosts and services",
"cmdText": "nmap <ip_range>",
"keywords": "network net nmap",
"numParams": 1
},
{
"name": "Port scan",
"cmdText": "nmap <host>",
"keywords": "network net nmap",
"numParams": 1
},
{
"name": "Show network interfaces",
"cmdText": "ip link",
"keywords": "network net display get list",
"numParams": 0
},
{
"name": "Clear wondershaper bandwidth limit on network interface",
"cmdText": "sudo wondershaper clear <interface>",
"keywords": "throttle",
"numParams": 1
},
{
"name": "Put bandwidth limit on network interface",
"cmdText": "sudo wondershaper <interface> <down_in_kbps> <up_in_kbps>",
"keywords": "throttle traffic shaper data",
"numParams": 3
}
]
},
{
"name": "Get file encoding",
"cmdText": "file -i <file>",
"keywords": "view see display",
"numParams": 1
},
{
"name": "Serve Jekyll site including drafts",
"cmdText": "jekyll serve --drafts --watch",
"keywords": "blog web hot reload live",
"numParams": 0
},
{
"name": "Go to Android device storage directory",
"cmdText": "cd /run/user/1000/gvfs",
"keywords": "usb phone mount folder location path dir",
"numParams": 0
},
{
"name": "Unpack compressed file",
"cmdText": "unp <file>",
"keywords": "archive archived unzip zip tar gzip",
"numParams": 1
},
{
"name": "Merge folders",
"cmdText": "rsync -avh --progress <src_dir> <dest_dir>",
"numParams": 2
},
{
"name": "Copy file and see progress",
"cmdText": "rsync --info=progress2 <src_file> <dest_file>",
"keywords": "rsync speed",
"numParams": 2
},
{
"name": "Make folder and any nonexisting parents",
"cmdText": "mkdir -p <folder>",
"keywords": "recursive create directory all containing dir",
"numParams": 1
},
{
"name": "Show folder size",
"cmdText": "du -sh <folder>",
"keywords": "see display get directory dir",
"numParams": 1
},
{
"name": "Show file size",
"cmdText": "ls -lh <file>",
"keywords": "see display get",
"numParams": 1
},
{
"name": "Add event to Google Calendar",
"cmdText": "gcalcli add",
"keywords": "gcal gcalcli gcq",
"numParams": 0
},
{
"name": "Remove first line from file",
"cmdText": "sed -i '1d' <file>",
"keywords": "sed strip delete tail",
"numParams": 1
},
{
"name": "See free storage space",
"cmdText": "df -h --total",
"keywords": "view get hdd hard drive gb available used",
"numParams": 0
},
{
"name": "Strip special characters from a filename",
"cmdText": "rename 's/[^a-zA-Z0-9_.]/_/g' <file>",
"keywords": "remove ascii replace",
"numParams": 1
},
{
"name": "Extract range of pages from PDF",
"cmdText": "pdftk in.pdf cat <start_page>-<end_page> output out.pdf",
"keywords": "cut splice split",
"numParams": 2
},
{
"name": "Convert image to grayscale",
"cmdText": "convert <source_file> -colorspace Gray <dest_file>",
"numParams": 2
},
{
"name": "Edit my crontab",
"keywords": "personal",
"cmdText": "crontab -e",
"numParams": 0
},
{
"name": "See TeX version, including distribution",
"keywords": "get show latex",
"cmdText": "tex --version",
"numParams": 0
},
{
"name": "See what shell I'm using",
"keywords": "get show current name running",
"cmdText": "echo $SHELL",
"numParams": 0
},
{
"name": "Get Ubuntu distribution version",
"keywords": "see show display",
"cmdText": "lsb_release -a",
"numParams": 0
},
{
"name": "Get Linux kernel version",
"keywords": "see show display",
"cmdText": "uname -r",
"numParams": 0
},
{
"name": "End process",
"cmdText": "killall -9 <proc_name>",
"keywords": "kill terminate",
"numParams": 1
},
{
"name": "Copy ssh public key to server",
"cmdText": "ssh-copy-id <user>@<host>",
"numParams": 2
},
{
"name": "Find file by name across filesystem",
"cmdText": "locate -q <pattern>",
"keywords": "search locate",
"numParams": 1
},
{
"name": "Cancel all of my print jobs",
"cmdText": "lprm -",
"keywords": "printer kill terminate",
"numParams": 0
},
{
"name": "Create symbolic link",
"cmdText": "ln -sf <src_absolute_path> <link_absolute_path>",
"keywords": "make new update change add symlink",
"numParams": 2
},
{
"name": "See target of symbolic link",
"cmdText": "readlink -f <link>",
"keywords": "get show symlink",
"numParams": 1
},
{
"name": "Exit shell but leave subprocesses running",
"cmdText": "disown -a && exit",
"keywords": "keep background close preserve",
"numParams": 0
},
{
"name": "Mount temporary RAM partition",
"cmdText": "mount -t tmpfs tmpfs /mnt -o size=<num_mb>m",
"keywords": "storage memory",
"numParams": 1
},
{
"name": "See total, used, and available RAM",
"cmdText": "free -m",
"keywords": "get show memory free",
"numParams": 0
},
{
"name": "Launch HTTP file server here",
"cmdText": "python3 -m http.server --bind 127.0.0.1 8000",
"keywords": "web start serve static listen",
"numParams": 0
},
{
"name": "Get BTC price",
"cmdText": "echo \"$(curl -s https://api.coindesk.com/v1/bpi/currentprice/usd.json | grep -o 'rate\":\"[^\"]*' | cut -d\\\" -f3)\"",
"keywords": "bitcoin bitcoins usd conversion rate",
"numParams": 0
},
{
"name": "Quick weather",
"cmdText": "curl wttr.in",
"keywords": "forecast",
"numParams": 0
},
{
"name": "Get current username",
"cmdText": "echo \"$USER\"",
"keywords": "see show",
"numParams": 0
},
{
"name": "Get number of CPU cores",
"cmdText": "python3 -c 'import psutil; print(psutil.cpu_count(logical=False))'",
"keywords": "see show physical",
"numParams": 0
}
]