-
Notifications
You must be signed in to change notification settings - Fork 229
/
index.html
2087 lines (1796 loc) · 263 KB
/
index.html
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
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="ocks-org do-not-copy">
<head>
<meta charset="utf-8">
<title>Comprehensive Linux Cheatsheet</title>
<link rel="icon" href="web/favicon.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Comprehensive Linux Cheatsheet">
<meta name="twitter:description" content="Exhaustive, beautiful and concise. Cheat sheet about Linux command line tools and configuration files.">
<meta name="twitter:image" content="https://gto76.github.io/linux-cheatsheet/web/image_twitter_card.jpg">
</head>
<style>
@import url(web/style.css);
.join,
.link,
.node rect {
fill: none;
stroke: #636363;
stroke-width: 1.5px;
}
.link {
stroke: #969696;
}
.node rect {
fill: white;
}
.link path,
.node rect,
.node text,
.join {
-webkit-transition: stroke-opacity 500ms linear, fill-opacity 500ms linear;
-moz-transition: stroke-opacity 500ms linear, fill-opacity 500ms linear;
-ms-transition: stroke-opacity 500ms linear, fill-opacity 500ms linear;
-o-transition: stroke-opacity 500ms linear, fill-opacity 500ms linear;
transition: stroke-opacity 500ms linear, fill-opacity 500ms linear;
}
.node .element rect {
fill: #bdbdbd;
stroke: none;
}
.node .null rect {
fill: none;
stroke: none;
}
.node .null text {
fill: #636363;
}
.node .selection rect {
stroke: #e6550d;
}
.node .data rect {
stroke: #3182bd;
}
.node .datum rect {
fill: #d9d9d9;
stroke: none;
}
.node .code text {
font-family: monospace;
}
.node .key rect {
fill: #a1d99b;
stroke: none;
}
.link .to-key,
.join {
stroke: #a1d99b;
}
.join {
stroke-dasharray: 2,2;
}
.link .to-null {
stroke-dasharray: .5,3.5;
stroke-linecap: round;
}
.link .from-data {
stroke: #3182bd;
}
.play circle {
fill: #fff;
stroke: #000;
stroke-width: 3px;
}
.play:hover path {
fill: #f00;
}
.play.mousedown circle {
fill: #f00;
}
.play.mousedown path {
fill: #fff;
}
.play rect {
fill: none;
pointer-events: all;
cursor: pointer;
}
code span {
-webkit-transition: background 250ms linear;
-moz-transition: background 250ms linear;
-ms-transition: background 250ms linear;
-o-transition: background 250ms linear;
transition: background 250ms linear;
}
pre.prettyprint, code.prettyprint {
background-color: #222;
border-radius: 8px;
font-size: 15px;
}
pre.prettyprint {
width: 90%;
margin: 0.5em;
padding: 1em;
white-space: pre-wrap;
}
</style>
<!-- td {
padding: 3px;
} -->
<body>
<header>
<aside>January 30, 2019</aside>
<a href="../" rel="author">Jure Šorn</a>
</header>
<div>
<h1>Comprehensive Linux Cheatsheet</h1>
<p>
<sup><a href="https://raw.githubusercontent.com/gto76/linux-cheatsheet/master/linux-cheatsheet.txt">Download text file</a>
or <a href="https://github.com/gto76/linux-cheatsheet">Fork me on GitHub</a>.
</sup>
</p>
<p>
<img src="web/penguins.jpg" alt="Penguin Colony">
</p>
<h5>Gnome</h5>
<br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt T</code></strong></td><td style="padding-top: 1px" valign="top">Terminal</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt F</code></strong></td><td style="padding-top: 1px" valign="top">Firefox</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt H</code></strong></td><td style="padding-top: 1px" valign="top">Home</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt G</code></strong></td><td style="padding-top: 1px" valign="top">Gedit</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt F12</code></strong></td><td style="padding-top: 1px" valign="top">Run command</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt F1</code></strong></td><td style="padding-top: 1px" valign="top">Minimize window</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt F2</code></strong></td><td style="padding-top: 1px" valign="top">Toggle maximize window</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt F3</code></strong></td><td style="padding-top: 1px" valign="top">Toggle full screen</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt D</code></strong></td><td style="padding-top: 1px" valign="top">Minimize all windows</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt F1-F6</code></strong></td><td style="padding-top: 1px" valign="top">Terminals (tty-s)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt F7-F12</code></strong></td><td style="padding-top: 1px" valign="top">Xwindows</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt Bksp</code></strong></td><td style="padding-top: 1px" valign="top">Restart X</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt Del</code></strong></td><td style="padding-top: 1px" valign="top">Log out</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt End</code></strong></td><td style="padding-top: 1px" valign="top">Shutdown</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Super PgUp/PgDn</code></strong></td><td style="padding-top: 1px" valign="top">Switch workspace</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Middle mouse button</code></strong></td><td style="padding-top: 1px" valign="top">Paste selected text</td></tr>
</tbody></table><br>
<h3>Nautilus/Nemo</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl L</code></strong></td><td style="padding-top: 1px" valign="top">Location, show path</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift N</code></strong></td><td style="padding-top: 1px" valign="top">New folder</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl H</code></strong></td><td style="padding-top: 1px" valign="top">Show hidden files</td></tr>
</tbody></table><br>
<h3>Gedit</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl G</code></strong></td><td style="padding-top: 1px" valign="top">Find next</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift G</code></strong></td><td style="padding-top: 1px" valign="top">Find previous</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift K</code></strong></td><td style="padding-top: 1px" valign="top">Clear highlights</td></tr>
</tbody></table><br>
<h3>Terminal</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift C</code></strong></td><td style="padding-top: 1px" valign="top">Copy</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift V</code></strong></td><td style="padding-top: 1px" valign="top">Paste</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift T</code></strong></td><td style="padding-top: 1px" valign="top">New tab <br></td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Shift W</code></strong></td><td style="padding-top: 1px" valign="top">Close tab <br></td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl PgUp/PgDn</code></strong></td><td style="padding-top: 1px" valign="top">Switch tab</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl +/-</code></strong></td><td style="padding-top: 1px" valign="top">Zoom</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl D</code></strong></td><td style="padding-top: 1px" valign="top">Close terminal</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl S</code></strong></td><td style="padding-top: 1px" valign="top">Scroll lock</td></tr>
</tbody></table><br>
<h3>Bash</h3>
<p>Keys when in emacs mode. You can switch to '<code>vi</code>' mode with '<code>set -o vi</code>' command.</p>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl C</code></strong></td><td style="padding-top: 1px" valign="top">Interrupt, erase line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl A</code></strong></td><td style="padding-top: 1px" valign="top">Go to beginning of line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl E</code></strong></td><td style="padding-top: 1px" valign="top">End of line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl U</code></strong></td><td style="padding-top: 1px" valign="top">Copy line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl Y</code></strong></td><td style="padding-top: 1px" valign="top">Paste line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt .</code></strong></td><td style="padding-top: 1px" valign="top">Last argument</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl R</code></strong></td><td style="padding-top: 1px" valign="top">Search trough history</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Alt *</code></strong></td><td style="padding-top: 1px" valign="top">Show all matches for regular expression</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl+Alt E</code></strong></td><td style="padding-top: 1px" valign="top">Show current line passed through alias, history and shell expansion</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl X, Ctrl E</code></strong></td><td style="padding-top: 1px" valign="top">Edit command in editor</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl P</code></strong></td><td style="padding-top: 1px" valign="top">Show last command (same as up arrow)</td></tr>
</tbody></table><br>
<p><br><p>
<h5>Awesome Terminal Commands</h5>
<h2>Packages<a href="#packages" name="packages">#</a></h2>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>dpkg</code></strong></td><td style="padding-top: 7px" valign="top">Low level package manager for Debian.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-l</code></strong></td><td style="padding-top:0px" valign="top">Lists installed packages.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i <package> (sudo)</code></strong></td><td style="padding-top:0px" valign="top">Installs package from a package file.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>apt-get</code></strong></td><td style="padding-top: 7px" valign="top">Advanced Package Tool built on top of '<code>dpkg</code>'. New command called simply '<code>apt</code>' is also available. It merges the functionalities of '<code>apt-get</code>' and '<code>apt-cache</code>'.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>update</code></strong></td><td style="padding-top:0px" valign="top">Updates local list of existing packages.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u dist-upgrade</code></strong></td><td style="padding-top:0px" valign="top">Upgrades by intelligently handling changing dependencies with new versions of packages. To regularly update put this line in '<code>crontab</code>':<br> '<code>apt-get update && apt-get -u dist-upgrade</code>'.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>upgrade</code></strong></td><td style="padding-top:0px" valign="top">Same as dist-upgrade, but will not remove installed packages or install new ones.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>install <package></code></strong></td><td style="padding-top:0px" valign="top">Also updates single package.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>remove <package></code></strong></td><td style="padding-top:0px" valign="top">Removes package but leaves its configurations.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>remove apt-listchanges</code></strong></td><td style="padding-top:0px" valign="top">Useful when Debian can't find a package.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>purge <package></code></strong></td><td style="padding-top:0px" valign="top">Removes package and its configurations. Run '<code>apt-get autoremove</code>' after to remove all dependencies that are not needed anymore.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>autoremove</code></strong></td><td style="padding-top:0px" valign="top">Removes unneeded packages.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>source <package></code></strong></td><td style="padding-top:0px" valign="top">Downloads code.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>build-dep <package></code></strong></td><td style="padding-top:0px" valign="top">Installs the build dependencies.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--yes</code></strong></td><td style="padding-top:0px" valign="top">Answers with 'yes' to most questions (Except the ones that can have potentially harmful consequences).</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--force-yes</code></strong></td><td style="padding-top:0px" valign="top">Answers 'yes' to all questions (Not recommended).</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>apt-cache</code></strong></td><td style="padding-top: 7px" valign="top">Queries the APT's internal database.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>search <keyword></code></strong></td><td style="padding-top:0px" valign="top">Searches packages like '<code>apropos</code>', but globally.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>show <package></code></strong></td><td style="padding-top:0px" valign="top">Shows package info like version, dependencies, etc.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>showpkg <package></code></strong></td><td style="padding-top:0px" valign="top">Similar, but also shows the packages that depend on the searched package (reverse dependencies).</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>policy <package></code></strong></td><td style="padding-top:0px" valign="top">Shows installed and remote version.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>apt-file</code></strong></td><td style="padding-top: 7px" valign="top">APT package searching utility.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>search <file></code></strong></td><td style="padding-top:0px" valign="top">Search in which package a file is included.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>update</code></strong></td><td style="padding-top:0px" valign="top">Updates local list of package contents.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>aptitude</code></strong></td><td style="padding-top: 7px" valign="top">Enables package browsing (skin for apt-get).</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>search '~i!~M'</code></strong></td><td style="padding-top:0px" valign="top">Lists installed packages that were not installed as a dependency, with short description of each.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>search <package></code></strong></td><td style="padding-top:0px" valign="top">Package search.</td></tr>
</table> </td> </tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>winetricks</code></strong></td><td style="padding-top: 1px" valign="top">Installs wine applications.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>update-alternatives</code></strong></td><td style="padding-top: 1px" valign="top">Maintains symbolic links determining default commands.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>unattended-upgrade</code></strong></td><td style="padding-top: 1px" valign="top">Automatic installation of security upgrades.</td></tr>
</tbody></table><br>
<h3>Commands</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>apropos <cmd></code></strong></td><td style="padding-top: 7px" valign="top">Searches the manual page names and descriptions (use quotes for phrases).</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-a</code></strong></td><td style="padding-top:0px" valign="top">Matches all keywords.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>whatis <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Displays one-line manual page description.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>whereis <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Locates the binary, source, and manual page files for a command.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>which <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Locates only the binary of a command.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>wtf</code></strong></td><td style="padding-top: 1px" valign="top">Translates acronyms and filename suffixes.</td></tr>
</tbody></table><br>
<h3>Install Mantra</h3>
<pre><code>./configure --help
./configure
make
sudo make install</code></pre>
<h2>General<a href="#general" name="general">#</a></h2>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>su</code></strong></td><td style="padding-top: 7px" valign="top">Switches user.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>- <user></code></strong></td><td style="padding-top:0px" valign="top">Switches to user.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-</code></strong></td><td style="padding-top:0px" valign="top">Switches to root.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>man</code></strong></td><td style="padding-top: 7px" valign="top">Help on commands.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><section></code></strong></td><td style="padding-top:0px" valign="top">Section numbers: 1. Programs, 2. System calls, 3. Library calls, 4. Special files, 5. File formats, 7. Miscellaneous, 8. System administration commands</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>echo</code></strong></td><td style="padding-top: 7px" valign="top">Prints passed text.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n</code></strong></td><td style="padding-top:0px" valign="top">Does not add newline at the end.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-e</code></strong></td><td style="padding-top:0px" valign="top">Enables interpretation of backslashed letters.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>xargs <cmd></code></strong></td><td style="padding-top: 7px" valign="top">Passes output from one command to arguments of another:<br> '<code>echo -a | xargs ls</code>'</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-t</code></strong></td><td style="padding-top:0px" valign="top">Echoes the command before executing it.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-p</code></strong></td><td style="padding-top:0px" valign="top">Echoes command and asks for confirmation before execution.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-0</code></strong></td><td style="padding-top:0px" valign="top">Input items are separated by null character instead of space.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>tee <file></code></strong></td><td style="padding-top: 7px" valign="top">Sends output of a program to specified file and to standard output:<br> '<code><cmd_1> | tee out_1.txt | <cmd_2></code>'</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>/dev/tty</code></strong></td><td style="padding-top:0px" valign="top">Sends output to terminal and to standard output</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>expr</code></strong></td><td style="padding-top: 7px" valign="top">Evaluates passed expression.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>1 + 1</code></strong></td><td style="padding-top:0px" valign="top">Prints '<code>2</code>'.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>bc</code></strong></td><td style="padding-top: 7px" valign="top">Evaluates input. It's basically a calculator, but also provides some control commands.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>echo 1 + 1 | bc</code></strong></td><td style="padding-top:0px" valign="top">Prints '<code>2</code>'.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>echo "scale=5;3/4" | bc</code></strong></td><td style="padding-top:0px" valign="top">Prints '<code>.75000</code>'.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>sh</code></strong></td><td style="padding-top: 7px" valign="top">Runs command interpreter (shell). Can run a script even if not executable.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c '<commands>'</code></strong></td><td style="padding-top:0px" valign="top">Starts new non-interactive shell and reads commands from arguments instead of '<code>stdin</code>'.<br> To append lines to system configuration file run:<br> '<code>sudo sh -c 'echo "<text>" >> <file>'</code>'</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>bash</code></strong></td><td style="padding-top: 7px" valign="top">Runs bash command interpreter (shell).</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c</code></strong></td><td style="padding-top:0px" valign="top">Reads commands from arguments instead of '<code>stdin</code>'.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n <script></code></strong></td><td style="padding-top:0px" valign="top">Checks script for errors.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-x</code></strong></td><td style="padding-top:0px" valign="top">Prints commands before execution. Useful for debugging.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>gcc</code></strong></td><td style="padding-top: 7px" valign="top">Gnu C compiler. Run '<code>g++</code>' for C++ code.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-w</code></strong></td><td style="padding-top:0px" valign="top">Supresses warnings (Only prints errors).</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-Wall</code></strong></td><td style="padding-top:0px" valign="top">All warnings.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-g</code></strong></td><td style="padding-top:0px" valign="top">Compile for debugging.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-std=<std></code></strong></td><td style="padding-top:0px" valign="top">Sets the standard. Suported standards for C are:<br> '<code>c90</code>', '<code>gnu90</code>', '<code>c99</code>', '<code>gnu99</code>', '<code>c11</code>' and '<code>gnu11</code>'.<br> Suported standarts for C++ are:<br> '<code>c++98</code>', '<code>gnu++98</code>', '<code>c++11</code>' and '<code>gnu++11</code>'.<br> '<code>gnu90</code>' and '<code>gnu++98</code>' are the default options.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-O<level></code></strong></td><td style="padding-top:0px" valign="top">Optimization level. '<code>0</code>': Reduce compilation time (default), '<code>1-3</code>': - Level of optimization, '<code>s</code>' - Optimize for size, '<code>g</code>' - Optimize debugging experience.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>run-parts <dir></code></strong></td><td style="padding-top: 1px" valign="top">Runs all scripts or programs in a directory.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>date</code></strong></td><td style="padding-top: 7px" valign="top">Tells and sets date and time.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-s <string></code></strong></td><td style="padding-top:0px" valign="top">Sets date.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>+%T -s "10:13:13"</code></strong></td><td style="padding-top:0px" valign="top">Sets time.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>timedatectl</code></strong></td><td style="padding-top: 7px" valign="top">Controls the system time and date.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>set-timezone CET</code></strong></td><td style="padding-top:0px" valign="top">Sets timezone.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>cal</code></strong></td><td style="padding-top: 1px" valign="top">Calendar</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>xclip</code></strong></td><td style="padding-top: 1px" valign="top">Copies to clipboard.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mkfifo <pipe></code></strong></td><td style="padding-top: 1px" valign="top">Creates named pipe during that shell session.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mkisofs</code></strong></td><td style="padding-top: 1px" valign="top">Creates a DVD/CD image.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>genisoimage</code></strong></td><td style="padding-top: 1px" valign="top">Creates a DVD/CD image (Debian).</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>cdrecord</code></strong></td><td style="padding-top: 1px" valign="top">Writes to a CD/DVD.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>acpi</code></strong></td><td style="padding-top: 1px" valign="top">Checks battery.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>fdisk -l (sudo)</code></strong></td><td style="padding-top: 1px" valign="top">Shows partitions.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>shutdown</code></strong></td><td style="padding-top: 7px" valign="top">Closes down the system at a given time.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>now</code></strong></td><td style="padding-top:0px" valign="top">Takes you to the single user mode.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-h now</code></strong></td><td style="padding-top:0px" valign="top">Begins the shutdown procedure, same as '<code>halt</code>' and '<code>poweroff</code>'.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-h 11:50</code></strong></td><td style="padding-top:0px" valign="top">At 11:50.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r now</code></strong></td><td style="padding-top:0px" valign="top">Same as '<code>reboot</code>'.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>make</code></strong></td><td style="padding-top: 7px" valign="top">Utility that maintains groups of programs.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-q</code></strong></td><td style="padding-top:0px" valign="top">Doesn't run any commands, just returns '<code>0</code>' exit code if everything is up to date or non-zero otherwise.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-B</code></strong></td><td style="padding-top:0px" valign="top">Unconditionally makes all targets.</td></tr>
</table> </td> </tr>
</tbody></table><br>
<h3>Files</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ls</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-d</code></strong></td><td style="padding-top:7px" valign="top">List directory names instead of contents</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-S</code></strong></td><td style="padding-top:0px" valign="top">Sort by size</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-t</code></strong></td><td style="padding-top:0px" valign="top">Sort by time</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-1</code></strong></td><td style="padding-top:0px" valign="top">One file per line</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>./*</code></strong></td><td style="padding-top:0px" valign="top">Ls one level deep</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Get inode number of file (file id). Use '<code>sudo find / -inum <number></code>' to find all links that point to same file.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>cp</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:7px" valign="top">Interactive (Prompts before overwrite)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-v</code></strong></td><td style="padding-top:0px" valign="top">Verbose (Explains what is being done)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-R</code></strong></td><td style="padding-top:0px" valign="top">Copy directories recursively</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-p</code></strong></td><td style="padding-top:0px" valign="top">Preserve mode, ownership and timestamps</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--preserve=all</code></strong></td><td style="padding-top:0px" valign="top">Also preserves context, links and xattr</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>rm</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:7px" valign="top">Interactive (Prompts before every removal)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-v</code></strong></td><td style="padding-top:0px" valign="top">Verbose (Explains what is being done)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-f</code></strong></td><td style="padding-top:0px" valign="top">Force remove (Does not prompt, useful if '<code>rm</code>' is aliased with '<code>-i</code>')</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-R</code></strong></td><td style="padding-top:0px" valign="top">Removes directories and their content recursively</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mkdir</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>-p</code></strong></td><td style="padding-top:1px" valign="top">Make parents if needed</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ln</code></strong></td><td style="padding-top: 7px" valign="top">Makes links to the files</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-s <file> <link></code></strong></td><td style="padding-top:0px" valign="top">Makes symbolic link. If you want to use relative paths you must be in links directory !!!!!!!!!!!!!!!!!!!!!!</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>df</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>-h</code></strong></td><td style="padding-top:1px" valign="top">Displays humanly readable free disk space</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>du</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>-s <dir></code></strong></td><td style="padding-top:1px" valign="top">Directory size</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>mc</code></strong></td><td style="padding-top: 7px" valign="top">Midnight commander</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>Alt o</code></strong></td><td style="padding-top:0px" valign="top">Open parent dir in another panel</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>Ctrl o</code></strong></td><td style="padding-top:0px" valign="top">Switch to bash</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>find <dir></code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-name <file></code></strong></td><td style="padding-top:7px" valign="top">Search by name</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-regex <regex></code></strong></td><td style="padding-top:0px" valign="top">Use regex for name search</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-not</code></strong></td><td style="padding-top:0px" valign="top">Insert before other options to negate</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-maxdepth <levels></code></strong></td><td style="padding-top:0px" valign="top">Descend only to levels deep</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-samefile <file></code></strong></td><td style="padding-top:0px" valign="top">Find all hard links of a file</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-xdev</code></strong></td><td style="padding-top:0px" valign="top">Don't descend directories on other filesystems</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-inum <inum></code></strong></td><td style="padding-top:0px" valign="top">Find files with the inode number</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-type <f|d|b|...></code></strong></td><td style="padding-top:0px" valign="top">Find files of type</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-delete</code></strong></td><td style="padding-top:0px" valign="top">Delete found files</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-exec <cmd> {} \;</code></strong></td><td style="padding-top:0px" valign="top">Find files and execute command for every found file. '<code>{}</code>' is replaced with filename</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-exec <cmd> {} +</code></strong></td><td style="padding-top:0px" valign="top">Find files and execute command with all filenames in place of '<code>{}</code>'</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-atime +/-n</code></strong></td><td style="padding-top:0px" valign="top">Find files that were last accessed less or more than n days.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-print0 | xargs -0 <cmd></code></strong></td><td style="padding-top:0px" valign="top">Sends found files to a command as parameters. Uses '<code>NUL</code>' character as separator, necessary for filenames with spaces</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>locate <regex></code></strong></td><td style="padding-top: 7px" valign="top">Similar as '<code>find</code>' but using index</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Ignore case</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--regex</code></strong></td><td style="padding-top:0px" valign="top">Interprets all patterns as extended regex</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-0 | xargs -0 <cmd></code></strong></td><td style="padding-top:0px" valign="top">Sends found files to a command as parameters.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>updatedb (sudo)</code></strong></td><td style="padding-top: 1px" valign="top">Update locate index</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>md5sum</code></strong></td><td style="padding-top: 1px" valign="top">Prints md5 sum hash of a file</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>read</code></strong></td><td style="padding-top: 7px" valign="top">Read single line from standard input</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n 1</code></strong></td><td style="padding-top:0px" valign="top">Print after reading one character</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-s</code></strong></td><td style="padding-top:0px" valign="top">Do not echo input coming from terminal</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>shred</code></strong></td><td style="padding-top: 1px" valign="top">Securely remove files</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>file</code></strong></td><td style="padding-top: 1px" valign="top">Determine file's type</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>tree</code></strong></td><td style="padding-top: 1px" valign="top">Ls in a tree-like (hierarchical) format</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>install</code></strong></td><td style="padding-top: 1px" valign="top">Copy files and set attributes</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>gpg</code></strong></td><td style="padding-top: 7px" valign="top">Decrypt file with password</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c</code></strong></td><td style="padding-top:0px" valign="top">Encrypt</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mktemp</code></strong></td><td style="padding-top: 1px" valign="top">Create a temporary file or directory in '<code>/tmp</code>' and returns it's name.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>rename</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>s/<from>/<to> <files></code></strong></td><td style="padding-top:1px" valign="top">Renames multiple files using '<code>sed</code>' syntax</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>rsync</code></strong></td><td style="padding-top: 7px" valign="top">A fast, versatile, remote (and local) file-copying tool</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-Hbaz -e ssh</code></strong></td><td style="padding-top:0px" valign="top">'<code><src_dir> <user>@<host>:<dest_dir></code>' - Backs up the 'src-dir': '<code>-H</code>' preserves hard links, '<code>-b</code>' renames preexisting destination files (back up), '<code>-a</code>' preserve everything except hard links and '<code>-z</code>' compresses.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>cmp</code></strong></td><td style="padding-top:0px" valign="top">Compares two files, similar to diff but also for binaries</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>stat</code></strong></td><td style="padding-top: 7px" valign="top">Displays files status</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c%X</code></strong></td><td style="padding-top:0px" valign="top">Time of last modification of the file</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>readlink</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>-f</code></strong></td><td style="padding-top:1px" valign="top">Follow link recursively and print files path</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>xdg-open</code></strong></td><td style="padding-top: 1px" valign="top">Open file with default application for the file type</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>dialog</code></strong></td><td style="padding-top: 1px" valign="top">Display dialog box from shell script</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>watch</code></strong></td><td style="padding-top: 1px" valign="top">Execute command periodically</td></tr>
</tbody></table><br>
<h3>Archives</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>dtrx</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code><archive></code></strong></td><td style="padding-top:1px" valign="top">Universal archive extractor</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>tar</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>xvzf <file>.tar.gz (.tgz)</code></strong></td><td style="padding-top:7px" valign="top">Decompress and detar</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>xvjf <file>.tar.bz2</code></strong></td><td style="padding-top:0px" valign="top">Decompress and detar</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-cf <archive>.tar <files></code></strong></td><td style="padding-top:0px" valign="top">Compress</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>unzip</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>\*.zip</code></strong></td><td style="padding-top:7px" valign="top">Backslash is necessary so that bash doesn't expand the '<code>*</code>'</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d <dir></code></strong></td><td style="padding-top:0px" valign="top">Extract into directory (create if doesn't exist)</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>zip</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-r <archive> <dir></code></strong></td><td style="padding-top:7px" valign="top">Compress whole directory recursively.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-g <archive> <files></code></strong></td><td style="padding-top:0px" valign="top">Add files to existing archive (grow).</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>unrar</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>e</code></strong></td><td style="padding-top:1px" valign="top">Extract files from rar archive</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>zcat</code></strong></td><td style="padding-top: 1px" valign="top">Cats gziped file</td></tr>
</tbody></table><br>
<h3>Terminal Multiplexers</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>screen</code></strong></td><td style="padding-top: 7px" valign="top">Switch between multiple virtual terminals (useful in ssh). Prefix for a command is '<code>Ctrl a</code>'.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>c</code></strong></td><td style="padding-top:0px" valign="top">New terminal,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>n</code></strong></td><td style="padding-top:0px" valign="top">Next,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>p</code></strong></td><td style="padding-top:0px" valign="top">Previous,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>a</code></strong></td><td style="padding-top:0px" valign="top">Go to beginning of line,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>|</code></strong></td><td style="padding-top:0px" valign="top">New region vertically,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>S</code></strong></td><td style="padding-top:0px" valign="top">New region horizontally,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>tab</code></strong></td><td style="padding-top:0px" valign="top">Move to next region,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>Q</code></strong></td><td style="padding-top:0px" valign="top">Close all but selected region,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>X</code></strong></td><td style="padding-top:0px" valign="top">Kill the current region,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>esc</code></strong></td><td style="padding-top:0px" valign="top">Enter copy/scrollback mode -> space: start/stop marking,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>]</code></strong></td><td style="padding-top:0px" valign="top">Paste,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>k</code></strong></td><td style="padding-top:0px" valign="top">Kill window,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>t</code></strong></td><td style="padding-top:0px" valign="top">Show time and avg CPU load</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>tmux</code></strong></td><td style="padding-top: 7px" valign="top">Terminal multiplexer, better screen. Prefix for a command is '<code>Ctrl b</code>'. Most commands are the same as in '<code>screen</code>'.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>ls</code></strong></td><td style="padding-top:0px" valign="top">Shows running sessions</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>attach [-t <no>]</code></strong></td><td style="padding-top:0px" valign="top">Attach to running session</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>d</code></strong></td><td style="padding-top:0px" valign="top">Detach from currently attached session<br></td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>pgup</code></strong></td><td style="padding-top:0px" valign="top">Enter in copy mode and pageup,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>[</code></strong></td><td style="padding-top:0px" valign="top">Copy mode,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>]</code></strong></td><td style="padding-top:0px" valign="top">Paste,<br></td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>"</code></strong></td><td style="padding-top:0px" valign="top">Split horizontally,</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>%</code></strong></td><td style="padding-top:0px" valign="top">Split vertically</td></tr>
</table> </td> </tr>
</tbody></table><br>
<h2>Bash<a href="#bash" name="bash">#</a></h2>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$x"</code></strong></td><td style="padding-top: 1px" valign="top">ALWAYS PUT DOUBLE QUOTES AROUND VARIABLE!!!!!!!!!!!!!!! All variables in bash are global!!!!!!!</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$*"</code></strong></td><td style="padding-top: 1px" valign="top">Combines all the arguments into single word, separating them with first character of IFS variable. If IFS is not set, space is used. If IFS is null, no separator is used!!!!!!!!! No args provided will result in one empty string being passed on!!!</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$@"</code></strong></td><td style="padding-top: 1px" valign="top">Use this instead!!!!! Will retain arguments as-is, so no args provided will result in no args being passed on. This is in most cases what you want to use for passing on arguments. Google: "$@" is right almost everytime, and $* is wrong almost everytime.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$#"</code></strong></td><td style="padding-top: 1px" valign="top">Number of arguments</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$1"</code></strong></td><td style="padding-top: 1px" valign="top">First argument</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>"$0"</code></strong></td><td style="padding-top: 1px" valign="top">Name of the script</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>$'\n'</code></strong></td><td style="padding-top: 1px" valign="top">String literal with escape sequences (there is a backslash before n) If you want IFS to be a new line (useful with for loop) you need to: '<code>IFS=$'\n'</code>' - The dollar forces substitution!!!!! Also if you want 'while read line; do...' to preserve leading spaces and tabs, you need to set IFS=""</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>$?</code></strong></td><td style="padding-top: 1px" valign="top">Exit code of last command (0 - Success)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>Ctrl-Z, kill %%</code></strong></td><td style="padding-top: 1px" valign="top">Kill looping bash script</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>test <expr></code></strong></td><td style="padding-top: 7px" valign="top">Same as '<code>[ <expr> ]</code>'. Returns zero exit status if true.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n</code></strong></td><td style="padding-top:0px" valign="top">Is string non empty</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-z</code></strong></td><td style="padding-top:0px" valign="top">Is string empty</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-a</code></strong></td><td style="padding-top:0px" valign="top">And</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-o</code></strong></td><td style="padding-top:0px" valign="top">Or</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>=</code></strong></td><td style="padding-top:0px" valign="top">Strings are equal</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-nt</code></strong></td><td style="padding-top:0px" valign="top">File newer than</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-ot</code></strong></td><td style="padding-top:0px" valign="top">Older then</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d</code></strong></td><td style="padding-top:0px" valign="top">Directory exists</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-e</code></strong></td><td style="padding-top:0px" valign="top">File exists</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-f</code></strong></td><td style="padding-top:0px" valign="top">Is a regular file</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-h</code></strong></td><td style="padding-top:0px" valign="top">Its a symbolic link</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r</code></strong></td><td style="padding-top:0px" valign="top">Has read permission</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-w</code></strong></td><td style="padding-top:0px" valign="top">Has write permission</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-x</code></strong></td><td style="padding-top:0px" valign="top">Has execute permission</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>[[ <expr> ]]</code></strong></td><td style="padding-top: 1px" valign="top">Same as '<code>[</code>', but without word splitting and filename expansion. And with additional operators: '<code>&&</code>', '<code>||</code>', '<code><</code>', '<code>></code>' (lexicographic less, more), and also regular expression matching.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>=~</code></strong></td><td style="padding-top: 1px" valign="top">Regex comparison operator: '<code>[[ "$HOST" =~ ^user.* ]]</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>let <expr></code></strong></td><td style="padding-top: 1px" valign="top">Executes expression: let a="$b"+2</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>$(command)</code></strong></td><td style="padding-top: 1px" valign="top">Same as '<code>command</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>eval <variable></code></strong></td><td style="padding-top: 1px" valign="top">Execute string as command</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>$RANDOM</code></strong></td><td style="padding-top: 1px" valign="top">0 - 32767</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>input='<code>cat</code>'</code></strong></td><td style="padding-top: 1px" valign="top">Getting standard input</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>-</code></strong></td><td style="padding-top: 1px" valign="top">In place of a file name means standard in or out</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>set -o vi</code></strong></td><td style="padding-top: 1px" valign="top">Set line editing to vi mode</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>pushd .</code></strong></td><td style="padding-top: 1px" valign="top">Put current dir on stack</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>popd</code></strong></td><td style="padding-top: 1px" valign="top">Pop dir from stack</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>cd -</code></strong></td><td style="padding-top: 1px" valign="top">go to last dir</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>source <script></code></strong></td><td style="padding-top: 1px" valign="top">Run script: for example source /etc/profile (same as . <cmd>)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>#!/bin/bash</code></strong></td><td style="padding-top: 1px" valign="top">Good practice to insert at beginning of a bash script</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>export</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>PATH="$PATH:<dir>"</code></strong></td><td style="padding-top:1px" valign="top">Adds new directory to path environment variable.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>read</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>-p <message></code></strong></td><td style="padding-top:1px" valign="top">Prompt for user input</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>var=${1:-"<default>"}</code></strong></td><td style="padding-top: 1px" valign="top">Setting variable with default value if $1 is empty</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>getopts</code></strong></td><td style="padding-top: 1px" valign="top">Parse parameters/arguments, builtin</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>getopt</code></strong></td><td style="padding-top: 1px" valign="top">GNU version is even better then getopts, not a builtin</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>while read line; do <commands>; done < <file></code></strong></td><td style="padding-top: 7px" valign="top">Read from file line by line</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r</code></strong></td><td style="padding-top:0px" valign="top">Do not treat backslashes as escape characters</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>complete -F <completion_function> <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Set completion function for command</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>complete -p <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Print the completion function for command</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>compgen -c <pattern></code></strong></td><td style="padding-top: 1px" valign="top">Print all completions for pattern</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>help <builtin></code></strong></td><td style="padding-top: 1px" valign="top">Display information about builtin command</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>wait</code></strong></td><td style="padding-top: 1px" valign="top">Wait for all background processes to end</td></tr>
</tbody></table><br>
<h3>Safety</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>set</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-e</code></strong></td><td style="padding-top:7px" valign="top">Exit if any command fails</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u</code></strong></td><td style="padding-top:0px" valign="top">Exit if referencing undefined variable</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-o pipefail</code></strong></td><td style="padding-top:0px" valign="top">If any command in a pipeline fails, its return code is used as the return code of the whole pipeline</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>IFS=$'\n\t'</code></strong></td><td style="padding-top: 1px" valign="top">Remove space from the default Internal Field Separator</td></tr>
</tbody></table><br>
<h3>History</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>sudo !!</code></strong></td><td style="padding-top: 1px" valign="top">Run the last command as root</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>␣<cmd></code></strong></td><td style="padding-top: 1px" valign="top">Execute a command without saving it in the history</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>!<cmd></code></strong></td><td style="padding-top: 1px" valign="top">Run last command that starts with cmd</td></tr>
</tbody></table><br>
<h3>Redirections</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code><cmd> 2> /dev/null</code></strong></td><td style="padding-top: 1px" valign="top">Redirect error output to '<code>null</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code><cmd> &> /dev/null</code></strong></td><td style="padding-top: 1px" valign="top">Redirect both standard and error output to '<code>null</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code><cmd> >&2</code></strong></td><td style="padding-top: 1px" valign="top">Write to stderr</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code><cmd> 2>&1 | less</code></strong></td><td style="padding-top: 1px" valign="top">Add stderr to stdout and print it with less (useful for gcc)</td></tr>
</tbody></table><br>
<h3>Arrays And Lines</h3>
<p>Reads line by line from variable. To preserve spaces use '<code>IFS=</code>'.</p>
<pre><code>while IFS= read -r line; do
echo "... $line ..."
done <<< "$list" — </code></pre>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>${a[1]}</code></strong></td><td style="padding-top: 1px" valign="top">Value of the second element of the array</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>for c in ${a[@]}</code></strong></td><td style="padding-top: 1px" valign="top">Iterate over array</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>${varname:offset:length}</code></strong></td><td style="padding-top: 1px" valign="top">Get substring: '<code>s="aeiou"; ${s:3:1} -> o</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>${#var}</code></strong></td><td style="padding-top: 1px" valign="top">Length of a var</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>${#name[subscript]}</code></strong></td><td style="padding-top: 1px" valign="top">Length of the element</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>${#name[@]}</code></strong></td><td style="padding-top: 1px" valign="top">Length of the array</td></tr>
</tbody></table><br>
<h3>Aliases And Functions</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>alias</code></strong></td><td style="padding-top: 7px" valign="top">Print all aliases</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><name></code></strong></td><td style="padding-top:0px" valign="top">Print alias</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><name>='cmd'</code></strong></td><td style="padding-top:0px" valign="top">Set alias</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>command <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Executes original command, bypassing any aliases or shell functions that may be defined for command</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>\<cmd></code></strong></td><td style="padding-top: 1px" valign="top">Temporarily disable alias (call original)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>type <cmd></code></strong></td><td style="padding-top: 1px" valign="top">Will tell you what is command aliased to or if it is a builtin, function or a command -P just check commands</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>declare -F</code></strong></td><td style="padding-top: 1px" valign="top">Print function names</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>declare -f</code></strong></td><td style="padding-top: 1px" valign="top">Print functions</td></tr>
</tbody></table><br>
<h2>Text<a href="#text" name="text">#</a></h2>
<h3>Print</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>head</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-n-<num_of_lines></code></strong></td><td style="padding-top:7px" valign="top">Print all lines but the last n</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c <num_of_chars></code></strong></td><td style="padding-top:0px" valign="top">Print first c characters</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>tail</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-n+<line_num></code></strong></td><td style="padding-top:7px" valign="top">Start at line number</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-f</code></strong></td><td style="padding-top:0px" valign="top">Do not stop printing (follow)</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>cat</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-n</code></strong></td><td style="padding-top:7px" valign="top">Number all lines</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>>> file</code></strong></td><td style="padding-top:0px" valign="top">Simplest text editor (great for pasting)</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>less</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>&<patt></code></strong></td><td style="padding-top:7px" valign="top">Display only lines with pattern</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-N</code></strong></td><td style="padding-top:0px" valign="top">Show line numbers</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-~</code></strong></td><td style="padding-top:0px" valign="top">Do not show '<code>~</code>' after '<code>EOF</code>'</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>+G</code></strong></td><td style="padding-top:0px" valign="top">Tells less to start at the end of the file</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>+F</code></strong></td><td style="padding-top:0px" valign="top">Follow the input (to scroll up first press ctrl+c)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-F</code></strong></td><td style="padding-top:0px" valign="top">Or --quit-if-one-screen</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>v</code></strong></td><td style="padding-top:0px" valign="top">Opens editor defined in '<code>$VISUAL</code>' or '<code>$EDITOR</code>'</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>:n</code></strong></td><td style="padding-top:0px" valign="top">Examine the next file</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><, ></code></strong></td><td style="padding-top:0px" valign="top">Go to home, end</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>wc</code></strong></td><td style="padding-top: 1px" valign="top">Count lines, words and characters</td></tr>
</tbody></table><br>
<h3>Edit</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>sudo -e <file></code></strong></td><td style="padding-top: 1px" valign="top">Edit file as sudo</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>tr <from> <to></code></strong></td><td style="padding-top: 7px" valign="top">Translate characters</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d</code></strong></td><td style="padding-top:0px" valign="top">Delete characters</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>cut <file></code></strong></td><td style="padding-top: 7px" valign="top">Removes columns from each line of files</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d ':' -f 1,7 /etc/passwd</code></strong></td><td style="padding-top:0px" valign="top">Only show the username and the shell</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>sort</code></strong></td><td style="padding-top: 7px" valign="top">Sorts lines</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u</code></strong></td><td style="padding-top:0px" valign="top">Uniq, removes duplicates</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-t</code></strong></td><td style="padding-top:0px" valign="top">Set delimiter for fields (default is space)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-k</code></strong></td><td style="padding-top:0px" valign="top">Select by which field to sort</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>uniq</code></strong></td><td style="padding-top: 7px" valign="top">Removes adjacent duplicates</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d</code></strong></td><td style="padding-top:0px" valign="top">Intersection</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u</code></strong></td><td style="padding-top:0px" valign="top">Difference</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>column</code></strong></td><td style="padding-top: 7px" valign="top">Columnate text</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-t</code></strong></td><td style="padding-top:0px" valign="top">Create a table</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>shuf</code></strong></td><td style="padding-top: 1px" valign="top">Shuffle input lines</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>tac</code></strong></td><td style="padding-top: 1px" valign="top">Concatenate and print files in reverse (reverse '<code>cat</code>')</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>join</code></strong></td><td style="padding-top: 1px" valign="top">Join lines of two files on a common field</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>colrm</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:1px" valign="top"><strong><code>[from [to]]</code></strong></td><td style="padding-top:1px" valign="top">Removes columns</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>seq <number></code></strong></td><td style="padding-top: 1px" valign="top">Output numbers from 1 to number</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>ispell, aspell</code></strong></td><td style="padding-top: 1px" valign="top">Interactive spell checker</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>basename <path></code></strong></td><td style="padding-top: 7px" valign="top">Strips directory from path</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-s .<suffix></code></strong></td><td style="padding-top:0px" valign="top">Also strip suffix</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-a</code></strong></td><td style="padding-top:0px" valign="top">Process multiple filenames</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>dirname <path></code></strong></td><td style="padding-top: 1px" valign="top">Strip last component from path</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>fmt</code></strong></td><td style="padding-top: 1px" valign="top">Produce roughly uniform line lengths</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>fold</code></strong></td><td style="padding-top: 1px" valign="top">Wrap each input line to fit in specified width</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>paste</code></strong></td><td style="padding-top: 1px" valign="top">Glue two documents side by side</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>sed</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>'s///g'</code></strong></td><td style="padding-top:7px" valign="top">Substitute every occurrence in line, not just the first one</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>'s///I'</code></strong></td><td style="padding-top:0px" valign="top">Ignore case</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r</code></strong></td><td style="padding-top:0px" valign="top">Extended syntax, for '<code>+</code>', '<code>?</code>', ... Also you shouldn't escape the parenthesis</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r 's###e'</code></strong></td><td style="padding-top:0px" valign="top">Execute match as a command</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i <file></code></strong></td><td style="padding-top:0px" valign="top">Will make changes directly to the file (in place)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u</code></strong></td><td style="padding-top:0px" valign="top">Unbuffered mode (processes input immediately)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n l</code></strong></td><td style="padding-top:0px" valign="top">Print escape sequence (keycode) of a pressed key</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>expand</code></strong></td><td style="padding-top: 7px" valign="top">Convert tabs to spaces</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-t <number></code></strong></td><td style="padding-top:0px" valign="top">Set number of spaces (default is 8)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Do not convert tabs after non blanks</td></tr>
</table> </td> </tr>
</tbody></table><br>
<h3>Diff</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>diff</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-u <files></code></strong></td><td style="padding-top:7px" valign="top">Unified format</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--brief -r</code></strong></td><td style="padding-top:0px" valign="top">Compare two directory trees</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>colordiff</code></strong></td><td style="padding-top: 1px" valign="top">Version of diff with colors</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>sdiff</code></strong></td><td style="padding-top: 1px" valign="top">Two files side by side</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>comm</code></strong></td><td style="padding-top: 1px" valign="top">Compare two sorted files line by line</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>patch</code></strong></td><td style="padding-top: 7px" valign="top">Apply a diff file to original</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>patch < patch.diff</code></strong></td><td style="padding-top:0px" valign="top">Apply patch</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>diff -u <old_file> <new_file> > patch.diff</code></strong></td><td style="padding-top:0px" valign="top">Create patch</td></tr>
</table> </td> </tr>
</tbody></table><br>
<h3>Search</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>grep <patt> <file></code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>-v</code></strong></td><td style="padding-top:7px" valign="top">Inverse</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-n</code></strong></td><td style="padding-top:0px" valign="top">Line numbers</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-w</code></strong></td><td style="padding-top:0px" valign="top">Whole word</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-A<num></code></strong></td><td style="padding-top:0px" valign="top">Print also num lines after</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-B<num></code></strong></td><td style="padding-top:0px" valign="top">Print also num lines before</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r</code></strong></td><td style="padding-top:0px" valign="top">Recursive</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-o</code></strong></td><td style="padding-top:0px" valign="top">Print only matching part</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-P</code></strong></td><td style="padding-top:0px" valign="top">Perl notation with additional operators such as: '<code>\\t</code>', '<code>+</code>' and '<code>?</code>' (non-greedy!!!!).</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Ignore case</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-I</code></strong></td><td style="padding-top:0px" valign="top">Do not process binary files</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-l</code></strong></td><td style="padding-top:0px" valign="top">Just print files with matches</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-L</code></strong></td><td style="padding-top:0px" valign="top">Just print files without matches</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-e <patt></code></strong></td><td style="padding-top:0px" valign="top">Necessary to put before pattern if it starts with '<code>-</code>'!!!!!!! or if you want multiple patterns.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>| wc -l</code></strong></td><td style="padding-top:0px" valign="top">Count occurrences</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>--line-buffered</code></strong></td><td style="padding-top:0px" valign="top">Processes input line by line instead of in bigger chunks</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>look</code></strong></td><td style="padding-top: 1px" valign="top">Display lines beginning with a given string</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>strings</code></strong></td><td style="padding-top: 1px" valign="top">Print all text parts of binary file</td></tr>
</tbody></table><br>
<h3>Convert</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>todos, fromdos</code></strong></td><td style="padding-top: 1px" valign="top">Convert line endings form/to windows format (package tofrodos)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>enscript</code></strong></td><td style="padding-top: 1px" valign="top">Converts text files to postscript, rtf, HTML</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>gs</code></strong></td><td style="padding-top: 1px" valign="top">Ghostscript: postscript and PDF language interpreter and previewer</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>pdftohtml</code></strong></td><td style="padding-top: 1px" valign="top">Pdf to html</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>pdftotext</code></strong></td><td style="padding-top: 1px" valign="top">Pdf to text</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>libreoffice</code></strong></td><td style="padding-top: 1px" valign="top">New Openoffice</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>figlet</code></strong></td><td style="padding-top: 1px" valign="top">Display large characters made up of ordinary screen characters (Ascii art)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>toilet</code></strong></td><td style="padding-top: 1px" valign="top">Similar (Ascii art)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>cproto</code></strong></td><td style="padding-top: 1px" valign="top">Generates C function prototypes (declarations)</td></tr>
</tbody></table><br>
<h3>Editors</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>nano</code></strong></td><td style="padding-top: 7px" valign="top">Simple text editor.</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>/etc/nanorc</code></strong></td><td style="padding-top:0px" valign="top">Config file.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>/usr/share/nano/<lang>.nanorc</code></strong></td><td style="padding-top:0px" valign="top">Syntax highlight files.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>Alt + / or ?</code></strong></td><td style="padding-top:0px" valign="top">Go to last line.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>fte</code></strong></td><td style="padding-top: 1px" valign="top">Cool text editor with CUA (IBM)-shortcuts</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>diakonos</code></strong></td><td style="padding-top: 1px" valign="top">Simple terminal text editor with ctrl-c for copy</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>pyroom</code></strong></td><td style="padding-top: 1px" valign="top">Distraction free writing (gui)</td></tr>
</tbody></table><br>
<h2>Network<a href="#network" name="network">#</a></h2>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>whois</code></strong></td><td style="padding-top: 1px" valign="top">Info about domain</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>host <ip/hostname></code></strong></td><td style="padding-top: 1px" valign="top">DNS lookup utility</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>nslookup</code></strong></td><td style="padding-top: 1px" valign="top">Same interactively</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>dig</code></strong></td><td style="padding-top: 1px" valign="top">Same, lot of options</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>hostname</code></strong></td><td style="padding-top: 1px" valign="top">Prints/sets computer name, to set it permanently edit '<code>/etc/hostname</code>' and '<code>/etc/hosts</code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>netstat</code></strong></td><td style="padding-top: 7px" valign="top">Displays contents of /proc/net files, status of ports...</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r</code></strong></td><td style="padding-top:0px" valign="top">Show routing table</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Show interfaces</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>arp</code></strong></td><td style="padding-top: 1px" valign="top">Manipulate the system ARP cache (IP -> mac)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>route</code></strong></td><td style="padding-top: 7px" valign="top">Tool used to display or modify the routing table</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>add default gw <ip></code></strong></td><td style="padding-top:0px" valign="top">Change the default gateway should DNS not be configured correctly on your machine, you need to edit '<code>/etc/resolv.conf</code>' to make things work</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ifconfig eth0</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>down/up (sudo)</code></strong></td><td style="padding-top:7px" valign="top">Turn network interface on/off</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><ip> netmask <mask> up</code></strong></td><td style="padding-top:0px" valign="top">Set ip and mask</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>ifup eth0</code></strong></td><td style="padding-top: 1px" valign="top">Will bring eth0 up if it is currently down.</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ip</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>link show</code></strong></td><td style="padding-top:7px" valign="top">List network interfaces</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>link set dev eth0 up</code></strong></td><td style="padding-top:0px" valign="top">Bring interface eth0 up or down</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>addr show</code></strong></td><td style="padding-top:0px" valign="top">List addresses of interfaces</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>route add default via <ip></code></strong></td><td style="padding-top:0px" valign="top">Set default gateway</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>traceroute, traceroute6, traceroute6.iputils</code></strong></td><td style="padding-top: 1px" valign="top">Traces route</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>tracepath, tracepath6</code></strong></td><td style="padding-top: 1px" valign="top">Similar (iputils package)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mtr</code></strong></td><td style="padding-top: 1px" valign="top">Combines the functionality of the traceroute and ping</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>findsmb</code></strong></td><td style="padding-top: 1px" valign="top">List info about machines that respond to SMB name queries - Windows based machines sharing their hard disks</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>/etc/services</code></strong></td><td style="padding-top: 1px" valign="top">List of internet services with their port numbers</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>NetworkManager</code></strong></td><td style="padding-top: 1px" valign="top">Network management daemon, configuration file is in /etc/NetworkManager/NetworkManager.conf</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>nm-tool</code></strong></td><td style="padding-top: 1px" valign="top">Prints info</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>nm-online</code></strong></td><td style="padding-top: 1px" valign="top">Is network connected</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>nmcli</code></strong></td><td style="padding-top: 1px" valign="top">Command-line tool for controlling NetworkManager</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>nc</code></strong></td><td style="padding-top: 1px" valign="top">(netcat) It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning...</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>ncat</code></strong></td><td style="padding-top: 1px" valign="top">Concatenate and redirect sockets</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ethtool eth0</code></strong></td><td style="padding-top: 7px" valign="top">Show status of eth0</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-S</code></strong></td><td style="padding-top:0px" valign="top">Statistics</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-s</code></strong></td><td style="padding-top:0px" valign="top">Change settings (speed, duplex,...)</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ss -tupl</code></strong></td><td style="padding-top: 7px" valign="top">List internet services on a system</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-tuo</code></strong></td><td style="padding-top:0px" valign="top">List active connections to/from system</td></tr>
</table> </td> </tr>
</tbody></table><br>
<h3>Wireless</h3>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>iwconfig</code></strong></td><td style="padding-top: 1px" valign="top">Sets the wireless configuration options basic to most wireless devices</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>iwlist wlan0</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code><option></code></strong></td><td style="padding-top:7px" valign="top">Displays current status information of a device, more detailed then iwconfig</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>scan (sudo)</code></strong></td><td style="padding-top:0px" valign="top">List wireless networks in range</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>iwspy</code></strong></td><td style="padding-top: 1px" valign="top">Sets the list of IP addresses in a wireless network and checks the quality of their connections</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>iwpriv</code></strong></td><td style="padding-top: 1px" valign="top">Accesses configuration options specific to a particular device</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>rfkill</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>list</code></strong></td><td style="padding-top:7px" valign="top">Show wireless adapters (wifi and bluetooth)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>block/unblock <dev_num></code></strong></td><td style="padding-top:0px" valign="top">Block/unblock wireless device</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>iw dev wlan0</code></strong></td><td valign="top"> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:7px" valign="top"><strong><code>link</code></strong></td><td style="padding-top:7px" valign="top">Show link status of wlan0</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>set biterates <standard></code></strong></td><td style="padding-top:0px" valign="top">Manually set interface speed</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>scan (sudo)</code></strong></td><td style="padding-top:0px" valign="top">List wireless networks in range</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>wavemon</code></strong></td><td style="padding-top: 1px" valign="top">Monitor wireless connection link quality</td></tr>
</tbody></table><br>
<h2>Internet<a href="#internet" name="internet">#</a></h2>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>mutt</code></strong></td><td style="padding-top: 1px" valign="top">Mail client</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>sftp</code></strong></td><td style="padding-top: 1px" valign="top">Secure ftp</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>sshd</code></strong></td><td style="padding-top: 1px" valign="top">(openssh-server) ssh server deamon, on Windows service is named 'CYGWIN sshd'</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>/etc/init.d/ssh restart (sudo)</code></strong></td><td style="padding-top: 1px" valign="top">Restart sshd (ssh deamon)</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>/usr/local/etc/init.d/openssh start (sudo)</code></strong></td><td style="padding-top: 1px" valign="top">Start openssh deamon</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>ssh-keygen -t rsa -C <email></code></strong></td><td style="padding-top: 1px" valign="top">Generate rsa key pair, keys are stored in ~/.ssh</td></tr>
</tbody></table><br>
<table width=780 style="border-spacing: 0px"><tbody>
<tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>ssh</code></strong></td><td style="padding-top: 7px" valign="top">SSH client</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code><user>@<address> "mpg321 -" < <file>.mp3</code></strong></td><td style="padding-top:0px" valign="top">Stream audio over ssh</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>enter ~.</code></strong></td><td style="padding-top:0px" valign="top">Kill unresponsive session</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 1px;width: 155px" valign="top"><strong><code>scp</code></strong></td><td style="padding-top: 1px" valign="top">Securely copy files over network. Example: '<code>scp <local_file> <user>@<host>:~<remote_file></code>'</td></tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>wget</code></strong></td><td style="padding-top: 7px" valign="top">Download files from WWW</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-O</code></strong></td><td style="padding-top:0px" valign="top">Specify output file</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-c</code></strong></td><td style="padding-top:0px" valign="top">Continue downloading unfinished file. Can also use wildcards, but use single quotes around url.</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-r -l1 --no-parent -A.gif</code></strong></td><td style="padding-top:0px" valign="top">Recursively to the depth of one ignoring references to the parent directory and all gifs.</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>curl</code></strong></td><td style="padding-top: 7px" valign="top">Similar</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-qO -</code></strong></td><td style="padding-top:0px" valign="top">Writes to standard output + quiet</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-i</code></strong></td><td style="padding-top:0px" valign="top">Urls specified by standard input</td></tr>
</table> </td> </tr>
<tr><td width=155px></td><td></td></tr><tr><td style="padding-right: 10px;padding-top: 7px;width: 155px" valign="top"><strong><code>transmissioncli</code></strong></td><td style="padding-top: 7px" valign="top">Torrent terminal client</td></tr>
<tr> <td></td> <td> <table style="border-spacing: 0px">
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-d</code></strong></td><td style="padding-top:0px" valign="top">Download limit (kB/s)</td></tr>
<tr> <td style="width:1px;white-space:nowrap;padding-right:10px;padding-top:0px" valign="top"><strong><code>-u</code></strong></td><td style="padding-top:0px" valign="top">Upload limit</td></tr>
</table> </td> </tr>