File size: 296,356 Bytes
5aefba6 | 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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 | instruction,input,output
What is chgrp command,,"# chgrp
> Change group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chgrp.
* Change the owner group of a file/directory:
`chgrp {{group}} {{path/to/file_or_directory}}`
* Recursively change the owner group of a directory and its contents:
`chgrp -R {{group}} {{path/to/directory}}`
* Change the owner group of a symbolic link:
`chgrp -h {{group}} {{path/to/symlink}}`
* Change the owner group of a file/directory to match a reference file:
`chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`"
What is more command,,"# more
> Open a file for interactive reading, allowing scrolling and search. More
> information: https://manned.org/more.
* Open a file:
`more {{path/to/file}}`
* Open a file displaying from a specific line:
`more +{{line_number}} {{path/to/file}}`
* Display help:
`more --help`
* Go to the next page:
`<Space>`
* Search for a string (press `n` to go to the next match):
`/{{something}}`
* Exit:
`q`
* Display help about interactive commands:
`h`"
What is git-hash-object command,,"# git hash-object
> Computes the unique hash key of content and optionally creates an object
> with specified type. More information: https://git-scm.com/docs/git-hash-
> object.
* Compute the object ID without storing it:
`git hash-object {{path/to/file}}`
* Compute the object ID and store it in the Git database:
`git hash-object -w {{path/to/file}}`
* Compute the object ID specifying the object type:
`git hash-object -t {{blob|commit|tag|tree}} {{path/to/file}}`
* Compute the object ID from `stdin`:
`cat {{path/to/file}} | git hash-object --stdin`"
What is id command,,"# id
> Display current user and group identity. More information:
> https://www.gnu.org/software/coreutils/id.
* Display current user's ID (UID), group ID (GID) and groups to which they belong:
`id`
* Display the current user identity as a number:
`id -u`
* Display the current group identity as a number:
`id -g`
* Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong:
`id {{username}}`"
What is nl command,,"# nl
> A utility for numbering lines, either from a file, or from `stdin`. More
> information: https://www.gnu.org/software/coreutils/nl.
* Number non-blank lines in a file:
`nl {{path/to/file}}`
* Read from `stdout`:
`cat {{path/to/file}} | nl {{options}} -`
* Number only the lines with printable text:
`nl -t {{path/to/file}}`
* Number all lines including blank lines:
`nl -b a {{path/to/file}}`
* Number only the body lines that match a basic regular expression (BRE) pattern:
`nl -b p'FooBar[0-9]' {{path/to/file}}`"
What is git-check-ignore command,,"# git check-ignore
> Analyze and debug Git ignore/exclude ("".gitignore"") files. More information:
> https://git-scm.com/docs/git-check-ignore.
* Check whether a file or directory is ignored:
`git check-ignore {{path/to/file_or_directory}}`
* Check whether multiple files or directories are ignored:
`git check-ignore {{path/to/file}} {{path/to/directory}}`
* Use pathnames, one per line, from `stdin`:
`git check-ignore --stdin < {{path/to/file_list}}`
* Do not check the index (used to debug why paths were tracked and not ignored):
`git check-ignore --no-index {{path/to/files_or_directories}}`
* Include details about the matching pattern for each path:
`git check-ignore --verbose {{path/to/files_or_directories}}`"
What is tcpdump command,,"# tcpdump
> Dump traffic on a network. More information: https://www.tcpdump.org.
* List available network interfaces:
`tcpdump -D`
* Capture the traffic of a specific interface:
`tcpdump -i {{eth0}}`
* Capture all TCP traffic showing contents (ASCII) in console:
`tcpdump -A tcp`
* Capture the traffic from or to a host:
`tcpdump host {{www.example.com}}`
* Capture the traffic from a specific interface, source, destination and destination port:
`tcpdump -i {{eth0}} src {{192.168.1.1}} and dst {{192.168.1.2}} and dst port
{{80}}`
* Capture the traffic of a network:
`tcpdump net {{192.168.1.0/24}}`
* Capture all traffic except traffic over port 22 and save to a dump file:
`tcpdump -w {{dumpfile.pcap}} port not {{22}}`
* Read from a given dump file:
`tcpdump -r {{dumpfile.pcap}}`"
What is users command,,"# users
> Display a list of logged in users. See also: `useradd`, `userdel`,
> `usermod`. More information: https://www.gnu.org/software/coreutils/users.
* Print logged in usernames:
`users`
* Print logged in usernames according to a given file:
`users {{/var/log/wmtp}}`"
What is git-rev-list command,,"# git rev-list
> List revisions (commits) in reverse chronological order. More information:
> https://git-scm.com/docs/git-rev-list.
* List all commits on the current branch:
`git rev-list {{HEAD}}`
* Print the latest commit that changed (add/edit/remove) a specific file on the current branch:
`git rev-list -n 1 HEAD -- {{path/to/file}}`
* List commits more recent than a specific date, on a specific branch:
`git rev-list --since={{'2019-12-01 00:00:00'}} {{branch_name}}`
* List all merge commits on a specific commit:
`git rev-list --merges {{commit}}`
* Print the number of commits since a specific tag:
`git rev-list {{tag_name}}..HEAD --count`"
What is lpr command,,"# lpr
> CUPS tool for printing files. See also: `lpstat` and `lpadmin`. More
> information: https://www.cups.org/doc/man-lpr.html.
* Print a file to the default printer:
`lpr {{path/to/file}}`
* Print 2 copies:
`lpr -# {{2}} {{path/to/file}}`
* Print to a named printer:
`lpr -P {{printer}} {{path/to/file}}`
* Print either a single page (e.g. 2) or a range of pages (e.g. 2–16):
`lpr -o page-ranges={{2|2-16}} {{path/to/file}}`
* Print double-sided either in portrait (long) or in landscape (short):
`lpr -o sides={{two-sided-long-edge|two-sided-short-edge}} {{path/to/file}}`
* Set page size (more options may be available depending on setup):
`lpr -o media={{a4|letter|legal}} {{path/to/file}}`
* Print multiple pages per sheet:
`lpr -o number-up={{2|4|6|9|16}} {{path/to/file}}`"
What is lp command,,"# lp
> Print files. More information: https://manned.org/lp.
* Print the output of a command to the default printer (see `lpstat` command):
`echo ""test"" | lp`
* Print a file to the default printer:
`lp {{path/to/filename}}`
* Print a file to a named printer (see `lpstat` command):
`lp -d {{printer_name}} {{path/to/filename}}`
* Print N copies of file to default printer (replace N with desired number of copies):
`lp -n {{N}} {{path/to/filename}}`
* Print only certain pages to the default printer (print pages 1, 3-5, and 16):
`lp -P 1,3-5,16 {{path/to/filename}}`
* Resume printing a job:
`lp -i {{job_id}} -H resume`"
What is uptime command,,"# uptime
> Tell how long the system has been running and other information. More
> information: https://ss64.com/osx/uptime.html.
* Print current time, uptime, number of logged-in users and other information:
`uptime`"
What is git-count-objects command,,"# git count-objects
> Count the number of unpacked objects and their disk consumption. More
> information: https://git-scm.com/docs/git-count-objects.
* Count all objects and display the total disk usage:
`git count-objects`
* Display a count of all objects and their total disk usage, displaying sizes in human-readable units:
`git count-objects --human-readable`
* Display more verbose information:
`git count-objects --verbose`
* Display more verbose information, displaying sizes in human-readable units:
`git count-objects --human-readable --verbose`"
What is git-shortlog command,,"# git shortlog
> Summarizes the `git log` output. More information: https://git-
> scm.com/docs/git-shortlog.
* View a summary of all the commits made, grouped alphabetically by author name:
`git shortlog`
* View a summary of all the commits made, sorted by the number of commits made:
`git shortlog -n`
* View a summary of all the commits made, grouped by the committer identities (name and email):
`git shortlog -c`
* View a summary of the last 5 commits (i.e. specify a revision range):
`git shortlog HEAD~{{5}}..HEAD`
* View all users, emails and the number of commits in the current branch:
`git shortlog -sne`
* View all users, emails and the number of commits in all branches:
`git shortlog -sne --all`"
What is pv command,,"# pv
> Monitor the progress of data through a pipe. More information:
> https://manned.org/pv.
* Print the contents of the file and display a progress bar:
`pv {{path/to/file}}`
* Measure the speed and amount of data flow between pipes (`--size` is optional):
`command1 | pv --size {{expected_amount_of_data_for_eta}} | command2`
* Filter a file, see both progress and amount of output data:
`pv -cN in {{big_text_file}} | grep {{pattern}} | pv -cN out >
{{filtered_file}}`
* Attach to an already running process and see its file reading progress:
`pv -d {{PID}}`
* Read an erroneous file, skip errors as `dd conv=sync,noerror` would:
`pv -EE {{path/to/faulty_media}} > image.img`
* Stop reading after reading specified amount of data, rate limit to 1K/s:
`pv -L 1K --stop-at --size {{maximum_file_size_to_be_read}}`"
What is nl command,,"# nl
> A utility for numbering lines, either from a file, or from `stdin`. More
> information: https://www.gnu.org/software/coreutils/nl.
* Number non-blank lines in a file:
`nl {{path/to/file}}`
* Read from `stdout`:
`cat {{path/to/file}} | nl {{options}} -`
* Number only the lines with printable text:
`nl -t {{path/to/file}}`
* Number all lines including blank lines:
`nl -b a {{path/to/file}}`
* Number only the body lines that match a basic regular expression (BRE) pattern:
`nl -b p'FooBar[0-9]' {{path/to/file}}`"
What is git-svn command,,"# git svn
> Bidirectional operation between a Subversion repository and Git. More
> information: https://git-scm.com/docs/git-svn.
* Clone an SVN repository:
`git svn clone {{https://example.com/subversion_repo}} {{local_dir}}`
* Clone an SVN repository starting at a given revision number:
`git svn clone -r{{1234}}:HEAD {{https://svn.example.net/subversion/repo}}
{{local_dir}}`
* Update local clone from the remote SVN repository:
`git svn rebase`
* Fetch updates from the remote SVN repository without changing the Git HEAD:
`git svn fetch`
* Commit back to the SVN repository:
`git svn dcommit`"
What is grep command,,"# grep
> Find patterns in files using regular expressions. More information:
> https://www.gnu.org/software/grep/manual/grep.html.
* Search for a pattern within a file:
`grep ""{{search_pattern}}"" {{path/to/file}}`
* Search for an exact string (disables regular expressions):
`grep --fixed-strings ""{{exact_string}}"" {{path/to/file}}`
* Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
`grep --recursive --line-number --binary-files={{without-match}}
""{{search_pattern}}"" {{path/to/directory}}`
* Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
`grep --extended-regexp --ignore-case ""{{search_pattern}}"" {{path/to/file}}`
* Print 3 lines of context around, before, or after each match:
`grep --{{context|before-context|after-context}}={{3}} ""{{search_pattern}}""
{{path/to/file}}`
* Print file name and line number for each match with color output:
`grep --with-filename --line-number --color=always ""{{search_pattern}}""
{{path/to/file}}`
* Search for lines matching a pattern, printing only the matched text:
`grep --only-matching ""{{search_pattern}}"" {{path/to/file}}`
* Search `stdin` for lines that do not match a pattern:
`cat {{path/to/file}} | grep --invert-match ""{{search_pattern}}""`"
What is systemd-run command,,"# systemd-run
> Run programs in transient scope units, service units, or path-, socket-, or
> timer-triggered service units. More information:
> https://www.freedesktop.org/software/systemd/man/systemd-run.html.
* Start a transient service:
`sudo systemd-run {{command}} {{argument1 argument2 ...}}`
* Start a transient service under the service manager of the current user (no privileges):
`systemd-run --user {{command}} {{argument1 argument2 ...}}`
* Start a transient service with a custom unit name and description:
`sudo systemd-run --unit={{name}} --description={{string}} {{command}}
{{argument1 argument2 ...}}`
* Start a transient service that does not get cleaned up after it terminates with a custom environment variable:
`sudo systemd-run --remain-after-exit --set-env={{name}}={{value}} {{command}}
{{argument1 argument2 ...}}`
* Start a transient timer that periodically runs its transient service (see `man systemd.time` for calendar event format):
`sudo systemd-run --on-calendar={{calendar_event}} {{command}} {{argument1
argument2 ...}}`
* Share the terminal with the program (allowing interactive input/output) and make sure the execution details remain after the program exits:
`systemd-run --remain-after-exit --pty {{command}}`
* Set properties (e.g. CPUQuota, MemoryMax) of the process and wait until it exits:
`systemd-run --property MemoryMax={{memory_in_bytes}} --property
CPUQuota={{percentage_of_CPU_time}}% --wait {{command}}`
* Use the program in a shell pipeline:
`{{command1}} | systemd-run --pipe {{command2}} | {{command3}}`"
What is tput command,,"# tput
> View and modify terminal settings and capabilities. More information:
> https://manned.org/tput.
* Move the cursor to a screen location:
`tput cup {{row}} {{column}}`
* Set foreground (af) or background (ab) color:
`tput {{setaf|setab}} {{ansi_color_code}}`
* Show number of columns, lines, or colors:
`tput {{cols|lines|colors}}`
* Ring the terminal bell:
`tput bel`
* Reset all terminal attributes:
`tput sgr0`
* Enable or disable word wrap:
`tput {{smam|rmam}}`"
What is link command,,"# link
> Create a hard link to an existing file. For more options, see the `ln`
> command. More information: https://www.gnu.org/software/coreutils/link.
* Create a hard link from a new file to an existing file:
`link {{path/to/existing_file}} {{path/to/new_file}}`"
What is logname command,,"# logname
> Shows the user's login name. More information:
> https://www.gnu.org/software/coreutils/logname.
* Display the currently logged in user's name:
`logname`"
What is iconv command,,"# iconv
> Converts text from one encoding to another. More information:
> https://manned.org/iconv.
* Convert file to a specific encoding, and print to `stdout`:
`iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}`
* Convert file to the current locale's encoding, and output to a file:
`iconv -f {{from_encoding}} {{input_file}} > {{output_file}}`
* List supported encodings:
`iconv -l`"
What is paste command,,"# paste
> Merge lines of files. More information:
> https://www.gnu.org/software/coreutils/paste.
* Join all the lines into a single line, using TAB as delimiter:
`paste -s {{path/to/file}}`
* Join all the lines into a single line, using the specified delimiter:
`paste -s -d {{delimiter}} {{path/to/file}}`
* Merge two files side by side, each in its column, using TAB as delimiter:
`paste {{file1}} {{file2}}`
* Merge two files side by side, each in its column, using the specified delimiter:
`paste -d {{delimiter}} {{file1}} {{file2}}`
* Merge two files, with lines added alternatively:
`paste -d '\n' {{file1}} {{file2}}`"
What is ls command,,"# ls
> List directory contents. More information:
> https://www.gnu.org/software/coreutils/ls.
* List files one per line:
`ls -1`
* List all files, including hidden files:
`ls -a`
* List all files, with trailing `/` added to directory names:
`ls -F`
* Long format list (permissions, ownership, size, and modification date) of all files:
`ls -la`
* Long format list with size displayed using human-readable units (KiB, MiB, GiB):
`ls -lh`
* Long format list sorted by size (descending):
`ls -lS`
* Long format list of all files, sorted by modification date (oldest first):
`ls -ltr`
* Only list directories:
`ls -d */`"
What is mktemp command,,"# mktemp
> Create a temporary file or directory. More information:
> https://ss64.com/osx/mktemp.html.
* Create an empty temporary file and print the absolute path to it:
`mktemp`
* Create an empty temporary file with a given suffix and print the absolute path to file:
`mktemp --suffix ""{{.ext}}""`
* Create a temporary directory and print the absolute path to it:
`mktemp -d`"
What is git-range-diff command,,"# git range-diff
> Compare two commit ranges (e.g. two versions of a branch). More information:
> https://git-scm.com/docs/git-range-diff.
* Diff the changes of two individual commits:
`git range-diff {{commit_1}}^! {{commit_2}}^!`
* Diff the changes of ours and theirs from their common ancestor, e.g. after an interactive rebase:
`git range-diff {{theirs}}...{{ours}}`
* Diff the changes of two commit ranges, e.g. to check whether conflicts have been resolved appropriately when rebasing commits from `base1` to `base2`:
`git range-diff {{base1}}..{{rev1}} {{base2}}..{{rev2}}`"
What is quilt command,,"# quilt
> Tool to manage a series of patches. More information:
> https://savannah.nongnu.org/projects/quilt.
* Import an existing patch from a file:
`quilt import {{path/to/filename.patch}}`
* Create a new patch:
`quilt new {{filename.patch}}`
* Add a file to the current patch:
`quilt add {{path/to/file}}`
* After editing the file, refresh the current patch with the changes:
`quilt refresh`
* Apply all the patches in the series file:
`quilt push -a`
* Remove all applied patches:
`quilt pop -a`"
What is nohup command,,"# nohup
> Allows for a process to live when the terminal gets killed. More
> information: https://www.gnu.org/software/coreutils/nohup.
* Run a process that can live beyond the terminal:
`nohup {{command}} {{argument1 argument2 ...}}`
* Launch `nohup` in background mode:
`nohup {{command}} {{argument1 argument2 ...}} &`
* Run a shell script that can live beyond the terminal:
`nohup {{path/to/script.sh}} &`
* Run a process and write the output to a specific file:
`nohup {{command}} {{argument1 argument2 ...}} > {{path/to/output_file}} &`"
What is expand command,,"# expand
> Convert tabs to spaces. More information:
> https://www.gnu.org/software/coreutils/expand.
* Convert tabs in each file to spaces, writing to `stdout`:
`expand {{path/to/file}}`
* Convert tabs to spaces, reading from `stdin`:
`expand`
* Do not convert tabs after non blanks:
`expand -i {{path/to/file}}`
* Have tabs a certain number of characters apart, not 8:
`expand -t={{number}} {{path/to/file}}`
* Use a comma separated list of explicit tab positions:
`expand -t={{1,4,6}}`"
What is strace command,,"# strace
> Troubleshooting tool for tracing system calls. More information:
> https://manned.org/strace.
* Start tracing a specific process by its PID:
`strace -p {{pid}}`
* Trace a process and filter output by system call:
`strace -p {{pid}} -e {{system_call_name}}`
* Count time, calls, and errors for each system call and report a summary on program exit:
`strace -p {{pid}} -c`
* Show the time spent in every system call:
`strace -p {{pid}} -T`
* Start tracing a program by executing it:
`strace {{program}}`
* Start tracing file operations of a program:
`strace -e trace=file {{program}}`"
What is cmp command,,"# cmp
> Compare two files byte by byte. More information:
> https://www.gnu.org/software/diffutils/manual/html_node/Invoking-cmp.html.
* Output char and line number of the first difference between two files:
`cmp {{path/to/file1}} {{path/to/file2}}`
* Output info of the first difference: char, line number, bytes, and values:
`cmp --print-bytes {{path/to/file1}} {{path/to/file2}}`
* Output the byte numbers and values of every difference:
`cmp --verbose {{path/to/file1}} {{path/to/file2}}`
* Compare files but output nothing, yield only the exit status:
`cmp --quiet {{path/to/file1}} {{path/to/file2}}`"
What is chmod command,,"# chmod
> Change the access permissions of a file or directory. More information:
> https://www.gnu.org/software/coreutils/chmod.
* Give the [u]ser who owns a file the right to e[x]ecute it:
`chmod u+x {{path/to/file}}`
* Give the [u]ser rights to [r]ead and [w]rite to a file/directory:
`chmod u+rw {{path/to/file_or_directory}}`
* Remove e[x]ecutable rights from the [g]roup:
`chmod g-x {{path/to/file}}`
* Give [a]ll users rights to [r]ead and e[x]ecute:
`chmod a+rx {{path/to/file}}`
* Give [o]thers (not in the file owner's group) the same rights as the [g]roup:
`chmod o=g {{path/to/file}}`
* Remove all rights from [o]thers:
`chmod o= {{path/to/file}}`
* Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite:
`chmod -R g+w,o+w {{path/to/directory}}`
* Recursively give [a]ll users [r]ead permissions to files and e[X]ecute permissions to sub-directories within a directory:
`chmod -R a+rX {{path/to/directory}}`"
What is chsh command,,"# chsh
> Change user's login shell. More information: https://manned.org/chsh.
* Set a specific login shell for the current user interactively:
`chsh`
* Set a specific login [s]hell for the current user:
`chsh -s {{path/to/shell}}`
* Set a login [s]hell for a specific user:
`chsh -s {{path/to/shell}} {{username}}`
* [l]ist available shells:
`chsh -l`"
What is coredumpctl command,,"# coredumpctl
> Retrieve and process saved core dumps and metadata. More information:
> https://www.freedesktop.org/software/systemd/man/coredumpctl.html.
* List all captured core dumps:
`coredumpctl list`
* List captured core dumps for a program:
`coredumpctl list {{program}}`
* Show information about the core dumps matching a program with `PID`:
`coredumpctl info {{PID}}`
* Invoke debugger using the last core dump of a program:
`coredumpctl debug {{program}}`
* Extract the last core dump of a program to a file:
`coredumpctl --output={{path/to/file}} dump {{program}}`"
What is git-check-mailmap command,,"# git check-mailmap
> Show canonical names and email addresses of contacts. More information:
> https://git-scm.com/docs/git-check-mailmap.
* Look up the canonical name associated with an email address:
`git check-mailmap ""<{{email@example.com}}>""`"
What is top command,,"# top
> Display dynamic real-time information about running processes. More
> information: https://ss64.com/osx/top.html.
* Start `top`, all options are available in the interface:
`top`
* Start `top` sorting processes by internal memory size (default order - process ID):
`top -o mem`
* Start `top` sorting processes first by CPU, then by running time:
`top -o cpu -O time`
* Start `top` displaying only processes owned by given user:
`top -user {{user_name}}`
* Get help about interactive commands:
`?`"
What is unshare command,,"# unshare
> Execute a command in new user-defined namespaces. More information:
> https://www.kernel.org/doc/html/latest/userspace-api/unshare.html.
* Execute a command without sharing access to connected networks:
`unshare --net {{command}} {{command_arguments}}`
* Execute a command as a child process without sharing mounts, processes, or networks:
`unshare --mount --pid --net --fork {{command}} {{command_arguments}}`"
What is git-switch command,,"# git switch
> Switch between Git branches. Requires Git version 2.23+. See also `git
> checkout`. More information: https://git-scm.com/docs/git-switch.
* Switch to an existing branch:
`git switch {{branch_name}}`
* Create a new branch and switch to it:
`git switch --create {{branch_name}}`
* Create a new branch based on an existing commit and switch to it:
`git switch --create {{branch_name}} {{commit}}`
* Switch to the previous branch:
`git switch -`
* Switch to a branch and update all submodules to match:
`git switch --recurse-submodules {{branch_name}}`
* Switch to a branch and automatically merge the current branch and any uncommitted changes into it:
`git switch --merge {{branch_name}}`"
What is dpkg command,,"# dpkg
> Debian package manager. Some subcommands such as `dpkg deb` have their own
> usage documentation. For equivalent commands in other package managers, see
> https://wiki.archlinux.org/title/Pacman/Rosetta. More information:
> https://manpages.debian.org/latest/dpkg/dpkg.html.
* Install a package:
`dpkg -i {{path/to/file.deb}}`
* Remove a package:
`dpkg -r {{package}}`
* List installed packages:
`dpkg -l {{pattern}}`
* List a package's contents:
`dpkg -L {{package}}`
* List contents of a local package file:
`dpkg -c {{path/to/file.deb}}`
* Find out which package owns a file:
`dpkg -S {{path/to/file}}`"
What is m4 command,,"# m4
> Macro processor. More information: https://www.gnu.org/software/m4.
* Process macros in a file:
`m4 {{path/to/file}}`
* Define a macro before processing files:
`m4 -D{{macro_name}}={{macro_value}} {{path/to/file}}`"
What is git-check-ref-format command,,"# git check-ref-format
> Checks if a given refname is acceptable, and exits with a non-zero status if
> it is not. More information: https://git-scm.com/docs/git-check-ref-format.
* Check the format of the specified refname:
`git check-ref-format {{refs/head/refname}}`
* Print the name of the last branch checked out:
`git check-ref-format --branch @{-1}`
* Normalize a refname:
`git check-ref-format --normalize {{refs/head/refname}}`"
What is date command,,"# date
> Set or display the system date. More information:
> https://ss64.com/osx/date.html.
* Display the current date using the default locale's format:
`date +%c`
* Display the current date in UTC and ISO 8601 format:
`date -u +%Y-%m-%dT%H:%M:%SZ`
* Display the current date as a Unix timestamp (seconds since the Unix epoch):
`date +%s`
* Display a specific date (represented as a Unix timestamp) using the default format:
`date -r 1473305798`"
What is git-rebase command,,"# git rebase
> Reapply commits from one branch on top of another branch. Commonly used to
> ""move"" an entire branch to another base, creating copies of the commits in
> the new location. More information: https://git-scm.com/docs/git-rebase.
* Rebase the current branch on top of another specified branch:
`git rebase {{new_base_branch}}`
* Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified:
`git rebase -i {{target_base_branch_or_commit_hash}}`
* Continue a rebase that was interrupted by a merge failure, after editing conflicting files:
`git rebase --continue`
* Continue a rebase that was paused due to merge conflicts, by skipping the conflicted commit:
`git rebase --skip`
* Abort a rebase in progress (e.g. if it is interrupted by a merge conflict):
`git rebase --abort`
* Move part of the current branch onto a new base, providing the old base to start from:
`git rebase --onto {{new_base}} {{old_base}}`
* Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified:
`git rebase -i {{HEAD~5}}`
* Auto-resolve any conflicts by favoring the working branch version (`theirs` keyword has reversed meaning in this case):
`git rebase -X theirs {{branch_name}}`"
What is git-commit-graph command,,"# git commit-graph
> Write and verify Git commit-graph files. More information: https://git-
> scm.com/docs/git-commit-graph.
* Write a commit-graph file for the packed commits in the repository's local `.git` directory:
`git commit-graph write`
* Write a commit-graph file containing all reachable commits:
`git show-ref --hash | git commit-graph write --stdin-commits`
* Write a commit-graph file containing all commits in the current commit-graph file along with those reachable from `HEAD`:
`git rev-parse {{HEAD}} | git commit-graph write --stdin-commits --append`"
What is chroot command,,"# chroot
> Run command or interactive shell with special root directory. More
> information: https://www.gnu.org/software/coreutils/chroot.
* Run command as new root directory:
`chroot {{path/to/new/root}} {{command}}`
* Specify user and group (ID or name) to use:
`chroot --userspec={{user:group}}`"
What is mesg command,,"# mesg
> Check or set a terminal's ability to receive messages from other users,
> usually from the write command. See also `write`. More information:
> https://manned.org/mesg.
* Check terminal's openness to write messages:
`mesg`
* Disable receiving messages from the write command:
`mesg n`
* Enable receiving messages from the write command:
`mesg y`"
What is grep command,,"# grep
> Find patterns in files using regular expressions. More information:
> https://www.gnu.org/software/grep/manual/grep.html.
* Search for a pattern within a file:
`grep ""{{search_pattern}}"" {{path/to/file}}`
* Search for an exact string (disables regular expressions):
`grep --fixed-strings ""{{exact_string}}"" {{path/to/file}}`
* Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
`grep --recursive --line-number --binary-files={{without-match}}
""{{search_pattern}}"" {{path/to/directory}}`
* Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
`grep --extended-regexp --ignore-case ""{{search_pattern}}"" {{path/to/file}}`
* Print 3 lines of context around, before, or after each match:
`grep --{{context|before-context|after-context}}={{3}} ""{{search_pattern}}""
{{path/to/file}}`
* Print file name and line number for each match with color output:
`grep --with-filename --line-number --color=always ""{{search_pattern}}""
{{path/to/file}}`
* Search for lines matching a pattern, printing only the matched text:
`grep --only-matching ""{{search_pattern}}"" {{path/to/file}}`
* Search `stdin` for lines that do not match a pattern:
`cat {{path/to/file}} | grep --invert-match ""{{search_pattern}}""`"
What is less command,,"# less
> Open a file for interactive reading, allowing scrolling and search. More
> information: https://greenwoodsoftware.com/less/.
* Open a file:
`less {{source_file}}`
* Page down/up:
`<Space> (down), b (up)`
* Go to end/start of file:
`G (end), g (start)`
* Forward search for a string (press `n`/`N` to go to next/previous match):
`/{{something}}`
* Backward search for a string (press `n`/`N` to go to next/previous match):
`?{{something}}`
* Follow the output of the currently opened file:
`F`
* Open the current file in an editor:
`v`
* Exit:
`q`"
What is git-add command,,"# git add
> Adds changed files to the index. More information: https://git-
> scm.com/docs/git-add.
* Add a file to the index:
`git add {{path/to/file}}`
* Add all files (tracked and untracked):
`git add -A`
* Only add already tracked files:
`git add -u`
* Also add ignored files:
`git add -f`
* Interactively stage parts of files:
`git add -p`
* Interactively stage parts of a given file:
`git add -p {{path/to/file}}`
* Interactively stage a file:
`git add -i`"
What is indent command,,"# indent
> Change the appearance of a C/C++ program by inserting or deleting
> whitespace. More information:
> https://www.freebsd.org/cgi/man.cgi?query=indent.
* Format C/C++ source according to the Berkeley style:
`indent {{path/to/source_file.c}} {{path/to/indented_file.c}} -nbad -nbap -bc
-br -c33 -cd33 -cdb -ce -ci4 -cli0 -di16 -fc1 -fcb -i4 -ip -l75 -lp -npcs
-nprs -psl -sc -nsob -ts8`
* Format C/C++ source according to the style of Kernighan & Ritchie (K&R):
`indent {{path/to/source_file.c}} {{path/to/indented_file.c}} -nbad -bap -nbc
-br -c33 -cd33 -ncdb -ce -ci4 -cli0 -cs -d0 -di1 -nfc1 -nfcb -i4 -nip -l75 -lp
-npcs -nprs -npsl -nsc -nsob`"
What is stty command,,"# stty
> Set options for a terminal device interface. More information:
> https://www.gnu.org/software/coreutils/stty.
* Display all settings for the current terminal:
`stty --all`
* Set the number of rows or columns:
`stty {{rows|cols}} {{count}}`
* Get the actual transfer speed of a device:
`stty --file {{path/to/device_file}} speed`
* Reset all modes to reasonable values for the current terminal:
`stty sane`"
What is git-column command,,"# git column
> Display data in columns. More information: https://git-scm.com/docs/git-
> column.
* Format `stdin` as multiple columns:
`ls | git column --mode={{column}}`
* Format `stdin` as multiple columns with a maximum width of `100`:
`ls | git column --mode=column --width={{100}}`
* Format `stdin` as multiple columns with a maximum padding of `30`:
`ls | git column --mode=column --padding={{30}}`"
What is who command,,"# who
> Display who is logged in and related data (processes, boot time). More
> information: https://www.gnu.org/software/coreutils/who.
* Display the username, line, and time of all currently logged-in sessions:
`who`
* Display information only for the current terminal session:
`who am i`
* Display all available information:
`who -a`
* Display all available information with table headers:
`who -a -H`"
What is git-notes command,,"# git notes
> Add or inspect object notes. More information: https://git-scm.com/docs/git-
> notes.
* List all notes and the objects they are attached to:
`git notes list`
* List all notes attached to a given object (defaults to HEAD):
`git notes list [{{object}}]`
* Show the notes attached to a given object (defaults to HEAD):
`git notes show [{{object}}]`
* Append a note to a specified object (opens the default text editor):
`git notes append {{object}}`
* Append a note to a specified object, specifying the message:
`git notes append --message=""{{message_text}}""`
* Edit an existing note (defaults to HEAD):
`git notes edit [{{object}}]`
* Copy a note from one object to another:
`git notes copy {{source_object}} {{target_object}}`
* Remove all the notes added to a specified object:
`git notes remove {{object}}`"
What is git-mv command,,"# git mv
> Move or rename files and update the Git index. More information:
> https://git-scm.com/docs/git-mv.
* Move a file inside the repo and add the movement to the next commit:
`git mv {{path/to/file}} {{new/path/to/file}}`
* Rename a file or directory and add the renaming to the next commit:
`git mv {{path/to/file_or_directory}} {{path/to/destination}}`
* Overwrite the file or directory in the target path if it exists:
`git mv --force {{path/to/file_or_directory}} {{path/to/destination}}`"
What is strip command,,"# strip
> Discard symbols from executables or object files. More information:
> https://manned.org/strip.
* Replace the input file with its stripped version:
`strip {{path/to/file}}`
* Strip symbols from a file, saving the output to a specific file:
`strip {{path/to/input_file}} -o {{path/to/output_file}}`
* Strip debug symbols only:
`strip --strip-debug {{path/to/file.o}}`"
What is bash command,,"# bash
> Bourne-Again SHell, an `sh`-compatible command-line interpreter. See also:
> `zsh`, `histexpand` (history expansion). More information:
> https://gnu.org/software/bash/.
* Start an interactive shell session:
`bash`
* Start an interactive shell session without loading startup configs:
`bash --norc`
* Execute specific [c]ommands:
`bash -c ""{{echo 'bash is executed'}}""`
* Execute a specific script:
`bash {{path/to/script.sh}}`
* Execute a specific script while printing each command before executing it:
`bash -x {{path/to/script.sh}}`
* Execute a specific script and stop at the first [e]rror:
`bash -e {{path/to/script.sh}}`
* Execute specific commands from `stdin`:
`{{echo ""echo 'bash is executed'""}} | bash`
* Start a [r]estricted shell session:
`bash -r`"
What is exit command,,"# exit
> Exit the shell. More information: https://manned.org/exit.
* Exit the shell with the exit code of the last command executed:
`exit`
* Exit the shell with the specified exit code:
`exit {{exit_code}}`"
What is uniq command,,"# uniq
> Output the unique lines from the given input or file. Since it does not
> detect repeated lines unless they are adjacent, we need to sort them first.
> More information: https://www.gnu.org/software/coreutils/uniq.
* Display each line once:
`sort {{path/to/file}} | uniq`
* Display only unique lines:
`sort {{path/to/file}} | uniq -u`
* Display only duplicate lines:
`sort {{path/to/file}} | uniq -d`
* Display number of occurrences of each line along with that line:
`sort {{path/to/file}} | uniq -c`
* Display number of occurrences of each line, sorted by the most frequent:
`sort {{path/to/file}} | uniq -c | sort -nr`"
What is git-mailinfo command,,"# git mailinfo
> Extract patch and authorship information from a single email message. More
> information: https://git-scm.com/docs/git-mailinfo.
* Extract the patch and author data from an email message:
`git mailinfo {{message|patch}}`
* Extract but remove leading and trailing whitespace:
`git mailinfo -k {{message|patch}}`
* Remove everything from the body before a scissors line (e.g. ""-->* --"") and retrieve the message or patch:
`git mailinfo --scissors {{message|patch}}`"
What is git-annotate command,,"# git annotate
> Show commit hash and last author on each line of a file. See `git blame`,
> which is preferred over `git annotate`. `git annotate` is provided for those
> familiar with other version control systems. More information: https://git-
> scm.com/docs/git-annotate.
* Print a file with the author name and commit hash prepended to each line:
`git annotate {{path/to/file}}`
* Print a file with the author email and commit hash prepended to each line:
`git annotate -e {{path/to/file}}`
* Print only rows that match a regular expression:
`git annotate -L :{{regexp}} {{path/to/file}}`"
What is pstree command,,"# pstree
> A convenient tool to show running processes as a tree. More information:
> https://manned.org/pstree.
* Display a tree of processes:
`pstree`
* Display a tree of processes with PIDs:
`pstree -p`
* Display all process trees rooted at processes owned by specified user:
`pstree {{user}}`"
What is ac command,,"# ac
> Print statistics on how long users have been connected. More information:
> https://man.openbsd.org/ac.
* Print how long the current user has been connected in hours:
`ac`
* Print how long users have been connected in hours:
`ac -p`
* Print how long a particular user has been connected in hours:
`ac -p {{username}}`
* Print how long a particular user has been connected in hours per day (with total):
`ac -dp {{username}}`"
What is sha1sum command,,"# sha1sum
> Calculate SHA1 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/sha1sum.
* Calculate the SHA1 checksum for one or more files:
`sha1sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of SHA1 checksums to a file:
`sha1sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha1}}`
* Calculate a SHA1 checksum from `stdin`:
`{{command}} | sha1sum`
* Read a file of SHA1 sums and filenames and verify all files have matching checksums:
`sha1sum --check {{path/to/file.sha1}}`
* Only show a message for missing files or when verification fails:
`sha1sum --check --quiet {{path/to/file.sha1}}`
* Only show a message when verification fails, ignoring missing files:
`sha1sum --ignore-missing --check --quiet {{path/to/file.sha1}}`"
What is ed command,,"# ed
> The original Unix text editor. See also: `awk`, `sed`. More information:
> https://www.gnu.org/software/ed/manual/ed_manual.html.
* Start an interactive editor session with an empty document:
`ed`
* Start an interactive editor session with an empty document and a specific [p]rompt:
`ed -p '> '`
* Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
`ed -s`
* Edit a specific file (this shows the byte count of the loaded file):
`ed {{path/to/file}}`
* Replace a string with a specific replacement for all lines:
`,s/{{regular_expression}}/{{replacement}}/g`"
What is systemd-analyze command,,"# systemd-analyze
> Analyze and debug system manager. Show timing details about the boot process
> of units (services, mount points, devices, sockets). More information:
> https://www.freedesktop.org/software/systemd/man/systemd-analyze.html.
* List all running units, ordered by the time they took to initialize:
`systemd-analyze blame`
* Print a tree of the time-critical chain of units:
`systemd-analyze critical-chain`
* Create an SVG file showing when each system service started, highlighting the time that they spent on initialization:
`systemd-analyze plot > {{path/to/file.svg}}`
* Plot a dependency graph and convert it to an SVG file:
`systemd-analyze dot | dot -T{{svg}} > {{path/to/file.svg}}`
* Show security scores of running units:
`systemd-analyze security`"
What is timeout command,,"# timeout
> Run a command with a time limit. More information:
> https://www.gnu.org/software/coreutils/timeout.
* Run `sleep 10` and terminate it, if it runs for more than 3 seconds:
`timeout {{3s}} {{sleep 10}}`
* Specify the signal to be sent to the command after the time limit expires. (By default, TERM is sent):
`timeout --signal {{INT}} {{5s}} {{sleep 10}}`"
What is git-am command,,"# git am
> Apply patch files and create a commit. Useful when receiving commits via
> email. See also `git format-patch`, which can generate patch files. More
> information: https://git-scm.com/docs/git-am.
* Apply and commit changes following a local patch file:
`git am {{path/to/file.patch}}`
* Apply and commit changes following a remote patch file:
`curl -L {{https://example.com/file.patch}} | git apply`
* Abort the process of applying a patch file:
`git am --abort`
* Apply as much of a patch file as possible, saving failed hunks to reject files:
`git am --reject {{path/to/file.patch}}`"
What is strings command,,"# strings
> Find printable strings in an object file or binary. More information:
> https://manned.org/strings.
* Print all strings in a binary:
`strings {{path/to/file}}`
* Limit results to strings at least length characters long:
`strings -n {{length}} {{path/to/file}}`
* Prefix each result with its offset within the file:
`strings -t d {{path/to/file}}`
* Prefix each result with its offset within the file in hexadecimal:
`strings -t x {{path/to/file}}`"
What is git-pull command,,"# git pull
> Fetch branch from a remote repository and merge it to local repository. More
> information: https://git-scm.com/docs/git-pull.
* Download changes from default remote repository and merge it:
`git pull`
* Download changes from default remote repository and use fast-forward:
`git pull --rebase`
* Download changes from given remote repository and branch, then merge them into HEAD:
`git pull {{remote_name}} {{branch}}`"
What is yacc command,,"# yacc
> Generate an LALR parser (in C) with a given formal grammar specification
> file. See also: `bison`. More information: https://manned.org/man/yacc.1p.
* Create a file `y.tab.c` containing the C parser code and compile the grammar file with all necessary constant declarations for values. (Constant declarations file `y.tab.h` is created only when the `-d` flag is used):
`yacc -d {{path/to/grammar_file.y}}`
* Compile a grammar file containing the description of the parser and a report of conflicts generated by ambiguities in the grammar:
`yacc -d {{path/to/grammar_file.y}} -v`
* Compile a grammar file, and prefix output filenames with `prefix` instead of `y`:
`yacc -d {{path/to/grammar_file.y}} -v -b {{prefix}}`"
What is df command,,"# df
> Gives an overview of the filesystem disk space usage. More information:
> https://www.gnu.org/software/coreutils/df.
* Display all filesystems and their disk usage:
`df`
* Display all filesystems and their disk usage in human-readable form:
`df -h`
* Display the filesystem and its disk usage containing the given file or directory:
`df {{path/to/file_or_directory}}`
* Display statistics on the number of free inodes:
`df -i`
* Display filesystems but exclude the specified types:
`df -x {{squashfs}} -x {{tmpfs}}`"
What is ipcmk command,,"# ipcmk
> Create IPC (Inter-process Communication) resources. More information:
> https://manned.org/ipcmk.
* Create a shared memory segment:
`ipcmk --shmem {{segment_size_in_bytes}}`
* Create a semaphore:
`ipcmk --semaphore {{element_size}}`
* Create a message queue:
`ipcmk --queue`
* Create a shared memory segment with specific permissions (default is 0644):
`ipcmk --shmem {{segment_size_in_bytes}} {{octal_permissions}}`"
What is newgrp command,,"# newgrp
> Switch primary group membership. More information:
> https://manned.org/newgrp.
* Change user's primary group membership:
`newgrp {{group_name}}`
* Reset primary group membership to user's default group in `/etc/passwd`:
`newgrp`"
What is ssh-agent command,,"# ssh-agent
> Spawn an SSH Agent process. An SSH Agent holds SSH keys decrypted in memory
> until removed or the process is killed. See also `ssh-add`, which can add
> and manage keys held by an SSH Agent. More information:
> https://man.openbsd.org/ssh-agent.
* Start an SSH Agent for the current shell:
`eval $(ssh-agent)`
* Kill the currently running agent:
`ssh-agent -k`"
What is basenc command,,"# basenc
> Encode or decode file or `stdin` using a specified encoding, to `stdout`.
> More information: https://www.gnu.org/software/coreutils/basenc.
* Encode a file with base64 encoding:
`basenc --base64 {{path/to/file}}`
* Decode a file with base64 encoding:
`basenc --decode --base64 {{path/to/file}}`
* Encode from `stdin` with base32 encoding with 42 columns:
`{{command}} | basenc --base32 -w42`
* Encode from `stdin` with base32 encoding:
`{{command}} | basenc --base32`"
What is locale command,,"# locale
> Get locale-specific information. More information:
> https://manned.org/locale.
* List all global environment variables describing the user's locale:
`locale`
* List all available locales:
`locale --all-locales`
* Display all available locales and the associated metadata:
`locale --all-locales --verbose`
* Display the current date format:
`locale date_fmt`"
What is unlink command,,"# unlink
> Remove a link to a file from the filesystem. The file contents is lost if
> the link is the last one to the file. More information:
> https://www.gnu.org/software/coreutils/unlink.
* Remove the specified file if it is the last link:
`unlink {{path/to/file}}`"
What is diff3 command,,"# diff3
> Compare three files line by line. More information:
> https://www.gnu.org/software/diffutils/manual/html_node/Invoking-diff3.html.
* Compare files:
`diff3 {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`
* Show all changes, outlining conflicts:
`diff3 --show-all {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`"
What is gpasswd command,,"# gpasswd
> Administer `/etc/group` and `/etc/gshadow`. More information:
> https://manned.org/gpasswd.
* Define group administrators:
`sudo gpasswd -A {{user1,user2}} {{group}}`
* Set the list of group members:
`sudo gpasswd -M {{user1,user2}} {{group}}`
* Create a password for the named group:
`gpasswd {{group}}`
* Add a user to the named group:
`gpasswd -a {{user}} {{group}}`
* Remove a user from the named group:
`gpasswd -d {{user}} {{group}}`"
What is htop command,,"# htop
> Display dynamic real-time information about running processes. An enhanced
> version of `top`. More information: https://htop.dev/.
* Start `htop`:
`htop`
* Start `htop` displaying processes owned by a specific user:
`htop --user {{username}}`
* Sort processes by a specified `sort_item` (use `htop --sort help` for available options):
`htop --sort {{sort_item}}`
* See interactive commands while running htop:
`?`
* Switch to a different tab:
`tab`
* Display help:
`htop --help`"
What is git-show command,,"# git show
> Show various types of Git objects (commits, tags, etc.). More information:
> https://git-scm.com/docs/git-show.
* Show information about the latest commit (hash, message, changes, and other metadata):
`git show`
* Show information about a given commit:
`git show {{commit}}`
* Show information about the commit associated with a given tag:
`git show {{tag}}`
* Show information about the 3rd commit from the HEAD of a branch:
`git show {{branch}}~{{3}}`
* Show a commit's message in a single line, suppressing the diff output:
`git show --oneline -s {{commit}}`
* Show only statistics (added/removed characters) about the changed files:
`git show --stat {{commit}}`
* Show only the list of added, renamed or deleted files:
`git show --summary {{commit}}`
* Show the contents of a file as it was at a given revision (e.g. branch, tag or commit):
`git show {{revision}}:{{path/to/file}}`"
What is tar command,,"# tar
> Archiving utility. Often combined with a compression method, such as gzip or
> bzip2. More information: https://www.gnu.org/software/tar.
* [c]reate an archive and write it to a [f]ile:
`tar cf {{path/to/target.tar}} {{path/to/file1 path/to/file2 ...}}`
* [c]reate a g[z]ipped archive and write it to a [f]ile:
`tar czf {{path/to/target.tar.gz}} {{path/to/file1 path/to/file2 ...}}`
* [c]reate a g[z]ipped archive from a directory using relative paths:
`tar czf {{path/to/target.tar.gz}} --directory={{path/to/directory}} .`
* E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
`tar xvf {{path/to/source.tar[.gz|.bz2|.xz]}}`
* E[x]tract a (compressed) archive [f]ile into the target directory:
`tar xf {{path/to/source.tar[.gz|.bz2|.xz]}}
--directory={{path/to/directory}}`
* [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program:
`tar caf {{path/to/target.tar.xz}} {{path/to/file1 path/to/file2 ...}}`
* Lis[t] the contents of a tar [f]ile [v]erbosely:
`tar tvf {{path/to/source.tar}}`
* E[x]tract files matching a pattern from an archive [f]ile:
`tar xf {{path/to/source.tar}} --wildcards ""{{*.html}}""`"
What is pr command,,"# pr
> Paginate or columnate files for printing. More information:
> https://www.gnu.org/software/coreutils/pr.
* Print multiple files with a default header and footer:
`pr {{file1}} {{file2}} {{file3}}`
* Print with a custom centered header:
`pr -h ""{{header}}"" {{file1}} {{file2}} {{file3}}`
* Print with numbered lines and a custom date format:
`pr -n -D ""{{format}}"" {{file1}} {{file2}} {{file3}}`
* Print all files together, one in each column, without a header or footer:
`pr -m -T {{file1}} {{file2}} {{file3}}`
* Print, beginning at page 2 up to page 5, with a given page length (including header and footer):
`pr +{{2}}:{{5}} -l {{page_length}} {{file1}} {{file2}} {{file3}}`
* Print with an offset for each line and a truncating custom page width:
`pr -o {{offset}} -W {{width}} {{file1}} {{file2}} {{file3}}`"
What is git-restore command,,"# git restore
> Restore working tree files. Requires Git version 2.23+. See also `git
> checkout` and `git reset`. More information: https://git-scm.com/docs/git-
> restore.
* Restore an unstaged file to the version of the current commit (HEAD):
`git restore {{path/to/file}}`
* Restore an unstaged file to the version of a specific commit:
`git restore --source {{commit}} {{path/to/file}}`
* Discard all unstaged changes to tracked files:
`git restore :/`
* Unstage a file:
`git restore --staged {{path/to/file}}`
* Unstage all files:
`git restore --staged :/`
* Discard all changes to files, both staged and unstaged:
`git restore --worktree --staged :/`
* Interactively select sections of files to restore:
`git restore --patch`"
What is git-archive command,,"# git archive
> Create an archive of files from a named tree. More information: https://git-
> scm.com/docs/git-archive.
* Create a tar archive from the contents of the current HEAD and print it to `stdout`:
`git archive --verbose HEAD`
* Create a zip archive from the current HEAD and print it to `stdout`:
`git archive --verbose --format=zip HEAD`
* Same as above, but write the zip archive to file:
`git archive --verbose --output={{path/to/file.zip}} HEAD`
* Create a tar archive from the contents of the latest commit on a specific branch:
`git archive --output={{path/to/file.tar}} {{branch_name}}`
* Create a tar archive from the contents of a specific directory:
`git archive --output={{path/to/file.tar}} HEAD:{{path/to/directory}}`
* Prepend a path to each file to archive it inside a specific directory:
`git archive --output={{path/to/file.tar}} --prefix={{path/to/prepend}}/ HEAD`"
What is uname command,,"# uname
> Print details about the current machine and the operating system running on
> it. Note: for additional information about the operating system, try the
> `sw_vers` command. More information: https://ss64.com/osx/uname.html.
* Print kernel name:
`uname`
* Print system architecture and processor information:
`uname -mp`
* Print kernel name, kernel release and kernel version:
`uname -srv`
* Print system hostname:
`uname -n`
* Print all available system information:
`uname -a`"
What is tee command,,"# tee
> Read from `stdin` and write to `stdout` and files (or commands). More
> information: https://www.gnu.org/software/coreutils/tee.
* Copy `stdin` to each file, and also to `stdout`:
`echo ""example"" | tee {{path/to/file}}`
* Append to the given files, do not overwrite:
`echo ""example"" | tee -a {{path/to/file}}`
* Print `stdin` to the terminal, and also pipe it into another program for further processing:
`echo ""example"" | tee {{/dev/tty}} | {{xargs printf ""[%s]""}}`
* Create a directory called ""example"", count the number of characters in ""example"" and write ""example"" to the terminal:
`echo ""example"" | tee >(xargs mkdir) >(wc -c)`"
What is join command,,"# join
> Join lines of two sorted files on a common field. More information:
> https://www.gnu.org/software/coreutils/join.
* Join two files on the first (default) field:
`join {{file1}} {{file2}}`
* Join two files using a comma (instead of a space) as the field separator:
`join -t {{','}} {{file1}} {{file2}}`
* Join field3 of file1 with field1 of file2:
`join -1 {{3}} -2 {{1}} {{file1}} {{file2}}`
* Produce a line for each unpairable line for file1:
`join -a {{1}} {{file1}} {{file2}}`
* Join a file from `stdin`:
`cat {{path/to/file1}} | join - {{path/to/file2}}`"
What is pidof command,,"# pidof
> Gets the ID of a process using its name. More information:
> https://manned.org/pidof.
* List all process IDs with given name:
`pidof {{bash}}`
* List a single process ID with given name:
`pidof -s {{bash}}`
* List process IDs including scripts with given name:
`pidof -x {{script.py}}`
* Kill all processes with given name:
`kill $(pidof {{name}})`"
What is wait command,,"# wait
> Wait for a process to complete before proceeding. More information:
> https://manned.org/wait.
* Wait for a process to finish given its process ID (PID) and return its exit status:
`wait {{pid}}`
* Wait for all processes known to the invoking shell to finish:
`wait`"
What is git-difftool command,,"# git difftool
> Show file changes using external diff tools. Accepts the same options and
> arguments as `git diff`. See also: `git diff`. More information:
> https://git-scm.com/docs/git-difftool.
* List available diff tools:
`git difftool --tool-help`
* Set the default diff tool to meld:
`git config --global diff.tool ""{{meld}}""`
* Use the default diff tool to show staged changes:
`git difftool --staged`
* Use a specific tool (opendiff) to show changes since a given commit:
`git difftool --tool={{opendiff}} {{commit}}`"
What is wc command,,"# wc
> Count lines, words, or bytes. More information:
> https://ss64.com/osx/wc.html.
* Count lines in file:
`wc -l {{path/to/file}}`
* Count words in file:
`wc -w {{path/to/file}}`
* Count characters (bytes) in file:
`wc -c {{path/to/file}}`
* Count characters in file (taking multi-byte character sets into account):
`wc -m {{path/to/file}}`
* Use `stdin` to count lines, words and characters (bytes) in that order:
`{{find .}} | wc`"
What is passwd command,,"# passwd
> Passwd is a tool used to change a user's password. More information:
> https://manned.org/passwd.
* Change the password of the current user interactively:
`passwd`
* Change the password of a specific user:
`passwd {{username}}`
* Get the current status of the user:
`passwd -S`
* Make the password of the account blank (it will set the named account passwordless):
`passwd -d`"
What is command command,,"# command
> Command forces the shell to execute the program and ignore any functions,
> builtins and aliases with the same name. More information:
> https://manned.org/command.
* Execute the `ls` program literally, even if an `ls` alias exists:
`command {{ls}}`
* Display the path to the executable or the alias definition of a specific command:
`command -v {{command_name}}`"
What is getent command,,"# getent
> Get entries from Name Service Switch libraries. More information:
> https://manned.org/getent.
* Get list of all groups:
`getent group`
* See the members of a group:
`getent group {{group_name}}`
* Get list of all services:
`getent services`
* Find a username by UID:
`getent passwd 1000`
* Perform a reverse DNS lookup:
`getent hosts {{host}}`"
What is dd command,,"# dd
> Convert and copy a file. More information: https://keith.github.io/xcode-
> man-pages/dd.1.html.
* Make a bootable USB drive from an isohybrid file (such like `archlinux-xxx.iso`) and show the progress:
`dd if={{path/to/file.iso}} of={{/dev/usb_device}} status=progress`
* Clone a drive to another drive with 4 MB block, ignore error and show the progress:
`dd if={{/dev/source_device}} of={{/dev/dest_device}} bs={{4m}}
conv={{noerror}} status=progress`
* Generate a file of 100 random bytes by using kernel random driver:
`dd if=/dev/urandom of={{path/to/random_file}} bs={{100}} count={{1}}`
* Benchmark the write performance of a disk:
`dd if=/dev/zero of={{path/to/1GB_file}} bs={{1024}} count={{1000000}}`
* Generate a system backup into an IMG file and show the progress:
`dd if=/dev/{{drive_device}} of={{path/to/file.img}} status=progress`
* Restore a drive from an IMG file and show the progress:
`dd if={{path/to/file.img}} of={{/dev/drive_device}} status=progress`
* Check the progress of an ongoing dd operation (run this command from another shell):
`kill -USR1 $(pgrep ^dd)`"
What is join command,,"# join
> Join lines of two sorted files on a common field. More information:
> https://www.gnu.org/software/coreutils/join.
* Join two files on the first (default) field:
`join {{file1}} {{file2}}`
* Join two files using a comma (instead of a space) as the field separator:
`join -t {{','}} {{file1}} {{file2}}`
* Join field3 of file1 with field1 of file2:
`join -1 {{3}} -2 {{1}} {{file1}} {{file2}}`
* Produce a line for each unpairable line for file1:
`join -a {{1}} {{file1}} {{file2}}`
* Join a file from `stdin`:
`cat {{path/to/file1}} | join - {{path/to/file2}}`"
What is bg command,,"# bg
> Resumes jobs that have been suspended (e.g. using `Ctrl + Z`), and keeps
> them running in the background. More information: https://manned.org/bg.
* Resume the most recently suspended job and run it in the background:
`bg`
* Resume a specific job (use `jobs -l` to get its ID) and run it in the background:
`bg %{{job_id}}`"
What is git-var command,,"# git var
> Prints a Git logical variable's value. See `git config`, which is preferred
> over `git var`. More information: https://git-scm.com/docs/git-var.
* Print the value of a Git logical variable:
`git var {{GIT_AUTHOR_IDENT|GIT_COMMITTER_IDENT|GIT_EDITOR|GIT_PAGER}}`
* [l]ist all Git logical variables:
`git var -l`"
What is make command,,"# make
> Task runner for targets described in Makefile. Mostly used to control the
> compilation of an executable from source code. More information:
> https://www.gnu.org/software/make/manual/make.html.
* Call the first target specified in the Makefile (usually named ""all""):
`make`
* Call a specific target:
`make {{target}}`
* Call a specific target, executing 4 jobs at a time in parallel:
`make -j{{4}} {{target}}`
* Use a specific Makefile:
`make --file {{path/to/file}}`
* Execute make from another directory:
`make --directory {{path/to/directory}}`
* Force making of a target, even if source files are unchanged:
`make --always-make {{target}}`
* Override a variable defined in the Makefile:
`make {{target}} {{variable}}={{new_value}}`
* Override variables defined in the Makefile by the environment:
`make --environment-overrides {{target}}`"
What is uudecode command,,"# uudecode
> Decode files encoded by `uuencode`. More information:
> https://manned.org/uudecode.
* Decode a file that was encoded with `uuencode` and print the result to `stdout`:
`uudecode {{path/to/encoded_file}}`
* Decode a file that was encoded with `uuencode` and write the result to a file:
`uudecode -o {{path/to/decoded_file}} {{path/to/encoded_file}}`"
What is diff command,,"# diff
> Compare files and directories. More information: https://man7.org/linux/man-
> pages/man1/diff.1.html.
* Compare files (lists changes to turn `old_file` into `new_file`):
`diff {{old_file}} {{new_file}}`
* Compare files, ignoring white spaces:
`diff --ignore-all-space {{old_file}} {{new_file}}`
* Compare files, showing the differences side by side:
`diff --side-by-side {{old_file}} {{new_file}}`
* Compare files, showing the differences in unified format (as used by `git diff`):
`diff --unified {{old_file}} {{new_file}}`
* Compare directories recursively (shows names for differing files/directories as well as changes made to files):
`diff --recursive {{old_directory}} {{new_directory}}`
* Compare directories, only showing the names of files that differ:
`diff --recursive --brief {{old_directory}} {{new_directory}}`
* Create a patch file for Git from the differences of two text files, treating nonexistent files as empty:
`diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}`"
What is ln command,,"# ln
> Creates links to files and directories. More information:
> https://www.gnu.org/software/coreutils/ln.
* Create a symbolic link to a file or directory:
`ln -s {{/path/to/file_or_directory}} {{path/to/symlink}}`
* Overwrite an existing symbolic link to point to a different file:
`ln -sf {{/path/to/new_file}} {{path/to/symlink}}`
* Create a hard link to a file:
`ln {{/path/to/file}} {{path/to/hardlink}}`"
What is cal command,,"# cal
> Prints calendar information. More information:
> https://ss64.com/osx/cal.html.
* Display a calendar for the current month:
`cal`
* Display previous, current and next month:
`cal -3`
* Display a calendar for a specific month (1-12 or name):
`cal -m {{month}}`
* Display a calendar for the current year:
`cal -y`
* Display a calendar for a specific year (4 digits):
`cal {{year}}`
* Display a calendar for a specific month and year:
`cal {{month}} {{year}}`
* Display date of Easter (Western Christian churches) in a given year:
`ncal -e {{year}}`"
What is file command,,"# file
> Determine file type. More information: https://manned.org/file.
* Give a description of the type of the specified file. Works fine for files with no file extension:
`file {{path/to/file}}`
* Look inside a zipped file and determine the file type(s) inside:
`file -z {{foo.zip}}`
* Allow file to work with special or device files:
`file -s {{path/to/file}}`
* Don't stop at first file type match; keep going until the end of the file:
`file -k {{path/to/file}}`
* Determine the MIME encoding type of a file:
`file -i {{path/to/file}}`"
What is vi command,,"# vi
> This command is an alias of `vim`.
* View documentation for the original command:
`tldr vim`"
What is pwdx command,,"# pwdx
> Print working directory of a process. More information:
> https://manned.org/pwdx.
* Print current working directory of a process:
`pwdx {{process_id}}`"
What is locate command,,"# locate
> Find filenames quickly. More information: https://manned.org/locate.
* Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
`locate ""{{pattern}}""`
* Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`):
`locate */{{filename}}`
* Recompute the database. You need to do it if you want to find recently added files:
`sudo /usr/libexec/locate.updatedb`"
What is rm command,,"# rm
> Remove files or directories. See also: `rmdir`. More information:
> https://www.gnu.org/software/coreutils/rm.
* Remove specific files:
`rm {{path/to/file1 path/to/file2 ...}}`
* Remove specific files ignoring nonexistent ones:
`rm -f {{path/to/file1 path/to/file2 ...}}`
* Remove specific files [i]nteractively prompting before each removal:
`rm -i {{path/to/file1 path/to/file2 ...}}`
* Remove specific files printing info about each removal:
`rm -v {{path/to/file1 path/to/file2 ...}}`
* Remove specific files and directories [r]ecursively:
`rm -r {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`"
What is ldapsearch command,,"# ldapsearch
> Query an LDAP directory. More information: https://docs.ldap.com/ldap-
> sdk/docs/tool-usages/ldapsearch.html.
* Query an LDAP server for all items that are a member of the given group and return the object's displayName value:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}} -b
{{base_ou}} '{{memberOf=group1}}' displayName`
* Query an LDAP server with a no-newline password file for all items that are a member of the given group and return the object's displayName value:
`ldapsearch -D '{{admin_DN}}' -y '{{password_file}}' -h {{ldap_host}} -b
{{base_ou}} '{{memberOf=group1}}' displayName`
* Return 5 items that match the given filter:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}} -b
{{base_ou}} '{{memberOf=group1}}' -z 5 displayName`
* Wait up to 7 seconds for a response:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}} -b
{{base_ou}} '{{memberOf=group1}}' -l 7 displayName`
* Invert the filter:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}} -b
{{base_ou}} '(!(memberOf={{group1}}))' displayName`
* Return all items that are part of multiple groups, returning the display name for each item:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}}
'(&({{memberOf=group1}})({{memberOf=group2}})({{memberOf=group3}}))'
""displayName""`
* Return all items that are members of at least 1 of the specified groups:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}}
'(|({{memberOf=group1}})({{memberOf=group1}})({{memberOf=group3}}))'
displayName`
* Combine multiple boolean logic filters:
`ldapsearch -D '{{admin_DN}}' -w '{{password}}' -h {{ldap_host}}
'(&({{memberOf=group1}})({{memberOf=group2}})(!({{memberOf=group3}})))'
displayName`"
What is git-clean command,,"# git clean
> Remove untracked files from the working tree. More information: https://git-
> scm.com/docs/git-clean.
* Delete files that are not tracked by Git:
`git clean`
* Interactively delete files that are not tracked by Git:
`git clean -i`
* Show what files would be deleted without actually deleting them:
`git clean --dry-run`
* Forcefully delete files that are not tracked by Git:
`git clean -f`
* Forcefully delete directories that are not tracked by Git:
`git clean -fd`
* Delete untracked files, including ignored files in `.gitignore` and `.git/info/exclude`:
`git clean -x`"
What is git-bugreport command,,"# git bugreport
> Captures debug information from the system and user, generating a text file
> to aid in the reporting of a bug in Git. More information: https://git-
> scm.com/docs/git-bugreport.
* Create a new bug report file in the current directory:
`git bugreport`
* Create a new bug report file in the specified directory, creating it if it does not exist:
`git bugreport --output-directory {{path/to/directory}}`
* Create a new bug report file with the specified filename suffix in `strftime` format:
`git bugreport --suffix {{%m%d%y}}`"
What is keyctl command,,"# keyctl
> Manipulate the Linux kernel keyring. More information:
> https://manned.org/keyctl.
* List keys in a specific keyring:
`keyctl list {{target_keyring}}`
* List current keys in the user default session:
`keyctl list {{@us}}`
* Store a key in a specific keyring:
`keyctl add {{type_keyring}} {{key_name}} {{key_value}} {{target_keyring}}`
* Store a key with its value from `stdin`:
`echo -n {{key_value}} | keyctl padd {{type_keyring}} {{key_name}}
{{target_keyring}}`
* Put a timeout on a key:
`keyctl timeout {{key_name}} {{timeout_in_seconds}}`
* Read a key and format it as a hex-dump if not printable:
`keyctl read {{key_name}}`
* Read a key and format as-is:
`keyctl pipe {{key_name}}`
* Revoke a key and prevent any further action on it:
`keyctl revoke {{key_name}}`"
What is dpkg-query command,,"# dpkg-query
> A tool that shows information about installed packages. More information:
> https://manpages.debian.org/latest/dpkg/dpkg-query.1.html.
* List all installed packages:
`dpkg-query --list`
* List installed packages matching a pattern:
`dpkg-query --list '{{libc6*}}'`
* List all files installed by a package:
`dpkg-query --listfiles {{libc6}}`
* Show information about a package:
`dpkg-query --status {{libc6}}`
* Search for packages that own files matching a pattern:
`dpkg-query --search {{/etc/ld.so.conf.d}}`"
What is git-blame command,,"# git blame
> Show commit hash and last author on each line of a file. More information:
> https://git-scm.com/docs/git-blame.
* Print file with author name and commit hash on each line:
`git blame {{path/to/file}}`
* Print file with author email and commit hash on each line:
`git blame -e {{path/to/file}}`
* Print file with author name and commit hash on each line at a specific commit:
`git blame {{commit}} {{path/to/file}}`
* Print file with author name and commit hash on each line before a specific commit:
`git blame {{commit}}~ {{path/to/file}}`"
What is login command,,"# login
> Initiates a session for a user. More information: https://manned.org/login.
* Log in as a user:
`login {{user}}`
* Log in as user without authentication if user is preauthenticated:
`login -f {{user}}`
* Log in as user and preserve environment:
`login -p {{user}}`
* Log in as a user on a remote host:
`login -h {{host}} {{user}}`"
What is git-show-index command,,"# git show-index
> Show the packed archive index of a Git repository. More information:
> https://git-scm.com/docs/git-show-index.
* Read an IDX file for a Git packfile and dump its contents to `stdout`:
`git show-index {{path/to/file.idx}}`
* Specify the hash algorithm for the index file (experimental):
`git show-index --object-format={{sha1|sha256}} {{path/to/file}}`"
What is crontab command,,"# crontab
> Schedule cron jobs to run on a time interval for the current user. More
> information: https://crontab.guru/.
* Edit the crontab file for the current user:
`crontab -e`
* Edit the crontab file for a specific user:
`sudo crontab -e -u {{user}}`
* Replace the current crontab with the contents of the given file:
`crontab {{path/to/file}}`
* View a list of existing cron jobs for current user:
`crontab -l`
* Remove all cron jobs for the current user:
`crontab -r`
* Sample job which runs at 10:00 every day (* means any value):
`0 10 * * * {{command_to_execute}}`
* Sample crontab entry, which runs a command every 10 minutes:
`*/10 * * * * {{command_to_execute}}`
* Sample crontab entry, which runs a certain script at 02:30 every Friday:
`30 2 * * Fri {{/absolute/path/to/script.sh}}`"
What is install command,,"# install
> Copy files and set attributes. Copy files (often executable) to a system
> location like `/usr/local/bin`, give them the appropriate
> permissions/ownership. More information:
> https://www.gnu.org/software/coreutils/install.
* Copy files to the destination:
`install {{path/to/source_file1 path/to/source_file2 ...}}
{{path/to/destination}}`
* Copy files to the destination, setting their ownership:
`install --owner {{user}} {{path/to/source_file1 path/to/source_file2 ...}}
{{path/to/destination}}`
* Copy files to the destination, setting their group ownership:
`install --group {{user}} {{path/to/source_file1 path/to/source_file2 ...}}
{{path/to/destination}}`
* Copy files to the destination, setting their `mode`:
`install --mode {{+x}} {{path/to/source_file1 path/to/source_file2 ...}}
{{path/to/destination}}`
* Copy files and apply access/modification times of source to the destination:
`install --preserve-timestamps {{path/to/source_file1 path/to/source_file2
...}} {{path/to/destination}}`
* Copy files and create the directories at the destination if they don't exist:
`install -D {{path/to/source_file1 path/to/source_file2 ...}}
{{path/to/destination}}`"
What is colrm command,,"# colrm
> Remove columns from `stdin`. More information: https://manned.org/colrm.
* Remove first column of `stdin`:
`colrm {{1 1}}`
* Remove from 3rd column till the end of each line:
`colrm {{3}}`
* Remove from the 3rd column till the 5th column of each line:
`colrm {{3 5}}`"
What is resolvectl command,,"# resolvectl
> Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and
> services. Introspect and reconfigure the DNS resolver. More information:
> https://www.freedesktop.org/software/systemd/man/resolvectl.html.
* Show DNS settings:
`resolvectl status`
* Resolve the IPv4 and IPv6 addresses for one or more domains:
`resolvectl query {{domain1 domain2 ...}}`
* Retrieve the domain of a specified IP address:
`resolvectl query {{ip_address}}`
* Retrieve an MX record of a domain:
`resolvectl --legend={{no}} --type={{MX}} query {{domain}}`
* Resolve an SRV record, for example _xmpp-server._tcp gmail.com:
`resolvectl service _{{service}}._{{protocol}} {{name}}`
* Retrieve the public key from an email address from an OPENPGPKEY DNS record:
`resolvectl openpgp {{email}}`
* Retrieve a TLS key:
`resolvectl tlsa tcp {{domain}}:443`"
What is ssh-keygen command,,"# ssh-keygen
> Generate ssh keys used for authentication, password-less logins, and other
> things. More information: https://man.openbsd.org/ssh-keygen.
* Generate a key interactively:
`ssh-keygen`
* Generate an ed25519 key with 32 key derivation function rounds and save the key to a specific file:
`ssh-keygen -t {{ed25519}} -a {{32}} -f {{~/.ssh/filename}}`
* Generate an RSA 4096-bit key with email as a comment:
`ssh-keygen -t {{rsa}} -b {{4096}} -C ""{{comment|email}}""`
* Remove the keys of a host from the known_hosts file (useful when a known host has a new key):
`ssh-keygen -R {{remote_host}}`
* Retrieve the fingerprint of a key in MD5 Hex:
`ssh-keygen -l -E {{md5}} -f {{~/.ssh/filename}}`
* Change the password of a key:
`ssh-keygen -p -f {{~/.ssh/filename}}`
* Change the type of the key format (for example from OPENSSH format to PEM), the file will be rewritten in-place:
`ssh-keygen -p -N """" -m {{PEM}} -f {{~/.ssh/OpenSSH_private_key}}`
* Retrieve public key from secret key:
`ssh-keygen -y -f {{~/.ssh/OpenSSH_private_key}}`"
What is pidstat command,,"# pidstat
> Show system resource usage, including CPU, memory, IO etc. More information:
> https://manned.org/pidstat.
* Show CPU statistics at a 2 second interval for 10 times:
`pidstat {{2}} {{10}}`
* Show page faults and memory utilization:
`pidstat -r`
* Show input/output usage per process id:
`pidstat -d`
* Show information on a specific PID:
`pidstat -p {{PID}}`
* Show memory statistics for all processes whose command name include ""fox"" or ""bird"":
`pidstat -C ""{{fox|bird}}"" -r -p ALL`"
What is git-stash command,,"# git stash
> Stash local Git changes in a temporary area. More information: https://git-
> scm.com/docs/git-stash.
* Stash current changes, except new (untracked) files:
`git stash push -m {{optional_stash_message}}`
* Stash current changes, including new (untracked) files:
`git stash -u`
* Interactively select parts of changed files for stashing:
`git stash -p`
* List all stashes (shows stash name, related branch and message):
`git stash list`
* Show the changes as a patch between the stash (default is stash@{0}) and the commit back when stash entry was first created:
`git stash show -p {{stash@{0}}}`
* Apply a stash (default is the latest, named stash@{0}):
`git stash apply {{optional_stash_name_or_commit}}`
* Drop or apply a stash (default is stash@{0}) and remove it from the stash list if applying doesn't cause conflicts:
`git stash pop {{optional_stash_name}}`
* Drop all stashes:
`git stash clear`"
What is git-bisect command,,"# git bisect
> Use binary search to find the commit that introduced a bug. Git
> automatically jumps back and forth in the commit graph to progressively
> narrow down the faulty commit. More information: https://git-
> scm.com/docs/git-bisect.
* Start a bisect session on a commit range bounded by a known buggy commit, and a known clean (typically older) one:
`git bisect start {{bad_commit}} {{good_commit}}`
* For each commit that `git bisect` selects, mark it as ""bad"" or ""good"" after testing it for the issue:
`git bisect {{good|bad}}`
* After `git bisect` pinpoints the faulty commit, end the bisect session and return to the previous branch:
`git bisect reset`
* Skip a commit during a bisect (e.g. one that fails the tests due to a different issue):
`git bisect skip`
* Display a log of what has been done so far:
`git bisect log`"
What is systemd-ac-power command,,"# systemd-ac-power
> Report whether the computer is connected to an external power source. More
> information: https://www.freedesktop.org/software/systemd/man/systemd-ac-
> power.html.
* Silently check and return a 0 status code when running on AC power, and a non-zero code otherwise:
`systemd-ac-power`
* Additionally print `yes` or `no` to `stdout`:
`systemd-ac-power --verbose`"
What is getopt command,,"# getopt
> Parse command-line arguments. More information:
> https://www.gnu.org/software/libc/manual/html_node/Getopt.html.
* Parse optional `verbose`/`version` flags with shorthands:
`getopt --options vV --longoptions verbose,version -- --version --verbose`
* Add a `--file` option with a required argument with shorthand `-f`:
`getopt --options f: --longoptions file: -- --file=somefile`
* Add a `--verbose` option with an optional argument with shorthand `-v`, and pass a non-option parameter `arg`:
`getopt --options v:: --longoptions verbose:: -- --verbose arg`
* Accept a `-r` and `--verbose` flag, a `--accept` option with an optional argument and add a `--target` with a required argument option with shorthands:
`getopt --options rv::s::t: --longoptions verbose,source::,target: -- -v
--target target`"
What is pkill command,,"# pkill
> Signal process by name. Mostly used for stopping processes. More
> information: https://www.man7.org/linux/man-pages/man1/pkill.1.html.
* Kill all processes which match:
`pkill ""{{process_name}}""`
* Kill all processes which match their full command instead of just the process name:
`pkill -f ""{{command_name}}""`
* Force kill matching processes (can't be blocked):
`pkill -9 ""{{process_name}}""`
* Send SIGUSR1 signal to processes which match:
`pkill -USR1 ""{{process_name}}""`
* Kill the main `firefox` process to close the browser:
`pkill --oldest ""{{firefox}}""`"
What is ssh-keyscan command,,"# ssh-keyscan
> Get the public ssh keys of remote hosts. More information:
> https://man.openbsd.org/ssh-keyscan.
* Retrieve all public ssh keys of a remote host:
`ssh-keyscan {{host}}`
* Retrieve all public ssh keys of a remote host listening on a specific port:
`ssh-keyscan -p {{port}} {{host}}`
* Retrieve certain types of public ssh keys of a remote host:
`ssh-keyscan -t {{rsa,dsa,ecdsa,ed25519}} {{host}}`
* Manually update the ssh known_hosts file with the fingerprint of a given host:
`ssh-keyscan -H {{host}} >> ~/.ssh/known_hosts`"
What is test command,,"# test
> Check file types and compare values. Returns 0 if the condition evaluates to
> true, 1 if it evaluates to false. More information:
> https://www.gnu.org/software/coreutils/test.
* Test if a given variable is equal to a given string:
`test ""{{$MY_VAR}}"" == ""{{/bin/zsh}}""`
* Test if a given variable is empty:
`test -z ""{{$GIT_BRANCH}}""`
* Test if a file exists:
`test -f ""{{path/to/file_or_directory}}""`
* Test if a directory does not exist:
`test ! -d ""{{path/to/directory}}""`
* If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):
`test {{condition}} && {{echo ""true""}} || {{echo ""false""}}`"
What is systemd-notify command,,"# systemd-notify
> Notify the service manager about start-up completion and other daemon status
> changes. This command is useless outside systemd service scripts. More
> information: https://www.freedesktop.org/software/systemd/man/systemd-
> notify.html.
* Notify systemd that the service has completed its initialization and is fully started. It should be invoked when the service is ready to accept incoming requests:
`systemd-notify --booted`
* Signal to systemd that the service is ready to handle incoming connections or perform its tasks:
`systemd-notify --ready`
* Provide a custom status message to systemd (this information is shown by `systemctl status`):
`systemd-notify --status=""{{Add custom status message here...}}""`"
What is pr command,,"# pr
> Paginate or columnate files for printing. More information:
> https://www.gnu.org/software/coreutils/pr.
* Print multiple files with a default header and footer:
`pr {{file1}} {{file2}} {{file3}}`
* Print with a custom centered header:
`pr -h ""{{header}}"" {{file1}} {{file2}} {{file3}}`
* Print with numbered lines and a custom date format:
`pr -n -D ""{{format}}"" {{file1}} {{file2}} {{file3}}`
* Print all files together, one in each column, without a header or footer:
`pr -m -T {{file1}} {{file2}} {{file3}}`
* Print, beginning at page 2 up to page 5, with a given page length (including header and footer):
`pr +{{2}}:{{5}} -l {{page_length}} {{file1}} {{file2}} {{file3}}`
* Print with an offset for each line and a truncating custom page width:
`pr -o {{offset}} -W {{width}} {{file1}} {{file2}} {{file3}}`"
What is git-symbolic-ref command,,"# git symbolic-ref
> Read, change, or delete files that store references. More information:
> https://git-scm.com/docs/git-symbolic-ref.
* Store a reference by a name:
`git symbolic-ref refs/{{name}} {{ref}}`
* Store a reference by name, including a message with a reason for the update:
`git symbolic-ref -m ""{{message}}"" refs/{{name}} refs/heads/{{branch_name}}`
* Read a reference by name:
`git symbolic-ref refs/{{name}}`
* Delete a reference by name:
`git symbolic-ref --delete refs/{{name}}`
* For scripting, hide errors with `--quiet` and use `--short` to simplify (""refs/heads/X"" prints as ""X""):
`git symbolic-ref --quiet --short refs/{{name}}`"
What is tty command,,"# tty
> Returns terminal name. More information:
> https://www.gnu.org/software/coreutils/tty.
* Print the file name of this terminal:
`tty`"
What is git-instaweb command,,"# git instaweb
> Helper to launch a GitWeb server. More information: https://git-
> scm.com/docs/git-instaweb.
* Launch a GitWeb server for the current Git repository:
`git instaweb --start`
* Listen only on localhost:
`git instaweb --start --local`
* Listen on a specific port:
`git instaweb --start --port {{1234}}`
* Use a specified HTTP daemon:
`git instaweb --start --httpd {{lighttpd|apache2|mongoose|plackup|webrick}}`
* Also auto-launch a web browser:
`git instaweb --start --browser`
* Stop the currently running GitWeb server:
`git instaweb --stop`
* Restart the currently running GitWeb server:
`git instaweb --restart`"
What is newgrp command,,"# newgrp
> Switch primary group membership. More information:
> https://manned.org/newgrp.
* Change user's primary group membership:
`newgrp {{group_name}}`
* Reset primary group membership to user's default group in `/etc/passwd`:
`newgrp`"
What is dircolors command,,"# dircolors
> Output commands to set the LS_COLOR environment variable and style `ls`,
> `dir`, etc. More information:
> https://www.gnu.org/software/coreutils/dircolors.
* Output commands to set LS_COLOR using default colors:
`dircolors`
* Output commands to set LS_COLOR using colors from a file:
`dircolors {{path/to/file}}`
* Output commands for Bourne shell:
`dircolors --bourne-shell`
* Output commands for C shell:
`dircolors --c-shell`
* View the default colors for file types and extensions:
`dircolors --print-data`"
What is utmpdump command,,"# utmpdump
> Dump and load btmp, utmp and wtmp accounting files. More information:
> https://manned.org/utmpdump.
* Dump the `/var/log/wtmp` file to `stdout` as plain text:
`utmpdump {{/var/log/wtmp}}`
* Load a previously dumped file into `/var/log/wtmp`:
`utmpdump -r {{dumpfile}} > {{/var/log/wtmp}}`"
What is lp command,,"# lp
> Print files. More information: https://manned.org/lp.
* Print the output of a command to the default printer (see `lpstat` command):
`echo ""test"" | lp`
* Print a file to the default printer:
`lp {{path/to/filename}}`
* Print a file to a named printer (see `lpstat` command):
`lp -d {{printer_name}} {{path/to/filename}}`
* Print N copies of file to default printer (replace N with desired number of copies):
`lp -n {{N}} {{path/to/filename}}`
* Print only certain pages to the default printer (print pages 1, 3-5, and 16):
`lp -P 1,3-5,16 {{path/to/filename}}`
* Resume printing a job:
`lp -i {{job_id}} -H resume`"
What is git-verify-tag command,,"# git verify-tag
> Check for GPG verification of tags. If a tag wasn't signed, an error will
> occur. More information: https://git-scm.com/docs/git-verify-tag.
* Check tags for a GPG signature:
`git verify-tag {{tag1 optional_tag2 ...}}`
* Check tags for a GPG signature and show details for each tag:
`git verify-tag {{tag1 optional_tag2 ...}} --verbose`
* Check tags for a GPG signature and print the raw details:
`git verify-tag {{tag1 optional_tag2 ...}} --raw`"
What is du command,,"# du
> Disk usage: estimate and summarize file and directory space usage. More
> information: https://ss64.com/osx/du.html.
* List the sizes of a directory and any subdirectories, in the given unit (KiB/MiB/GiB):
`du -{{k|m|g}} {{path/to/directory}}`
* List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
`du -h {{path/to/directory}}`
* Show the size of a single directory, in human-readable units:
`du -sh {{path/to/directory}}`
* List the human-readable sizes of a directory and of all the files and directories within it:
`du -ah {{path/to/directory}}`
* List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
`du -h -d {{2}} {{path/to/directory}}`
* List the human-readable size of all `.jpg` files in subdirectories of the current directory, and show a cumulative total at the end:
`du -ch {{*/*.jpg}}`"
What is pgrep command,,"# pgrep
> Find or signal processes by name. More information:
> https://www.man7.org/linux/man-pages/man1/pkill.1.html.
* Return PIDs of any running processes with a matching command string:
`pgrep {{process_name}}`
* Search for processes including their command-line options:
`pgrep --full ""{{process_name}} {{parameter}}""`
* Search for processes run by a specific user:
`pgrep --euid root {{process_name}}`"
What is bc command,,"# bc
> An arbitrary precision calculator language. See also: `dc`. More
> information: https://manned.org/man/freebsd-13.0/bc.1.
* Start an interactive session:
`bc`
* Start an interactive session with the standard math library enabled:
`bc --mathlib`
* Calculate an expression:
`bc --expression='{{5 / 3}}'`
* Execute a script:
`bc {{path/to/script.bc}}`
* Calculate an expression with the specified scale:
`bc --expression='scale = {{10}}; {{5 / 3}}'`
* Calculate a sine/cosine/arctangent/natural logarithm/exponential function using `mathlib`:
`bc --mathlib --expression='{{s|c|a|l|e}}({{1}})'`"
What is git-credential-cache command,,"# git credential-cache
> Git helper to temporarily store passwords in memory. More information:
> https://git-scm.com/docs/git-credential-cache.
* Store Git credentials for a specific amount of time:
`git config credential.helper 'cache --timeout={{time_in_seconds}}'`"
What is git-log command,,"# git log
> Show a history of commits. More information: https://git-scm.com/docs/git-
> log.
* Show the sequence of commits starting from the current one, in reverse chronological order of the Git repository in the current working directory:
`git log`
* Show the history of a particular file or directory, including differences:
`git log -p {{path/to/file_or_directory}}`
* Show an overview of which file(s) changed in each commit:
`git log --stat`
* Show a graph of commits in the current branch using only the first line of each commit message:
`git log --oneline --graph`
* Show a graph of all commits, tags and branches in the entire repo:
`git log --oneline --decorate --all --graph`
* Show only commits whose messages include a given string (case-insensitively):
`git log -i --grep {{search_string}}`
* Show the last N commits from a certain author:
`git log -n {{number}} --author={{author}}`
* Show commits between two dates (yyyy-mm-dd):
`git log --before=""{{2017-01-29}}"" --after=""{{2017-01-17}}""`"
What is quota command,,"# quota
> Display users' disk space usage and allocated limits. More information:
> https://manned.org/quota.
* Show disk quotas in human-readable units for the current user:
`quota -s`
* Verbose output (also display quotas on filesystems where no storage is allocated):
`quota -v`
* Quiet output (only display quotas on filesystems where usage is over quota):
`quota -q`
* Print quotas for the groups of which the current user is a member:
`quota -g`
* Show disk quotas for another user:
`sudo quota -u {{username}}`"
What is git-format-patch command,,"# git format-patch
> Prepare .patch files. Useful when emailing commits elsewhere. See also `git
> am`, which can apply generated .patch files. More information: https://git-
> scm.com/docs/git-format-patch.
* Create an auto-named `.patch` file for all the unpushed commits:
`git format-patch {{origin}}`
* Write a `.patch` file for all the commits between 2 revisions to `stdout`:
`git format-patch {{revision_1}}..{{revision_2}}`
* Write a `.patch` file for the 3 latest commits:
`git format-patch -{{3}}`"
What is false command,,"# false
> Returns a non-zero exit code. More information:
> https://www.gnu.org/software/coreutils/false.
* Return a non-zero exit code:
`false`"
What is iconv command,,"# iconv
> Converts text from one encoding to another. More information:
> https://manned.org/iconv.
* Convert file to a specific encoding, and print to `stdout`:
`iconv -f {{from_encoding}} -t {{to_encoding}} {{input_file}}`
* Convert file to the current locale's encoding, and output to a file:
`iconv -f {{from_encoding}} {{input_file}} > {{output_file}}`
* List supported encodings:
`iconv -l`"
What is sync command,,"# sync
> Flushes all pending write operations to the appropriate disks. More
> information: https://www.gnu.org/software/coreutils/sync.
* Flush all pending write operations on all disks:
`sync`
* Flush all pending write operations on a single file to disk:
`sync {{path/to/file}}`"
What is diff command,,"# diff
> Compare files and directories. More information: https://man7.org/linux/man-
> pages/man1/diff.1.html.
* Compare files (lists changes to turn `old_file` into `new_file`):
`diff {{old_file}} {{new_file}}`
* Compare files, ignoring white spaces:
`diff --ignore-all-space {{old_file}} {{new_file}}`
* Compare files, showing the differences side by side:
`diff --side-by-side {{old_file}} {{new_file}}`
* Compare files, showing the differences in unified format (as used by `git diff`):
`diff --unified {{old_file}} {{new_file}}`
* Compare directories recursively (shows names for differing files/directories as well as changes made to files):
`diff --recursive {{old_directory}} {{new_directory}}`
* Compare directories, only showing the names of files that differ:
`diff --recursive --brief {{old_directory}} {{new_directory}}`
* Create a patch file for Git from the differences of two text files, treating nonexistent files as empty:
`diff --text --unified --new-file {{old_file}} {{new_file}} > {{diff.patch}}`"
What is rmdir command,,"# rmdir
> Remove directories without files. See also: `rm`. More information:
> https://www.gnu.org/software/coreutils/rmdir.
* Remove specific directories:
`rmdir {{path/to/directory1 path/to/directory2 ...}}`
* Remove specific nested directories recursively:
`rmdir -p {{path/to/directory1 path/to/directory2 ...}}`"
What is shuf command,,"# shuf
> Generate random permutations. More information: https://www.unix.com/man-
> page/linux/1/shuf/.
* Randomize the order of lines in a file and output the result:
`shuf {{filename}}`
* Only output the first 5 entries of the result:
`shuf --head-count={{5}} {{filename}}`
* Write output to another file:
`shuf {{filename}} --output={{output_filename}}`
* Generate random numbers in range 1-10:
`shuf --input-range={{1-10}}`"
What is git-bundle command,,"# git bundle
> Package objects and references into an archive. More information:
> https://git-scm.com/docs/git-bundle.
* Create a bundle file that contains all objects and references of a specific branch:
`git bundle create {{path/to/file.bundle}} {{branch_name}}`
* Create a bundle file of all branches:
`git bundle create {{path/to/file.bundle}} --all`
* Create a bundle file of the last 5 commits of the current branch:
`git bundle create {{path/to/file.bundle}} -{{5}} {{HEAD}}`
* Create a bundle file of the latest 7 days:
`git bundle create {{path/to/file.bundle}} --since={{7.days}} {{HEAD}}`
* Verify that a bundle file is valid and can be applied to the current repository:
`git bundle verify {{path/to/file.bundle}}`
* Print to `stdout` the list of references contained in a bundle:
`git bundle unbundle {{path/to/file.bundle}}`
* Unbundle a specific branch from a bundle file into the current repository:
`git pull {{path/to/file.bundle}} {{branch_name}}`"
What is link command,,"# link
> Create a hard link to an existing file. For more options, see the `ln`
> command. More information: https://www.gnu.org/software/coreutils/link.
* Create a hard link from a new file to an existing file:
`link {{path/to/existing_file}} {{path/to/new_file}}`"
What is systemd-delta command,,"# systemd-delta
> Find overridden systemd-related configuration files. More information:
> https://www.freedesktop.org/software/systemd/man/systemd-delta.html.
* Show all overridden configuration files:
`systemd-delta`
* Show only files of specific types (comma-separated list):
`systemd-delta --type
{{masked|equivalent|redirected|overridden|extended|unchanged}}`
* Show only files whose path starts with the specified prefix (Note: a prefix is a directory containing subdirectories with systemd configuration files):
`systemd-delta {{/etc|/run|/usr/lib|...}}`
* Further restrict the search path by adding a suffix (the prefix is optional):
`systemd-delta {{prefix}}/{{tmpfiles.d|sysctl.d|systemd/system|...}}`"
What is namei command,,"# namei
> Follows a pathname (which can be a symbolic link) until a terminal point is
> found (a file/directory/char device etc). This program is useful for finding
> ""too many levels of symbolic links"" problems. More information:
> https://manned.org/namei.
* Resolve the pathnames specified as the argument parameters:
`namei {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Display the results in a long-listing format:
`namei --long {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Show the mode bits of each file type in the style of `ls`:
`namei --modes {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Show owner and group name of each file:
`namei --owners {{path/to/a}} {{path/to/b}} {{path/to/c}}`
* Don't follow symlinks while resolving:
`namei --nosymlinks {{path/to/a}} {{path/to/b}} {{path/to/c}}`"
What is lastcomm command,,"# lastcomm
> Show last commands executed. More information:
> https://manpages.debian.org/latest/acct/lastcomm.1.en.html.
* Print information about all the commands in the acct (record file):
`lastcomm`
* Display commands executed by a given user:
`lastcomm --user {{user}}`
* Display information about a given command executed on the system:
`lastcomm --command {{command}}`
* Display information about commands executed on a given terminal:
`lastcomm --tty {{terminal_name}}`"
What is egrep command,,"# egrep
> Find patterns in files using extended regular expression (supports `?`, `+`,
> `{}`, `()` and `|`). More information: https://manned.org/egrep.
* Search for a pattern within a file:
`egrep ""{{search_pattern}}"" {{path/to/file}}`
* Search for a pattern within multiple files:
`egrep ""{{search_pattern}}"" {{path/to/file1}} {{path/to/file2}}
{{path/to/file3}}`
* Search `stdin` for a pattern:
`cat {{path/to/file}} | egrep {{search_pattern}}`
* Print file name and line number for each match:
`egrep --with-filename --line-number ""{{search_pattern}}"" {{path/to/file}}`
* Search for a pattern in all files recursively in a directory, ignoring binary files:
`egrep --recursive --binary-files={{without-match}} ""{{search_pattern}}""
{{path/to/directory}}`
* Search for lines that do not match a pattern:
`egrep --invert-match ""{{search_pattern}}"" {{path/to/file}}`"
What is setfacl command,,"# setfacl
> Set file access control lists (ACL). More information:
> https://manned.org/setfacl.
* Modify ACL of a file for user with read and write access:
`setfacl -m u:{{username}}:rw {{file}}`
* Modify default ACL of a file for all users:
`setfacl -d -m u::rw {{file}}`
* Remove ACL of a file for a user:
`setfacl -x u:{{username}} {{file}}`
* Remove all ACL entries of a file:
`setfacl -b {{file}}`"
What is paste command,,"# paste
> Merge lines of files. More information:
> https://www.gnu.org/software/coreutils/paste.
* Join all the lines into a single line, using TAB as delimiter:
`paste -s {{path/to/file}}`
* Join all the lines into a single line, using the specified delimiter:
`paste -s -d {{delimiter}} {{path/to/file}}`
* Merge two files side by side, each in its column, using TAB as delimiter:
`paste {{file1}} {{file2}}`
* Merge two files side by side, each in its column, using the specified delimiter:
`paste -d {{delimiter}} {{file1}} {{file2}}`
* Merge two files, with lines added alternatively:
`paste -d '\n' {{file1}} {{file2}}`"
What is busctl command,,"# busctl
> Introspect and monitor the D-Bus bus. More information:
> https://www.freedesktop.org/software/systemd/man/busctl.html.
* Show all peers on the bus, by their service names:
`busctl list`
* Show process information and credentials of a bus service, a process, or the owner of the bus (if no parameter is specified):
`busctl status {{service|pid}}`
* Dump messages being exchanged. If no service is specified, show all messages on the bus:
`busctl monitor {{service1 service2 ...}}`
* Show an object tree of one or more services (or all services if no service is specified):
`busctl tree {{service1 service2 ...}}`
* Show interfaces, methods, properties and signals of the specified object on the specified service:
`busctl introspect {{service}} {{path/to/object}}`
* Retrieve the current value of one or more object properties:
`busctl get-property {{service}} {{path/to/object}} {{interface_name}}
{{property_name}}`
* Invoke a method and show the response:
`busctl call {{service}} {{path/to/object}} {{interface_name}}
{{method_name}}`"
What is readlink command,,"# readlink
> Follow symlinks and get symlink information. More information:
> https://www.gnu.org/software/coreutils/readlink.
* Print the absolute path which the symlink points to:
`readlink {{path/to/symlink_file}}`"
What is sh command,,"# sh
> Bourne shell, the standard command language interpreter. See also
> `histexpand` for history expansion. More information: https://manned.org/sh.
* Start an interactive shell session:
`sh`
* Execute a command and then exit:
`sh -c ""{{command}}""`
* Execute a script:
`sh {{path/to/script.sh}}`
* Read and execute commands from `stdin`:
`sh -s`"
What is mpstat command,,"# mpstat
> Report CPU statistics. More information: https://manned.org/mpstat.
* Display CPU statistics every 2 seconds:
`mpstat {{2}}`
* Display 5 reports, one by one, at 2 second intervals:
`mpstat {{2}} {{5}}`
* Display 5 reports, one by one, from a given processor, at 2 second intervals:
`mpstat -P {{0}} {{2}} {{5}}`"
What is nm command,,"# nm
> List symbol names in object files. More information: https://manned.org/nm.
* List global (extern) functions in a file (prefixed with T):
`nm -g {{path/to/file.o}}`
* List only undefined symbols in a file:
`nm -u {{path/to/file.o}}`
* List all symbols, even debugging symbols:
`nm -a {{path/to/file.o}}`
* Demangle C++ symbols (make them readable):
`nm --demangle {{path/to/file.o}}`"
What is logger command,,"# logger
> Add messages to syslog (/var/log/syslog). More information:
> https://manned.org/logger.
* Log a message to syslog:
`logger {{message}}`
* Take input from `stdin` and log to syslog:
`echo {{log_entry}} | logger`
* Send the output to a remote syslog server running at a given port. Default port is 514:
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
* Use a specific tag for every line logged. Default is the name of logged in user:
`echo {{log_entry}} | logger --tag {{tag}}`
* Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
`echo {{log_entry}} | logger --priority {{user.warning}}`"
What is fallocate command,,"# fallocate
> Reserve or deallocate disk space to files. The utility allocates space
> without zeroing. More information: https://manned.org/fallocate.
* Reserve a file taking up 700 MiB of disk space:
`fallocate --length {{700M}} {{path/to/file}}`
* Shrink an already allocated file by 200 MiB:
`fallocate --collapse-range --length {{200M}} {{path/to/file}}`
* Shrink 20 MB of space after 100 MiB in a file:
`fallocate --collapse-range --offset {{100M}} --length {{20M}}
{{path/to/file}}`"
What is mkfifo command,,"# mkfifo
> Makes FIFOs (named pipes). More information:
> https://www.gnu.org/software/coreutils/mkfifo.
* Create a named pipe at a given path:
`mkfifo {{path/to/pipe}}`"
What is git-credential-store command,,"# git credential-store
> `git` helper to store passwords on disk. More information: https://git-
> scm.com/docs/git-credential-store.
* Store Git credentials in a specific file:
`git config credential.helper 'store --file={{path/to/file}}'`"
What is kill command,,"# kill
> Sends a signal to a process, usually related to stopping the process. All
> signals except for SIGKILL and SIGSTOP can be intercepted by the process to
> perform a clean exit. More information: https://manned.org/kill.
* Terminate a program using the default SIGTERM (terminate) signal:
`kill {{process_id}}`
* List available signal names (to be used without the `SIG` prefix):
`kill -l`
* Terminate a background job:
`kill %{{job_id}}`
* Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
`kill -{{1|HUP}} {{process_id}}`
* Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`:
`kill -{{2|INT}} {{process_id}}`
* Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):
`kill -{{9|KILL}} {{process_id}}`
* Signal the operating system to pause a program until a SIGCONT (""continue"") signal is received:
`kill -{{17|STOP}} {{process_id}}`
* Send a `SIGUSR1` signal to all processes with the given GID (group id):
`kill -{{SIGUSR1}} -{{group_id}}`"
What is exec command,,"# exec
> Replace the current process with another process. More information:
> https://linuxcommand.org/lc3_man_pages/exech.html.
* Replace with the specified command using the current environment variables:
`exec {{command -with -flags}}`
* Replace with the specified command, clearing environment variables:
`exec -c {{command -with -flags}}`
* Replace with the specified command and login using the default shell:
`exec -l {{command -with -flags}}`
* Replace with the specified command and change the process name:
`exec -a {{process_name}} {{command -with -flags}}`"
What is ln command,,"# ln
> Creates links to files and directories. More information:
> https://www.gnu.org/software/coreutils/ln.
* Create a symbolic link to a file or directory:
`ln -s {{/path/to/file_or_directory}} {{path/to/symlink}}`
* Overwrite an existing symbolic link to point to a different file:
`ln -sf {{/path/to/new_file}} {{path/to/symlink}}`
* Create a hard link to a file:
`ln {{/path/to/file}} {{path/to/hardlink}}`"
What is sha224sum command,,"# sha224sum
> Calculate SHA224 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/manual/html_node/sha2-utilities.html.
* Calculate the SHA224 checksum for one or more files:
`sha224sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of SHA224 checksums to a file:
`sha224sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha224}}`
* Calculate a SHA224 checksum from `stdin`:
`{{command}} | sha224sum`
* Read a file of SHA224 sums and filenames and verify all files have matching checksums:
`sha224sum --check {{path/to/file.sha224}}`
* Only show a message for missing files or when verification fails:
`sha224sum --check --quiet {{path/to/file.sha224}}`
* Only show a message when verification fails, ignoring missing files:
`sha224sum --ignore-missing --check --quiet {{path/to/file.sha224}}`"
What is tr command,,"# tr
> Translate characters: run replacements based on single characters and
> character sets. More information: https://www.gnu.org/software/coreutils/tr.
* Replace all occurrences of a character in a file, and print the result:
`tr {{find_character}} {{replace_character}} < {{path/to/file}}`
* Replace all occurrences of a character from another command's output:
`echo {{text}} | tr {{find_character}} {{replace_character}}`
* Map each character of the first set to the corresponding character of the second set:
`tr '{{abcd}}' '{{jkmn}}' < {{path/to/file}}`
* Delete all occurrences of the specified set of characters from the input:
`tr -d '{{input_characters}}' < {{path/to/file}}`
* Compress a series of identical characters to a single character:
`tr -s '{{input_characters}}' < {{path/to/file}}`
* Translate the contents of a file to upper-case:
`tr ""[:lower:]"" ""[:upper:]"" < {{path/to/file}}`
* Strip out non-printable characters from a file:
`tr -cd ""[:print:]"" < {{path/to/file}}`"
What is chattr command,,"# chattr
> Change attributes of files or directories. More information:
> https://manned.org/chattr.
* Make a file or directory immutable to changes and deletion, even by superuser:
`chattr +i {{path/to/file_or_directory}}`
* Make a file or directory mutable:
`chattr -i {{path/to/file_or_directory}}`
* Recursively make an entire directory and contents immutable:
`chattr -R +i {{path/to/directory}}`"
What is git-reset command,,"# git reset
> Undo commits or unstage changes, by resetting the current Git HEAD to the
> specified state. If a path is passed, it works as ""unstage""; if a commit
> hash or branch is passed, it works as ""uncommit"". More information:
> https://git-scm.com/docs/git-reset.
* Unstage everything:
`git reset`
* Unstage specific file(s):
`git reset {{path/to/file1 path/to/file2 ...}}`
* Interactively unstage portions of a file:
`git reset --patch {{path/to/file}}`
* Undo the last commit, keeping its changes (and any further uncommitted changes) in the filesystem:
`git reset HEAD~`
* Undo the last two commits, adding their changes to the index, i.e. staged for commit:
`git reset --soft HEAD~2`
* Discard any uncommitted changes, staged or not (for only unstaged changes, use `git checkout`):
`git reset --hard`
* Reset the repository to a given commit, discarding committed, staged and uncommitted changes since then:
`git reset --hard {{commit}}`"
What is uuidgen command,,"# uuidgen
> Generate new UUID (Universally Unique IDentifier) strings. More information:
> https://www.ss64.com/osx/uuidgen.html.
* Generate a UUID string:
`uuidgen`"
What is git-clone command,,"# git clone
> Clone an existing repository. More information: https://git-
> scm.com/docs/git-clone.
* Clone an existing repository into a new directory (the default directory is the repository name):
`git clone {{remote_repository_location}} {{path/to/directory}}`
* Clone an existing repository and its submodules:
`git clone --recursive {{remote_repository_location}}`
* Clone only the `.git` directory of an existing repository:
`git clone --no-checkout {{remote_repository_location}}`
* Clone a local repository:
`git clone --local {{path/to/local/repository}}`
* Clone quietly:
`git clone --quiet {{remote_repository_location}}`
* Clone an existing repository only fetching the 10 most recent commits on the default branch (useful to save time):
`git clone --depth {{10}} {{remote_repository_location}}`
* Clone an existing repository only fetching a specific branch:
`git clone --branch {{name}} --single-branch {{remote_repository_location}}`
* Clone an existing repository using a specific SSH command:
`git clone --config core.sshCommand=""{{ssh -i path/to/private_ssh_key}}""
{{remote_repository_location}}`"
What is cups-config command,,"# cups-config
> Show technical information about your CUPS print server installation. More
> information: https://www.cups.org/doc/man-cups-config.html.
* Show the currently installed version of CUPS:
`cups-config --version`
* Show where CUPS is currently installed:
`cups-config --serverbin`
* Show the location of CUPS' configuration directory:
`cups-config --serverroot`
* Show the location of CUPS' data directory:
`cups-config --datadir`
* Display all available options:
`cups-config --help`"
What is mkfifo command,,"# mkfifo
> Makes FIFOs (named pipes). More information:
> https://www.gnu.org/software/coreutils/mkfifo.
* Create a named pipe at a given path:
`mkfifo {{path/to/pipe}}`"
What is logger command,,"# logger
> Add messages to syslog (/var/log/syslog). More information:
> https://manned.org/logger.
* Log a message to syslog:
`logger {{message}}`
* Take input from `stdin` and log to syslog:
`echo {{log_entry}} | logger`
* Send the output to a remote syslog server running at a given port. Default port is 514:
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
* Use a specific tag for every line logged. Default is the name of logged in user:
`echo {{log_entry}} | logger --tag {{tag}}`
* Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
`echo {{log_entry}} | logger --priority {{user.warning}}`"
What is git-apply command,,"# git apply
> Apply a patch to files and/or to the index without creating a commit. See
> also `git am`, which applies a patch and also creates a commit. More
> information: https://git-scm.com/docs/git-apply.
* Print messages about the patched files:
`git apply --verbose {{path/to/file}}`
* Apply and add the patched files to the index:
`git apply --index {{path/to/file}}`
* Apply a remote patch file:
`curl -L {{https://example.com/file.patch}} | git apply`
* Output diffstat for the input and apply the patch:
`git apply --stat --apply {{path/to/file}}`
* Apply the patch in reverse:
`git apply --reverse {{path/to/file}}`
* Store the patch result in the index without modifying the working tree:
`git apply --cache {{path/to/file}}`"
What is strings command,,"# strings
> Find printable strings in an object file or binary. More information:
> https://manned.org/strings.
* Print all strings in a binary:
`strings {{path/to/file}}`
* Limit results to strings at least length characters long:
`strings -n {{length}} {{path/to/file}}`
* Prefix each result with its offset within the file:
`strings -t d {{path/to/file}}`
* Prefix each result with its offset within the file in hexadecimal:
`strings -t x {{path/to/file}}`"
What is hexdump command,,"# hexdump
> An ASCII, decimal, hexadecimal, octal dump. More information:
> https://manned.org/hexdump.
* Print the hexadecimal representation of a file, replacing duplicate lines by '*':
`hexdump {{path/to/file}}`
* Display the input offset in hexadecimal and its ASCII representation in two columns:
`hexdump -C {{path/to/file}}`
* Display the hexadecimal representation of a file, but interpret only n bytes of the input:
`hexdump -C -n{{number_of_bytes}} {{path/to/file}}`
* Don't replace duplicate lines with '*':
`hexdump --no-squeezing {{path/to/file}}`"
What is git-update-index command,,"# git update-index
> Git command for manipulating the index. More information: https://git-
> scm.com/docs/git-update-index.
* Pretend that a modified file is unchanged (`git status` will not show this as changed):
`git update-index --skip-worktree {{path/to/modified_file}}`"
What is valgrind command,,"# valgrind
> Wrapper for a set of expert tools for profiling, optimizing and debugging
> programs. Commonly used tools include `memcheck`, `cachegrind`, `callgrind`,
> `massif`, `helgrind`, and `drd`. More information: http://www.valgrind.org.
* Use the (default) Memcheck tool to show a diagnostic of memory usage by `program`:
`valgrind {{program}}`
* Use Memcheck to report all possible memory leaks of `program` in full detail:
`valgrind --leak-check=full --show-leak-kinds=all {{program}}`
* Use the Cachegrind tool to profile and log CPU cache operations of `program`:
`valgrind --tool=cachegrind {{program}}`
* Use the Massif tool to profile and log heap memory and stack usage of `program`:
`valgrind --tool=massif --stacks=yes {{program}}`"
What is od command,,"# od
> Display file contents in octal, decimal or hexadecimal format. Optionally
> display the byte offsets and/or printable representation for each line. More
> information: https://www.gnu.org/software/coreutils/od.
* Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`:
`od {{path/to/file}}`
* Display file in verbose mode, i.e. without replacing duplicate lines with `*`:
`od -v {{path/to/file}}`
* Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:
`od --format={{x}} --address-radix={{d}} -v {{path/to/file}}`
* Display file in hexadecimal format (1-byte units), and 4 bytes per line:
`od --format={{x1}} --width={{4}} -v {{path/to/file}}`
* Display file in hexadecimal format along with its character representation, and do not print byte offsets:
`od --format={{xz}} --address-radix={{n}} -v {{path/to/file}}`
* Read only 100 bytes of a file starting from the 500th byte:
`od --read-bytes {{100}} --skip-bytes={{500}} -v {{path/to/file}}`"
What is uuencode command,,"# uuencode
> Encode binary files into ASCII for transport via mediums that only support
> simple ASCII encoding. More information: https://manned.org/uuencode.
* Encode a file and print the result to `stdout`:
`uuencode {{path/to/input_file}} {{output_file_name_after_decoding}}`
* Encode a file and write the result to a file:
`uuencode -o {{path/to/output_file}} {{path/to/input_file}}
{{output_file_name_after_decoding}}`
* Encode a file using Base64 instead of the default uuencode encoding and write the result to a file:
`uuencode -m -o {{path/to/output_file}} {{path/to/input_file}}
{{output_file_name_after_decoding}}`"
What is cmp command,,"# cmp
> Compare two files byte by byte. More information:
> https://www.gnu.org/software/diffutils/manual/html_node/Invoking-cmp.html.
* Output char and line number of the first difference between two files:
`cmp {{path/to/file1}} {{path/to/file2}}`
* Output info of the first difference: char, line number, bytes, and values:
`cmp --print-bytes {{path/to/file1}} {{path/to/file2}}`
* Output the byte numbers and values of every difference:
`cmp --verbose {{path/to/file1}} {{path/to/file2}}`
* Compare files but output nothing, yield only the exit status:
`cmp --quiet {{path/to/file1}} {{path/to/file2}}`"
What is hostname command,,"# hostname
> Show or set the system's host name. More information:
> https://manned.org/hostname.
* Show current host name:
`hostname`
* Show the network address of the host name:
`hostname -i`
* Show all network addresses of the host:
`hostname -I`
* Show the FQDN (Fully Qualified Domain Name):
`hostname --fqdn`
* Set current host name:
`hostname {{new_hostname}}`"
What is od command,,"# od
> Display file contents in octal, decimal or hexadecimal format. Optionally
> display the byte offsets and/or printable representation for each line. More
> information: https://www.gnu.org/software/coreutils/od.
* Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`:
`od {{path/to/file}}`
* Display file in verbose mode, i.e. without replacing duplicate lines with `*`:
`od -v {{path/to/file}}`
* Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:
`od --format={{x}} --address-radix={{d}} -v {{path/to/file}}`
* Display file in hexadecimal format (1-byte units), and 4 bytes per line:
`od --format={{x1}} --width={{4}} -v {{path/to/file}}`
* Display file in hexadecimal format along with its character representation, and do not print byte offsets:
`od --format={{xz}} --address-radix={{n}} -v {{path/to/file}}`
* Read only 100 bytes of a file starting from the 500th byte:
`od --read-bytes {{100}} --skip-bytes={{500}} -v {{path/to/file}}`"
What is b2sum command,,"# b2sum
> Calculate BLAKE2 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/b2sum.
* Calculate the BLAKE2 checksum for one or more files:
`b2sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of BLAKE2 checksums to a file:
`b2sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.b2}}`
* Calculate a BLAKE2 checksum from `stdin`:
`{{command}} | b2sum`
* Read a file of BLAKE2 sums and filenames and verify all files have matching checksums:
`b2sum --check {{path/to/file.b2}}`
* Only show a message for missing files or when verification fails:
`b2sum --check --quiet {{path/to/file.b2}}`
* Only show a message when verification fails, ignoring missing files:
`b2sum --ignore-missing --check --quiet {{path/to/file.b2}}`"
What is git-status command,,"# git status
> Show the changes to files in a Git repository. Lists changed, added and
> deleted files compared to the currently checked-out commit. More
> information: https://git-scm.com/docs/git-status.
* Show changed files which are not yet added for commit:
`git status`
* Give output in [s]hort format:
`git status -s`
* Don't show untracked files in the output:
`git status --untracked-files=no`
* Show output in [s]hort format along with [b]ranch info:
`git status -sb`"
What is time command,,"# time
> Measure how long a command took to run. Note: `time` can either exist as a
> shell builtin, a standalone program or both. More information:
> https://manned.org/time.
* Run the `command` and print the time measurements to `stdout`:
`time {{command}}`"
What is split command,,"# split
> Split a file into pieces. More information: https://ss64.com/osx/split.html.
* Split a file, each split having 10 lines (except the last split):
`split -l {{10}} {{filename}}`
* Split a file by a regular expression. The matching line will be the first line of the next output file:
`split -p {{cat|^[dh]og}} {{filename}}`
* Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
`split -b {{512}} {{filename}}`
* Split a file into 5 files. File is split such that each split has same size (except the last split):
`split -n {{5}} {{filename}}`"
What is su command,,"# su
> Switch shell to another user. More information: https://manned.org/su.
* Switch to superuser (requires the root password):
`su`
* Switch to a given user (requires the user's password):
`su {{username}}`
* Switch to a given user and simulate a full login shell:
`su - {{username}}`
* Execute a command as another user:
`su - {{username}} -c ""{{command}}""`"
What is w command,,"# w
> Show who is logged on and what they are doing. Print user login, TTY, remote
> host, login time, idle time, current process. More information:
> https://ss64.com/osx/w.html.
* Show logged-in users information:
`w`
* Show logged-in users information without a header:
`w -h`
* Show information about logged-in users, sorted by their idle time:
`w -i`"
What is git-reflog command,,"# git reflog
> Show a log of changes to local references like HEAD, branches or tags. More
> information: https://git-scm.com/docs/git-reflog.
* Show the reflog for HEAD:
`git reflog`
* Show the reflog for a given branch:
`git reflog {{branch_name}}`
* Show only the 5 latest entries in the reflog:
`git reflog -n {{5}}`"
What is git-cat-file command,,"# git cat-file
> Provide content or type and size information for Git repository objects.
> More information: https://git-scm.com/docs/git-cat-file.
* Get the [s]ize of the HEAD commit in bytes:
`git cat-file -s HEAD`
* Get the [t]ype (blob, tree, commit, tag) of a given Git object:
`git cat-file -t {{8c442dc3}}`
* Pretty-[p]rint the contents of a given Git object based on its type:
`git cat-file -p {{HEAD~2}}`"
What is clear command,,"# clear
> Clears the screen of the terminal. More information:
> https://manned.org/clear.
* Clear the screen (equivalent to pressing Control-L in Bash shell):
`clear`
* Clear the screen but keep the terminal's scrollback buffer:
`clear -x`
* Indicate the type of terminal to clean (defaults to the value of the environment variable `TERM`):
`clear -T {{type_of_terminal}}`
* Show the version of `ncurses` used by `clear`:
`clear -V`"
What is tput command,,"# tput
> View and modify terminal settings and capabilities. More information:
> https://manned.org/tput.
* Move the cursor to a screen location:
`tput cup {{row}} {{column}}`
* Set foreground (af) or background (ab) color:
`tput {{setaf|setab}} {{ansi_color_code}}`
* Show number of columns, lines, or colors:
`tput {{cols|lines|colors}}`
* Ring the terminal bell:
`tput bel`
* Reset all terminal attributes:
`tput sgr0`
* Enable or disable word wrap:
`tput {{smam|rmam}}`"
What is nice command,,"# nice
> Execute a program with a custom scheduling priority (niceness). Niceness
> values range from -20 (the highest priority) to 19 (the lowest). More
> information: https://www.gnu.org/software/coreutils/nice.
* Launch a program with altered priority:
`nice -n {{niceness_value}} {{command}}`"
What is echo command,,"# echo
> Print given arguments. More information:
> https://www.gnu.org/software/coreutils/echo.
* Print a text message. Note: quotes are optional:
`echo ""{{Hello World}}""`
* Print a message with environment variables:
`echo ""{{My path is $PATH}}""`
* Print a message without the trailing newline:
`echo -n ""{{Hello World}}""`
* Append a message to the file:
`echo ""{{Hello World}}"" >> {{file.txt}}`
* Enable interpretation of backslash escapes (special characters):
`echo -e ""{{Column 1\tColumn 2}}""`
* Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively):
`echo $?`"
What is expand command,,"# expand
> Convert tabs to spaces. More information:
> https://www.gnu.org/software/coreutils/expand.
* Convert tabs in each file to spaces, writing to `stdout`:
`expand {{path/to/file}}`
* Convert tabs to spaces, reading from `stdin`:
`expand`
* Do not convert tabs after non blanks:
`expand -i {{path/to/file}}`
* Have tabs a certain number of characters apart, not 8:
`expand -t={{number}} {{path/to/file}}`
* Use a comma separated list of explicit tab positions:
`expand -t={{1,4,6}}`"
What is systemd-firstboot command,,"# systemd-firstboot
> Initialize basic system settings on or before the first boot-up of a system.
> More information: https://www.freedesktop.org/software/systemd/man/systemd-
> firstboot.html.
* Operate on the specified directory instead of the root directory of the host system:
`sudo systemd-firstboot --root={{path/to/root_directory}}`
* Set the system keyboard layout:
`sudo systemd-firstboot --keymap={{keymap}}`
* Set the system hostname:
`sudo systemd-firstboot --hostname={{hostname}}`
* Set the root user's password:
`sudo systemd-firstboot --root-password={{password}}`
* Prompt the user interactively for a specific basic setting:
`sudo systemd-firstboot --prompt={{setting}}`
* Force writing configuration even if the relevant files already exist:
`sudo systemd-firstboot --force`
* Remove all existing files that are configured by `systemd-firstboot`:
`sudo systemd-firstboot --reset`
* Remove the password of the system's root user:
`sudo systemd-firstboot --delete-root-password`"
What is last command,,"# last
> View the last logged in users. More information: https://manned.org/last.
* View last logins, their duration and other information as read from `/var/log/wtmp`:
`last`
* Specify how many of the last logins to show:
`last -n {{login_count}}`
* Print the full date and time for entries and then display the hostname column last to prevent truncation:
`last -F -a`
* View all logins by a specific user and show the IP address instead of the hostname:
`last {{username}} -i`
* View all recorded reboots (i.e., the last logins of the pseudo user ""reboot""):
`last reboot`
* View all recorded shutdowns (i.e., the last logins of the pseudo user ""shutdown""):
`last shutdown`"
What is flatpak command,,"# flatpak
> Build, install and run flatpak applications and runtimes. More information:
> https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak.
* Run an installed application:
`flatpak run {{name}}`
* Install an application from a remote source:
`flatpak install {{remote}} {{name}}`
* List all installed applications and runtimes:
`flatpak list`
* Update all installed applications and runtimes:
`flatpak update`
* Add a remote source:
`flatpak remote-add --if-not-exists {{remote_name}} {{remote_url}}`
* Remove an installed application:
`flatpak remove {{name}}`
* Remove all unused applications:
`flatpak remove --unused`
* Show information about an installed application:
`flatpak info {{name}}`"
What is cksum command,,"# cksum
> Calculates CRC checksums and byte counts of a file. Note, on old UNIX
> systems the CRC implementation may differ. More information:
> https://www.gnu.org/software/coreutils/cksum.
* Display a 32-bit checksum, size in bytes and filename:
`cksum {{path/to/file}}`"
What is git-for-each-repo command,,"# git for-each-repo
> Run a Git command on a list of repositories. Note: this command is
> experimental and may change. More information: https://git-scm.com/docs/git-
> for-each-repo.
* Run maintenance on each of a list of repositories stored in the `maintenance.repo` user configuration variable:
`git for-each-repo --config={{maintenance.repo}} {{maintenance run}}`
* Run `git pull` on each repository listed in a global configuration variable:
`git for-each-repo --config={{global_configuration_variable}} {{pull}}`"
What is more command,,"# more
> Open a file for interactive reading, allowing scrolling and search. More
> information: https://manned.org/more.
* Open a file:
`more {{path/to/file}}`
* Open a file displaying from a specific line:
`more +{{line_number}} {{path/to/file}}`
* Display help:
`more --help`
* Go to the next page:
`<Space>`
* Search for a string (press `n` to go to the next match):
`/{{something}}`
* Exit:
`q`
* Display help about interactive commands:
`h`"
What is apropos command,,"# apropos
> Search the manual pages for names and descriptions. More information:
> https://manned.org/apropos.
* Search for a keyword using a regular expression:
`apropos {{regular_expression}}`
* Search without restricting the output to the terminal width:
`apropos -l {{regular_expression}}`
* Search for pages that contain all the expressions given:
`apropos {{regular_expression_1}} -a {{regular_expression_2}} -a
{{regular_expression_3}}`"
What is cat command,,"# cat
> Print and concatenate files. More information:
> https://keith.github.io/xcode-man-pages/cat.1.html.
* Print the contents of a file to `stdout`:
`cat {{path/to/file}}`
* Concatenate several files into an output file:
`cat {{path/to/file1 path/to/file2 ...}} > {{path/to/output_file}}`
* Append several files to an output file:
`cat {{path/to/file1 path/to/file2 ...}} >> {{path/to/output_file}}`
* Copy the contents of a file into an output file without buffering:
`cat -u {{/dev/tty12}} > {{/dev/tty13}}`
* Write `stdin` to a file:
`cat - > {{path/to/file}}`
* Number all output lines:
`cat -n {{path/to/file}}`
* Display non-printable and whitespace characters (with `M-` prefix if non-ASCII):
`cat -v -t -e {{path/to/file}}`"
What is arch command,,"# arch
> Display the name of the system architecture, or run a command under a
> different architecture. See also `uname`. More information:
> https://www.unix.com/man-page/osx/1/arch/.
* Display the system's architecture:
`arch`
* Run a command using x86_64:
`arch -x86_64 ""{{command}}""`
* Run a command using arm:
`arch -arm64 ""{{command}}""`"
What is update-alternatives command,,"# update-alternatives
> A convenient tool for maintaining symbolic links to determine default
> commands. More information: https://manned.org/update-alternatives.
* Add a symbolic link:
`sudo update-alternatives --install {{path/to/symlink}} {{command_name}}
{{path/to/command_binary}} {{priority}}`
* Configure a symbolic link for `java`:
`sudo update-alternatives --config {{java}}`
* Remove a symbolic link:
`sudo update-alternatives --remove {{java}}
{{/opt/java/jdk1.8.0_102/bin/java}}`
* Display information about a specified command:
`update-alternatives --display {{java}}`
* Display all commands and their current selection:
`update-alternatives --get-selections`"
What is mailx command,,"# mailx
> Send and receive mail. More information: https://manned.org/mailx.
* Send mail (the content should be typed after the command, and ended with `Ctrl+D`):
`mailx -s ""{{subject}}"" {{to_addr}}`
* Send mail with content passed from another command:
`echo ""{{content}}"" | mailx -s ""{{subject}}"" {{to_addr}}`
* Send mail with content read from a file:
`mailx -s ""{{subject}}"" {{to_addr}} < {{content.txt}}`
* Send mail to a recipient and CC to another address:
`mailx -s ""{{subject}}"" -c {{cc_addr}} {{to_addr}}`
* Send mail specifying the sender address:
`mailx -s ""{{subject}}"" -r {{from_addr}} {{to_addr}}`
* Send mail with an attachment:
`mailx -a {{path/to/file}} -s ""{{subject}}"" {{to_addr}}`"
What is dot command,,"# dot
> Render an image of a `linear directed` network graph from a `graphviz` file.
> Layouts: `dot`, `neato`, `twopi`, `circo`, `fdp`, `sfdp`, `osage` &
> `patchwork`. More information: https://graphviz.org/doc/info/command.html.
* Render a `png` image with a filename based on the input filename and output format (uppercase -O):
`dot -T {{png}} -O {{path/to/input.gv}}`
* Render a `svg` image with the specified output filename (lowercase -o):
`dot -T {{svg}} -o {{path/to/image.svg}} {{path/to/input.gv}}`
* Render the output in `ps`, `pdf`, `svg`, `fig`, `png`, `gif`, `jpg`, `json`, or `dot` format:
`dot -T {{format}} -O {{path/to/input.gv}}`
* Render a `gif` image using `stdin` and `stdout`:
`echo ""{{digraph {this -> that} }}"" | dot -T {{gif}} > {{path/to/image.gif}}`
* Display help:
`dot -?`"
What is gcc command,,"# gcc
> Preprocess and compile C and C++ source files, then assemble and link them
> together. More information: https://gcc.gnu.org.
* Compile multiple source files into an executable:
`gcc {{path/to/source1.c path/to/source2.c ...}} -o
{{path/to/output_executable}}`
* Show common warnings, debug symbols in output, and optimize without affecting debugging:
`gcc {{path/to/source.c}} -Wall -g -Og -o {{path/to/output_executable}}`
* Include libraries from a different path:
`gcc {{path/to/source.c}} -o {{path/to/output_executable}}
-I{{path/to/header}} -L{{path/to/library}} -l{{library_name}}`
* Compile source code into Assembler instructions:
`gcc -S {{path/to/source.c}}`
* Compile source code into an object file without linking:
`gcc -c {{path/to/source.c}}`"
What is whoami command,,"# whoami
> Print the username associated with the current effective user ID. More
> information: https://www.gnu.org/software/coreutils/whoami.
* Display currently logged username:
`whoami`
* Display the username after a change in the user ID:
`sudo whoami`"
What is gitk command,,"# gitk
> A graphical Git repository browser. More information: https://git-
> scm.com/docs/gitk.
* Show the repository browser for the current Git repository:
`gitk`
* Show repository browser for a specific file or directory:
`gitk {{path/to/file_or_directory}}`
* Show commits made since 1 week ago:
`gitk --since=""{{1 week ago}}""`
* Show commits older than 1/1/2016:
`gitk --until=""{{1/1/2015}}""`
* Show at most 100 changes in all branches:
`gitk --max-count={{100}} --all`"
What is realpath command,,"# realpath
> Display the resolved absolute path for a file or directory. More
> information: https://www.gnu.org/software/coreutils/realpath.
* Display the absolute path for a file or directory:
`realpath {{path/to/file_or_directory}}`
* Require all path components to exist:
`realpath --canonicalize-existing {{path/to/file_or_directory}}`
* Resolve "".."" components before symlinks:
`realpath --logical {{path/to/file_or_directory}}`
* Disable symlink expansion:
`realpath --no-symlinks {{path/to/file_or_directory}}`
* Suppress error messages:
`realpath --quiet {{path/to/file_or_directory}}`"
What is csplit command,,"# csplit
> Split a file into pieces. This generates files named ""xx00"", ""xx01"", and so
> on. More information: https://www.gnu.org/software/coreutils/csplit.
* Split a file at lines 5 and 23:
`csplit {{path/to/file}} {{5}} {{23}}`
* Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5):
`csplit {{path/to/file}} {{5}} {*}`
* Split a file every 5 lines, ignoring exact-division error:
`csplit -k {{path/to/file}} {{5}} {*}`
* Split a file at line 5 and use a custom prefix for the output files:
`csplit {{path/to/file}} {{5}} -f {{prefix}}`
* Split a file at a line matching a regular expression:
`csplit {{path/to/file}} /{{regular_expression}}/`"
What is ps command,,"# ps
> Information about running processes. More information:
> https://www.unix.com/man-page/osx/1/ps/.
* List all running processes:
`ps aux`
* List all running processes including the full command string:
`ps auxww`
* Search for a process that matches a string:
`ps aux | grep {{string}}`
* Get the parent PID of a process:
`ps -o ppid= -p {{pid}}`
* Sort processes by memory usage:
`ps -m`
* Sort processes by CPU usage:
`ps -r`"
What is journalctl command,,"# journalctl
> Query the systemd journal. More information: https://manned.org/journalctl.
* Show all messages with priority level 3 (errors) from this [b]oot:
`journalctl -b --priority={{3}}`
* Show all messages from last [b]oot:
`journalctl -b -1`
* Delete journal logs which are older than 2 days:
`journalctl --vacuum-time={{2d}}`
* [f]ollow new messages (like `tail -f` for traditional syslog):
`journalctl -f`
* Show all messages by a specific [u]nit:
`journalctl -u {{unit}}`
* Filter messages within a time range (either timestamp or placeholders like ""yesterday""):
`journalctl --since {{now|today|yesterday|tomorrow}} --until {{YYYY-MM-DD
HH:MM:SS}}`
* Show all messages by a specific process:
`journalctl _PID={{pid}}`
* Show all messages by a specific executable:
`journalctl {{path/to/executable}}`"
What is head command,,"# head
> Output the first part of files. More information:
> https://keith.github.io/xcode-man-pages/head.1.html.
* Output the first few lines of a file:
`head --lines {{8}} {{path/to/file}}`
* Output the first few bytes of a file:
`head --bytes {{8}} {{path/to/file}}`
* Output everything but the last few lines of a file:
`head --lines -{{8}} {{path/to/file}}`
* Output everything but the last few bytes of a file:
`head --bytes -{{8}} {{path/to/file}}`"
What is basename command,,"# basename
> Remove leading directory portions from a path. More information:
> https://www.gnu.org/software/coreutils/basename.
* Show only the file name from a path:
`basename {{path/to/file}}`
* Show only the rightmost directory name from a path:
`basename {{path/to/directory/}}`
* Show only the file name from a path, with a suffix removed:
`basename {{path/to/file}} {{suffix}}`"
What is git-maintenance command,,"# git-maintenance
> Run tasks to optimize Git repository data. More information: https://git-
> scm.com/docs/git-maintenance.
* Register the current repository in the user's list of repositories to daily have maintenance run:
`git maintenance register`
* Start running maintenance on the current repository:
`git maintenance start`
* Halt the background maintenance schedule for the current repository:
`git maintenance stop`
* Remove the current repository from the user's maintenance repository list:
`git maintenance unregister`
* Run a specific maintenance task on the current repository:
`git maintenance run --task={{commit-graph|gc|incremental-repack|loose-
objects|pack-refs|prefetch}}`"
What is git-diff-files command,,"# git diff-files
> Compare files using their sha1 hashes and modes. More information:
> https://git-scm.com/docs/git-diff-files.
* Compare all changed files:
`git diff-files`
* Compare only specified files:
`git diff-files {{path/to/file}}`
* Show only the names of changed files:
`git diff-files --name-only`
* Output a summary of extended header information:
`git diff-files --summary`"
What is expr command,,"# expr
> Evaluate expressions and manipulate strings. More information:
> https://www.gnu.org/software/coreutils/expr.
* Get the length of a specific string:
`expr length ""{{string}}""`
* Get the substring of a string with a specific length:
`expr substr ""{{string}}"" {{from}} {{length}}`
* Match a specific substring against an anchored pattern:
`expr match ""{{string}}"" '{{pattern}}'`
* Get the first char position from a specific set in a string:
`expr index ""{{string}}"" ""{{chars}}""`
* Calculate a specific mathematic expression:
`expr {{expression1}} {{+|-|*|/|%}} {{expression2}}`
* Get the first expression if its value is non-zero and not null otherwise get the second one:
`expr {{expression1}} \| {{expression2}}`
* Get the first expression if both expressions are non-zero and not null otherwise get zero:
`expr {{expression1}} \& {{expression2}}`"
What is mv command,,"# mv
> Move or rename files and directories. More information:
> https://www.gnu.org/software/coreutils/mv.
* Rename a file or directory when the target is not an existing directory:
`mv {{path/to/source}} {{path/to/target}}`
* Move a file or directory into an existing directory:
`mv {{path/to/source}} {{path/to/existing_directory}}`
* Move multiple files into an existing directory, keeping the filenames unchanged:
`mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}`
* Do not prompt for confirmation before overwriting existing files:
`mv -f {{path/to/source}} {{path/to/target}}`
* Prompt for confirmation before overwriting existing files, regardless of file permissions:
`mv -i {{path/to/source}} {{path/to/target}}`
* Do not overwrite existing files at the target:
`mv -n {{path/to/source}} {{path/to/target}}`
* Move files in verbose mode, showing files after they are moved:
`mv -v {{path/to/source}} {{path/to/target}}`"
What is loginctl command,,"# loginctl
> Manage the systemd login manager. More information:
> https://www.freedesktop.org/software/systemd/man/loginctl.html.
* Print all current sessions:
`loginctl list-sessions`
* Print all properties of a specific session:
`loginctl show-session {{session_id}} --all`
* Print all properties of a specific user:
`loginctl show-user {{username}}`
* Print a specific property of a user:
`loginctl show-user {{username}} --property={{property_name}}`
* Execute a `loginctl` operation on a remote host:
`loginctl list-users -H {{hostname}}`"
What is cut command,,"# cut
> Cut out fields from `stdin` or files. More information:
> https://manned.org/man/freebsd-13.0/cut.1.
* Print a specific character/field range of each line:
`{{command}} | cut -{{c|f}} {{1|1,10|1-10|1-|-10}}`
* Print a range of each line with a specific delimiter:
`{{command}} | cut -d ""{{,}}"" -{{c}} {{1}}`
* Print a range of each line of a specific file:
`cut -{{c}} {{1}} {{path/to/file}}`"
What is kill command,,"# kill
> Sends a signal to a process, usually related to stopping the process. All
> signals except for SIGKILL and SIGSTOP can be intercepted by the process to
> perform a clean exit. More information: https://manned.org/kill.
* Terminate a program using the default SIGTERM (terminate) signal:
`kill {{process_id}}`
* List available signal names (to be used without the `SIG` prefix):
`kill -l`
* Terminate a background job:
`kill %{{job_id}}`
* Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
`kill -{{1|HUP}} {{process_id}}`
* Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`:
`kill -{{2|INT}} {{process_id}}`
* Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):
`kill -{{9|KILL}} {{process_id}}`
* Signal the operating system to pause a program until a SIGCONT (""continue"") signal is received:
`kill -{{17|STOP}} {{process_id}}`
* Send a `SIGUSR1` signal to all processes with the given GID (group id):
`kill -{{SIGUSR1}} -{{group_id}}`"
What is sleep command,,"# sleep
> Delay for a specified amount of time. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html.
* Delay in seconds:
`sleep {{seconds}}`
* Execute a specific command after 20 seconds delay:
`sleep 20 && {{command}}`"
What is printf command,,"# printf
> Format and print text. More information:
> https://www.gnu.org/software/coreutils/printf.
* Print a text message:
`printf ""{{%s\n}}"" ""{{Hello world}}""`
* Print an integer in bold blue:
`printf ""{{\e[1;34m%.3d\e[0m\n}}"" {{42}}`
* Print a float number with the Unicode Euro sign:
`printf ""{{\u20AC %.2f\n}}"" {{123.4}}`
* Print a text message composed with environment variables:
`printf ""{{var1: %s\tvar2: %s\n}}"" ""{{$VAR1}}"" ""{{$VAR2}}""`
* Store a formatted message in a variable (does not work on zsh):
`printf -v {{myvar}} {{""This is %s = %d\n"" ""a year"" 2016}}`"
What is c99 command,,"# c99
> Compiles C programs according to the ISO C standard. More information:
> https://manned.org/c99.
* Compile source file(s) and create an executable:
`c99 {{file.c}}`
* Compile source file(s) and create an executable with a custom name:
`c99 -o {{executable_name}} {{file.c}}`
* Compile source file(s) and create object file(s):
`c99 -c {{file.c}}`
* Compile source file(s), link with object file(s), and create an executable:
`c99 {{file.c}} {{file.o}}`"
What is runuser command,,"# runuser
> Run commands as a specific user and group without asking for password (needs
> root privileges). More information: https://manned.org/runuser.
* Run command as a different user:
`runuser {{user}} -c '{{command}}'`
* Run command as a different user and group:
`runuser {{user}} -g {{group}} -c '{{command}}'`
* Start a login shell as a specific user:
`runuser {{user}} -l`
* Specify a shell for running instead of the default shell (also works for login):
`runuser {{user}} -s {{/bin/sh}}`
* Preserve the entire environment of root (only if `--login` is not specified):
`runuser {{user}} --preserve-environment -c '{{command}}'`"
What is man command,,"# man
> Format and display manual pages. More information:
> https://www.man7.org/linux/man-pages/man1/man.1.html.
* Display the man page for a command:
`man {{command}}`
* Display the man page for a command from section 7:
`man {{7}} {{command}}`
* List all available sections for a command:
`man -f {{command}}`
* Display the path searched for manpages:
`man --path`
* Display the location of a manpage rather than the manpage itself:
`man -w {{command}}`
* Display the man page using a specific locale:
`man {{command}} --locale={{locale}}`
* Search for manpages containing a search string:
`man -k ""{{search_string}}""`"
What is git-cherry command,,"# git cherry
> Find commits that have yet to be applied upstream. More information:
> https://git-scm.com/docs/git-cherry.
* Show commits (and their messages) with equivalent commits upstream:
`git cherry -v`
* Specify a different upstream and topic branch:
`git cherry {{origin}} {{topic}}`
* Limit commits to those within a given limit:
`git cherry {{origin}} {{topic}} {{base}}`"
What is fold command,,"# fold
> Wrap each line in an input file to fit a specified width and print it to
> `stdout`. More information: https://manned.org/fold.1p.
* Wrap each line to default width (80 characters):
`fold {{path/to/file}}`
* Wrap each line to width ""30"":
`fold -w30 {{path/to/file}}`
* Wrap each line to width ""5"" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped):
`fold -w5 -s {{path/to/file}}`"
What is dirname command,,"# dirname
> Calculates the parent directory of a given file or directory path. More
> information: https://www.gnu.org/software/coreutils/dirname.
* Calculate the parent directory of a given path:
`dirname {{path/to/file_or_directory}}`
* Calculate the parent directory of multiple paths:
`dirname {{path/to/file_a}} {{path/to/directory_b}}`
* Delimit output with a NUL character instead of a newline (useful when combining with `xargs`):
`dirname --zero {{path/to/directory_a}} {{path/to/file_b}}`"
What is tsort command,,"# tsort
> Perform a topological sort. A common use is to show the dependency order of
> nodes in a directed acyclic graph. More information:
> https://www.gnu.org/software/coreutils/tsort.
* Perform a topological sort consistent with a partial sort per line of input separated by blanks:
`tsort {{path/to/file}}`
* Perform a topological sort consistent on strings:
`echo -e ""{{UI Backend\nBackend Database\nDocs UI}}"" | tsort`"
What is base32 command,,"# base32
> Encode or decode file or `stdin` to/from Base32, to `stdout`. More
> information: https://www.gnu.org/software/coreutils/base32.
* Encode a file:
`base32 {{path/to/file}}`
* Decode a file:
`base32 --decode {{path/to/file}}`
* Encode from `stdin`:
`{{somecommand}} | base32`
* Decode from `stdin`:
`{{somecommand}} | base32 --decode`"
What is git-commit-tree command,,"# git commit-tree
> Low level utility to create commit objects. See also: `git commit`. More
> information: https://git-scm.com/docs/git-commit-tree.
* Create a commit object with the specified message:
`git commit-tree {{tree}} -m ""{{message}}""`
* Create a commit object reading the message from a file (use `-` for `stdin`):
`git commit-tree {{tree}} -F {{path/to/file}}`
* Create a GPG-signed commit object:
`git commit-tree {{tree}} -m ""{{message}}"" --gpg-sign`
* Create a commit object with the specified parent commit object:
`git commit-tree {{tree}} -m ""{{message}}"" -p {{parent_commit_sha}}`"
What is reset command,,"# reset
> Reinitializes the current terminal. Clears the entire terminal screen. More
> information: https://manned.org/reset.
* Reinitialize the current terminal:
`reset`
* Display the terminal type instead:
`reset -q`"
What is git-init command,,"# git init
> Initializes a new local Git repository. More information: https://git-
> scm.com/docs/git-init.
* Initialize a new local repository:
`git init`
* Initialize a repository with the specified name for the initial branch:
`git init --initial-branch={{branch_name}}`
* Initialize a repository using SHA256 for object hashes (requires Git version 2.29+):
`git init --object-format={{sha256}}`
* Initialize a barebones repository, suitable for use as a remote over ssh:
`git init --bare`"
What is csplit command,,"# csplit
> Split a file into pieces. This generates files named ""xx00"", ""xx01"", and so
> on. More information: https://www.gnu.org/software/coreutils/csplit.
* Split a file at lines 5 and 23:
`csplit {{path/to/file}} {{5}} {{23}}`
* Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5):
`csplit {{path/to/file}} {{5}} {*}`
* Split a file every 5 lines, ignoring exact-division error:
`csplit -k {{path/to/file}} {{5}} {*}`
* Split a file at line 5 and use a custom prefix for the output files:
`csplit {{path/to/file}} {{5}} -f {{prefix}}`
* Split a file at a line matching a regular expression:
`csplit {{path/to/file}} /{{regular_expression}}/`"
What is make command,,"# make
> Task runner for targets described in Makefile. Mostly used to control the
> compilation of an executable from source code. More information:
> https://www.gnu.org/software/make/manual/make.html.
* Call the first target specified in the Makefile (usually named ""all""):
`make`
* Call a specific target:
`make {{target}}`
* Call a specific target, executing 4 jobs at a time in parallel:
`make -j{{4}} {{target}}`
* Use a specific Makefile:
`make --file {{path/to/file}}`
* Execute make from another directory:
`make --directory {{path/to/directory}}`
* Force making of a target, even if source files are unchanged:
`make --always-make {{target}}`
* Override a variable defined in the Makefile:
`make {{target}} {{variable}}={{new_value}}`
* Override variables defined in the Makefile by the environment:
`make --environment-overrides {{target}}`"
What is sed command,,"# sed
> Edit text in a scriptable manner. See also: `awk`, `ed`. More information:
> https://keith.github.io/xcode-man-pages/sed.1.html.
* Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`:
`{{command}} | sed 's/apple/mango/g'`
* Execute a specific script [f]ile and print the result to `stdout`:
`{{command}} | sed -f {{path/to/script_file.sed}}`
* Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`:
`{{command}} | sed -E 's/(apple)/\U\1/g'`
* Print just a first line to `stdout`:
`{{command}} | sed -n '1p'`
* Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a `file` and save a backup of the original to `file.bak`:
`sed -i bak 's/apple/mango/g' {{path/to/file}}`"
What is dash command,,"# dash
> Debian Almquist Shell, a modern, POSIX-compliant implementation of `sh` (not
> Bash-compatible). More information: https://manned.org/dash.
* Start an interactive shell session:
`dash`
* Execute specific [c]ommands:
`dash -c ""{{echo 'dash is executed'}}""`
* Execute a specific script:
`dash {{path/to/script.sh}}`
* Check a specific script for syntax errors:
`dash -n {{path/to/script.sh}}`
* Execute a specific script while printing each command before executing it:
`dash -x {{path/to/script.sh}}`
* Execute a specific script and stop at the first [e]rror:
`dash -e {{path/to/script.sh}}`
* Execute specific commands from `stdin`:
`{{echo ""echo 'dash is executed'""}} | dash`"
What is ex command,,"# ex
> Command-line text editor. See also: `vim`. More information:
> https://www.vim.org.
* Open a file:
`ex {{path/to/file}}`
* Save and Quit:
`wq<Enter>`
* Undo the last operation:
`undo<Enter>`
* Search for a pattern in the file:
`/{{search_pattern}}<Enter>`
* Perform a regular expression substitution in the whole file:
`%s/{{regular_expression}}/{{replacement}}/g<Enter>`
* Insert text:
`i<Enter>{{text}}<C-c>`
* Switch to Vim:
`visual<Enter>`"
What is time command,,"# time
> Measure how long a command took to run. Note: `time` can either exist as a
> shell builtin, a standalone program or both. More information:
> https://manned.org/time.
* Run the `command` and print the time measurements to `stdout`:
`time {{command}}`"
What is printf command,,"# printf
> Format and print text. More information:
> https://www.gnu.org/software/coreutils/printf.
* Print a text message:
`printf ""{{%s\n}}"" ""{{Hello world}}""`
* Print an integer in bold blue:
`printf ""{{\e[1;34m%.3d\e[0m\n}}"" {{42}}`
* Print a float number with the Unicode Euro sign:
`printf ""{{\u20AC %.2f\n}}"" {{123.4}}`
* Print a text message composed with environment variables:
`printf ""{{var1: %s\tvar2: %s\n}}"" ""{{$VAR1}}"" ""{{$VAR2}}""`
* Store a formatted message in a variable (does not work on zsh):
`printf -v {{myvar}} {{""This is %s = %d\n"" ""a year"" 2016}}`"
What is pwd command,,"# pwd
> Print name of current/working directory. More information:
> https://www.gnu.org/software/coreutils/pwd.
* Print the current directory:
`pwd`
* Print the current directory, and resolve all symlinks (i.e. show the ""physical"" path):
`pwd -P`"
What is loadkeys command,,"# loadkeys
> Load the kernel keymap for the console. More information:
> https://manned.org/loadkeys.
* Load a default keymap:
`loadkeys --default`
* Load default keymap when an unusual keymap is loaded and `-` sign cannot be found:
`loadkeys defmap`
* Create a kernel source table:
`loadkeys --mktable`
* Create a binary keymap:
`loadkeys --bkeymap`
* Search and parse keymap without action:
`loadkeys --parse`
* Load the keymap suppressing all output:
`loadkeys --quiet`
* Load a keymap from the specified file for the console:
`loadkeys --console {{/dev/ttyN}} {{/path/to/file}}`
* Use standard names for keymaps of different locales:
`loadkeys --console {{/dev/ttyN}} {{uk}}`"
What is env command,,"# env
> Show the environment or run a program in a modified environment. More
> information: https://www.gnu.org/software/coreutils/env.
* Show the environment:
`env`
* Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program:
`env {{program}}`
* Clear the environment and run a program:
`env -i {{program}}`
* Remove variable from the environment and run a program:
`env -u {{variable}} {{program}}`
* Set a variable and run a program:
`env {{variable}}={{value}} {{program}}`
* Set multiple variables and run a program:
`env {{variable1}}={{value}} {{variable2}}={{value}} {{variable3}}={{value}}
{{program}}`"
What is look command,,"# look
> Look for lines in sorted file. More information: https://manned.org/look.
* Look for lines which begins with the given prefix:
`look {{prefix}} {{path/to/file}}`
* Look for lines ignoring case:
`look --ignore-case {{prefix}} {{path/to/file}}`"
What is fgrep command,,"# fgrep
> Matches fixed strings in files. Equivalent to `grep -F`. More information:
> https://www.gnu.org/software/grep/manual/grep.html.
* Search for an exact string in a file:
`fgrep {{search_string}} {{path/to/file}}`
* Search only lines that match entirely in files:
`fgrep -x {{path/to/file1}} {{path/to/file2}}`
* Count the number of lines that match the given string in a file:
`fgrep -c {{search_string}} {{path/to/file}}`
* Show the line number in the file along with the line matched:
`fgrep -n {{search_string}} {{path/to/file}}`
* Display all lines except those that contain the search string:
`fgrep -v {{search_string}} {{path/to/file}}`
* Display filenames whose content matches the search string at least once:
`fgrep -l {{search_string}} {{path/to/file1}} {{path/to/file2}}`"
What is df command,,"# df
> Gives an overview of the filesystem disk space usage. More information:
> https://www.gnu.org/software/coreutils/df.
* Display all filesystems and their disk usage:
`df`
* Display all filesystems and their disk usage in human-readable form:
`df -h`
* Display the filesystem and its disk usage containing the given file or directory:
`df {{path/to/file_or_directory}}`
* Display statistics on the number of free inodes:
`df -i`
* Display filesystems but exclude the specified types:
`df -x {{squashfs}} -x {{tmpfs}}`"
What is sha512sum command,,"# sha512sum
> Calculate SHA512 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/manual/html_node/sha2-utilities.html.
* Calculate the SHA512 checksum for one or more files:
`sha512sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of SHA512 checksums to a file:
`sha512sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha512}}`
* Calculate a SHA512 checksum from `stdin`:
`{{command}} | sha512sum`
* Read a file of SHA512 sums and filenames and verify all files have matching checksums:
`sha512sum --check {{path/to/file.sha512}}`
* Only show a message for missing files or when verification fails:
`sha512sum --check --quiet {{path/to/file.sha512}}`
* Only show a message when verification fails, ignoring missing files:
`sha512sum --ignore-missing --check --quiet {{path/to/file.sha512}}`"
What is dpkg-deb command,,"# dpkg-deb
> Pack, unpack and provide information about Debian archives. More
> information: https://manpages.debian.org/latest/dpkg/dpkg-deb.html.
* Display information about a package:
`dpkg-deb --info {{path/to/file.deb}}`
* Display the package's name and version on one line:
`dpkg-deb --show {{path/to/file.deb}}`
* List the package's contents:
`dpkg-deb --contents {{path/to/file.deb}}`
* Extract package's contents into a directory:
`dpkg-deb --extract {{path/to/file.deb}} {{path/to/directory}}`
* Create a package from a specified directory:
`dpkg-deb --build {{path/to/directory}}`"
What is updatedb command,,"# updatedb
> Create or update the database used by `locate`. It is usually run daily by
> cron. More information: https://manned.org/updatedb.
* Refresh database content:
`sudo updatedb`
* Display file names as soon as they are found:
`sudo updatedb --verbose`"
What is sort command,,"# sort
> Sort lines of text files. More information:
> https://www.gnu.org/software/coreutils/sort.
* Sort a file in ascending order:
`sort {{path/to/file}}`
* Sort a file in descending order:
`sort --reverse {{path/to/file}}`
* Sort a file in case-insensitive way:
`sort --ignore-case {{path/to/file}}`
* Sort a file using numeric rather than alphabetic order:
`sort --numeric-sort {{path/to/file}}`
* Sort `/etc/passwd` by the 3rd field of each line numerically, using "":"" as a field separator:
`sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}`
* Sort a file preserving only unique lines:
`sort --unique {{path/to/file}}`
* Sort a file, printing the output to the specified output file (can be used to sort a file in-place):
`sort --output={{path/to/file}} {{path/to/file}}`
* Sort numbers with exponents:
`sort --general-numeric-sort {{path/to/file}}`"
What is lex command,,"# lex
> Lexical analyzer generator. Given the specification for a lexical analyzer,
> generates C code implementing it. More information:
> https://keith.github.io/xcode-man-pages/lex.1.html.
* Generate an analyzer from a Lex file:
`lex {{analyzer.l}}`
* Specify the output file:
`lex {{analyzer.l}} --outfile {{analyzer.c}}`
* Compile a C file generated by Lex:
`cc {{path/to/lex.yy.c}} --output {{executable}}`"
What is ulimit command,,"# ulimit
> Get and set user limits. More information: https://manned.org/ulimit.
* Get the properties of all the user limits:
`ulimit -a`
* Get hard limit for the number of simultaneously opened files:
`ulimit -H -n`
* Get soft limit for the number of simultaneously opened files:
`ulimit -S -n`
* Set max per-user process limit:
`ulimit -u 30`"
What is chfn command,,"# chfn
> Update `finger` info for a user. More information: https://manned.org/chfn.
* Update a user's ""Name"" field in the output of `finger`:
`chfn -f {{new_display_name}} {{username}}`
* Update a user's ""Office Room Number"" field for the output of `finger`:
`chfn -o {{new_office_room_number}} {{username}}`
* Update a user's ""Office Phone Number"" field for the output of `finger`:
`chfn -p {{new_office_telephone_number}} {{username}}`
* Update a user's ""Home Phone Number"" field for the output of `finger`:
`chfn -h {{new_home_telephone_number}} {{username}}`"
What is nice command,,"# nice
> Execute a program with a custom scheduling priority (niceness). Niceness
> values range from -20 (the highest priority) to 19 (the lowest). More
> information: https://www.gnu.org/software/coreutils/nice.
* Launch a program with altered priority:
`nice -n {{niceness_value}} {{command}}`"
What is tail command,,"# tail
> Display the last part of a file. See also: `head`. More information:
> https://manned.org/man/freebsd-13.0/tail.1.
* Show last 'count' lines in file:
`tail -n {{8}} {{path/to/file}}`
* Print a file from a specific line number:
`tail -n +{{8}} {{path/to/file}}`
* Print a specific count of bytes from the end of a given file:
`tail -c {{8}} {{path/to/file}}`
* Print the last lines of a given file and keep reading file until `Ctrl + C`:
`tail -f {{path/to/file}}`
* Keep reading file until `Ctrl + C`, even if the file is inaccessible:
`tail -F {{path/to/file}}`
* Show last 'count' lines in 'file' and refresh every 'seconds' seconds:
`tail -n {{8}} -s {{10}} -f {{path/to/file}}`"
What is ctags command,,"# ctags
> Generates an index (or tag) file of language objects found in source files
> for many popular programming languages. More information: https://ctags.io/.
* Generate tags for a single file, and output them to a file named ""tags"" in the current directory, overwriting the file if it exists:
`ctags {{path/to/file}}`
* Generate tags for all files in the current directory, and output them to a specific file, overwriting the file if it exists:
`ctags -f {{path/to/file}} *`
* Generate tags for all files in the current directory and all subdirectories:
`ctags --recurse`
* Generate tags for a single file, and output them with start line number and end line number in JSON format:
`ctags --fields=+ne --output-format=json {{path/to/file}}`"
What is mkdir command,,"# mkdir
> Create directories and set their permissions. More information:
> https://www.gnu.org/software/coreutils/mkdir.
* Create specific directories:
`mkdir {{path/to/directory1 path/to/directory2 ...}}`
* Create specific directories and their [p]arents if needed:
`mkdir -p {{path/to/directory1 path/to/directory2 ...}}`
* Create directories with specific permissions:
`mkdir -m {{rwxrw-r--}} {{path/to/directory1 path/to/directory2 ...}}`"
What is test command,,"# test
> Check file types and compare values. Returns 0 if the condition evaluates to
> true, 1 if it evaluates to false. More information:
> https://www.gnu.org/software/coreutils/test.
* Test if a given variable is equal to a given string:
`test ""{{$MY_VAR}}"" == ""{{/bin/zsh}}""`
* Test if a given variable is empty:
`test -z ""{{$GIT_BRANCH}}""`
* Test if a file exists:
`test -f ""{{path/to/file_or_directory}}""`
* Test if a directory does not exist:
`test ! -d ""{{path/to/directory}}""`
* If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):
`test {{condition}} && {{echo ""true""}} || {{echo ""false""}}`"
What is uptime command,,"# uptime
> Tell how long the system has been running and other information. More
> information: https://ss64.com/osx/uptime.html.
* Print current time, uptime, number of logged-in users and other information:
`uptime`"
What is sha384sum command,,"# sha384sum
> Calculate SHA384 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/manual/html_node/sha2-utilities.html.
* Calculate the SHA384 checksum for one or more files:
`sha384sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of SHA384 checksums to a file:
`sha384sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha384}}`
* Calculate a SHA384 checksum from `stdin`:
`{{command}} | sha384sum`
* Read a file of SHA384 sums and filenames and verify all files have matching checksums:
`sha384sum --check {{path/to/file.sha384}}`
* Only show a message for missing files or when verification fails:
`sha384sum --check --quiet {{path/to/file.sha384}}`
* Only show a message when verification fails, ignoring missing files:
`sha384sum --ignore-missing --check --quiet {{path/to/file.sha384}}`"
What is file command,,"# file
> Determine file type. More information: https://manned.org/file.
* Give a description of the type of the specified file. Works fine for files with no file extension:
`file {{path/to/file}}`
* Look inside a zipped file and determine the file type(s) inside:
`file -z {{foo.zip}}`
* Allow file to work with special or device files:
`file -s {{path/to/file}}`
* Don't stop at first file type match; keep going until the end of the file:
`file -k {{path/to/file}}`
* Determine the MIME encoding type of a file:
`file -i {{path/to/file}}`"
What is rm command,,"# rm
> Remove files or directories. See also: `rmdir`. More information:
> https://www.gnu.org/software/coreutils/rm.
* Remove specific files:
`rm {{path/to/file1 path/to/file2 ...}}`
* Remove specific files ignoring nonexistent ones:
`rm -f {{path/to/file1 path/to/file2 ...}}`
* Remove specific files [i]nteractively prompting before each removal:
`rm -i {{path/to/file1 path/to/file2 ...}}`
* Remove specific files printing info about each removal:
`rm -v {{path/to/file1 path/to/file2 ...}}`
* Remove specific files and directories [r]ecursively:
`rm -r {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`"
What is git-update-ref command,,"# git update-ref
> Git command for creating, updating, and deleting Git refs. More information:
> https://git-scm.com/docs/git-update-ref.
* Delete a ref, useful for soft resetting the first commit:
`git update-ref -d {{HEAD}}`
* Update ref with a message:
`git update-ref -m {{message}} {{HEAD}} {{4e95e05}}`"
What is localectl command,,"# localectl
> Control the system locale and keyboard layout settings. More information:
> https://www.freedesktop.org/software/systemd/man/localectl.html.
* Show the current settings of the system locale and keyboard mapping:
`localectl`
* List available locales:
`localectl list-locales`
* Set a system locale variable:
`localectl set-locale {{LANG}}={{en_US.UTF-8}}`
* List available keymaps:
`localectl list-keymaps`
* Set the system keyboard mapping for the console and X11:
`localectl set-keymap {{us}}`"
What is cat command,,"# cat
> Print and concatenate files. More information:
> https://keith.github.io/xcode-man-pages/cat.1.html.
* Print the contents of a file to `stdout`:
`cat {{path/to/file}}`
* Concatenate several files into an output file:
`cat {{path/to/file1 path/to/file2 ...}} > {{path/to/output_file}}`
* Append several files to an output file:
`cat {{path/to/file1 path/to/file2 ...}} >> {{path/to/output_file}}`
* Copy the contents of a file into an output file without buffering:
`cat -u {{/dev/tty12}} > {{/dev/tty13}}`
* Write `stdin` to a file:
`cat - > {{path/to/file}}`
* Number all output lines:
`cat -n {{path/to/file}}`
* Display non-printable and whitespace characters (with `M-` prefix if non-ASCII):
`cat -v -t -e {{path/to/file}}`"
What is fc command,,"# fc
> Open the most recent command and edit it. More information:
> https://manned.org/fc.
* Open in the default system editor:
`fc`
* Specify an editor to open with:
`fc -e {{'emacs'}}`
* List recent commands from history:
`fc -l`
* List recent commands in reverse order:
`fc -l -r`
* List commands in a given interval:
`fc '{{416}}' '{{420}}'`"
What is sum command,,"# sum
> Compute checksums and the number of blocks for a file. A predecessor to the
> more modern `cksum`. More information:
> https://www.gnu.org/software/coreutils/sum.
* Compute a checksum with BSD-compatible algorithm and 1024-byte blocks:
`sum {{path/to/file}}`
* Compute a checksum with System V-compatible algorithm and 512-byte blocks:
`sum --sysv {{path/to/file}}`"
What is sha256sum command,,"# sha256sum
> Calculate SHA256 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/manual/html_node/sha2-utilities.html.
* Calculate the SHA256 checksum for one or more files:
`sha256sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of SHA256 checksums to a file:
`sha256sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha256}}`
* Calculate a SHA256 checksum from `stdin`:
`{{command}} | sha256sum`
* Read a file of SHA256 sums and filenames and verify all files have matching checksums:
`sha256sum --check {{path/to/file.sha256}}`
* Only show a message for missing files or when verification fails:
`sha256sum --check --quiet {{path/to/file.sha256}}`
* Only show a message when verification fails, ignoring missing files:
`sha256sum --ignore-missing --check --quiet {{path/to/file.sha256}}`"
What is runcon command,,"# runcon
> Run a program in a different SELinux security context. With neither context
> nor command, print the current security context. More information:
> https://www.gnu.org/software/coreutils/runcon.
* Determine the current domain:
`runcon`
* Specify the domain to run a command in:
`runcon -t {{domain}}_t {{command}}`
* Specify the context role to run a command with:
`runcon -r {{role}}_r {{command}}`
* Specify the full context to run a command with:
`runcon {{user}}_u:{{role}}_r:{{domain}}_t {{command}}`"
What is curl command,,"# curl
> Transfers data from or to a server. Supports most protocols, including HTTP,
> FTP, and POP3. More information: https://curl.se/docs/manpage.html.
* Download the contents of a URL to a file:
`curl {{http://example.com}} --output {{path/to/file}}`
* Download a file, saving the output under the filename indicated by the URL:
`curl --remote-name {{http://example.com/filename}}`
* Download a file, following location redirects, and automatically continuing (resuming) a previous file transfer and return an error on server error:
`curl --fail --remote-name --location --continue-at -
{{http://example.com/filename}}`
* Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from STDIN:
`curl --data {{'name=bob'}} {{http://example.com/form}}`
* Send a request with an extra header, using a custom HTTP method:
`curl --header {{'X-My-Header: 123'}} --request {{PUT}}
{{http://example.com}}`
* Send data in JSON format, specifying the appropriate content-type header:
`curl --data {{'{""name"":""bob""}'}} --header {{'Content-Type:
application/json'}} {{http://example.com/users/1234}}`
* Pass a username and password for server authentication:
`curl --user myusername:mypassword {{http://example.com}}`
* Pass client certificate and key for a resource, skipping certificate validation:
`curl --cert {{client.pem}} --key {{key.pem}} --insecure
{{https://example.com}}`"
What is git-verify-commit command,,"# git verify-commit
> Check for GPG verification of commits. If no commits are verified, nothing
> will be printed, regardless of options specified. More information:
> https://git-scm.com/docs/git-verify-commit.
* Check commits for a GPG signature:
`git verify-commit {{commit_hash1 optional_commit_hash2 ...}}`
* Check commits for a GPG signature and show details of each commit:
`git verify-commit {{commit_hash1 optional_commit_hash2 ...}} --verbose`
* Check commits for a GPG signature and print the raw details:
`git verify-commit {{commit_hash1 optional_commit_hash2 ...}} --raw`"
What is rmdir command,,"# rmdir
> Remove directories without files. See also: `rm`. More information:
> https://www.gnu.org/software/coreutils/rmdir.
* Remove specific directories:
`rmdir {{path/to/directory1 path/to/directory2 ...}}`
* Remove specific nested directories recursively:
`rmdir -p {{path/to/directory1 path/to/directory2 ...}}`"
What is getfacl command,,"# getfacl
> Get file access control lists. More information: https://manned.org/getfacl.
* Display the file access control list:
`getfacl {{path/to/file_or_directory}}`
* Display the file access control list with numeric user and group IDs:
`getfacl -n {{path/to/file_or_directory}}`
* Display the file access control list with tabular output format:
`getfacl -t {{path/to/file_or_directory}}`"
What is nsenter command,,"# nsenter
> Run a new command in a running process' namespace. Particularly useful for
> docker images or chroot jails. More information: https://manned.org/nsenter.
* Run a specific command using the same namespaces as an existing process:
`nsenter --target {{pid}} --all {{command}} {{command_arguments}}`
* Run a specific command in an existing process's network namespace:
`nsenter --target {{pid}} --net {{command}} {{command_arguments}}`
* Run a specific command in an existing process's PID namespace:
`nsenter --target {{pid}} --pid {{command}} {{command_arguments}}`
* Run a specific command in an existing process's IPC namespace:
`nsenter --target {{pid}} --ipc {{command}} {{command_arguments}}`
* Run a specific command in an existing process's UTS, time, and IPC namespaces:
`nsenter --target {{pid}} --uts --time --ipc -- {{command}}
{{command_arguments}}`
* Run a specific command in an existing process's namespace by referencing procfs:
`nsenter --pid=/proc/{{pid}}/pid/net -- {{command}} {{command_arguments}}`"
What is rsync command,,"# rsync
> Transfer files either to or from a remote host (but not between two remote
> hosts), by default using SSH. To specify a remote path, use
> `host:path/to/file_or_directory`. More information:
> https://download.samba.org/pub/rsync/rsync.1.
* Transfer a file:
`rsync {{path/to/source}} {{path/to/destination}}`
* Use archive mode (recursively copy directories, copy symlinks without resolving and preserve permissions, ownership and modification times):
`rsync --archive {{path/to/source}} {{path/to/destination}}`
* Compress the data as it is sent to the destination, display verbose and human-readable progress, and keep partially transferred files if interrupted:
`rsync --compress --verbose --human-readable --partial --progress
{{path/to/source}} {{path/to/destination}}`
* Recursively copy directories:
`rsync --recursive {{path/to/source}} {{path/to/destination}}`
* Transfer directory contents, but not the directory itself:
`rsync --recursive {{path/to/source}}/ {{path/to/destination}}`
* Recursively copy directories, use archive mode, resolve symlinks and skip files that are newer on the destination:
`rsync --recursive --archive --update --copy-links {{path/to/source}}
{{path/to/destination}}`
* Transfer a directory to a remote host running `rsyncd` and delete files on the destination that do not exist on the source:
`rsync --recursive --delete rsync://{{host}}:{{path/to/source}}
{{path/to/destination}}`
* Transfer a file over SSH using a different port than the default (22) and show global progress:
`rsync --rsh 'ssh -p {{port}}' --info=progress2 {{host}}:{{path/to/source}}
{{path/to/destination}}`"
What is unexpand command,,"# unexpand
> Convert spaces to tabs. More information:
> https://www.gnu.org/software/coreutils/unexpand.
* Convert blanks in each file to tabs, writing to `stdout`:
`unexpand {{path/to/file}}`
* Convert blanks to tabs, reading from `stdout`:
`unexpand`
* Convert all blanks, instead of just initial blanks:
`unexpand -a {{path/to/file}}`
* Convert only leading sequences of blanks (overrides -a):
`unexpand --first-only {{path/to/file}}`
* Have tabs a certain number of characters apart, not 8 (enables -a):
`unexpand -t {{number}} {{path/to/file}}`"
What is scp command,,"# scp
> Secure copy. Copy files between hosts using Secure Copy Protocol over SSH.
> More information: https://man.openbsd.org/scp.
* Copy a local file to a remote host:
`scp {{path/to/local_file}} {{remote_host}}:{{path/to/remote_file}}`
* Use a specific port when connecting to the remote host:
`scp -P {{port}} {{path/to/local_file}}
{{remote_host}}:{{path/to/remote_file}}`
* Copy a file from a remote host to a local directory:
`scp {{remote_host}}:{{path/to/remote_file}} {{path/to/local_directory}}`
* Recursively copy the contents of a directory from a remote host to a local directory:
`scp -r {{remote_host}}:{{path/to/remote_directory}}
{{path/to/local_directory}}`
* Copy a file between two remote hosts transferring through the local host:
`scp -3 {{host1}}:{{path/to/remote_file}}
{{host2}}:{{path/to/remote_directory}}`
* Use a specific username when connecting to the remote host:
`scp {{path/to/local_file}}
{{remote_username}}@{{remote_host}}:{{path/to/remote_directory}}`
* Use a specific ssh private key for authentication with the remote host:
`scp -i {{~/.ssh/private_key}} {{local_file}}
{{remote_host}}:{{/path/remote_file}}`"
What is timedatectl command,,"# timedatectl
> Control the system time and date. More information:
> https://manned.org/timedatectl.
* Check the current system clock time:
`timedatectl`
* Set the local time of the system clock directly:
`timedatectl set-time ""{{yyyy-MM-dd hh:mm:ss}}""`
* List available timezones:
`timedatectl list-timezones`
* Set the system timezone:
`timedatectl set-timezone {{timezone}}`
* Enable Network Time Protocol (NTP) synchronization:
`timedatectl set-ntp on`
* Change the hardware clock time standard to localtime:
`timedatectl set-local-rtc 1`"
What is screen command,,"# screen
> Hold a session open on a remote server. Manage multiple windows with a
> single SSH connection. See also `tmux` and `zellij`. More information:
> https://manned.org/screen.
* Start a new screen session:
`screen`
* Start a new named screen session:
`screen -S {{session_name}}`
* Start a new daemon and log the output to `screenlog.x`:
`screen -dmLS {{session_name}} {{command}}`
* Show open screen sessions:
`screen -ls`
* Reattach to an open screen:
`screen -r {{session_name}}`
* Detach from inside a screen:
`Ctrl + A, D`
* Kill the current screen session:
`Ctrl + A, K`
* Kill a detached screen:
`screen -X -S {{session_name}} quit`"
What is write command,,"# write
> Write a message on the terminal of a specified logged in user (ctrl-C to
> stop writing messages). Use the `who` command to find out all terminal_ids
> of all active users active on the system. See also `mesg`. More information:
> https://manned.org/write.
* Send a message to a given user on a given terminal id:
`write {{username}} {{terminal_id}}`
* Send message to ""testuser"" on terminal `/dev/tty/5`:
`write {{testuser}} {{tty/5}}`
* Send message to ""johndoe"" on pseudo terminal `/dev/pts/5`:
`write {{johndoe}} {{pts/5}}`"
What is as command,,"# as
> Portable GNU assembler. Primarily intended to assemble output from `gcc` to
> be used by `ld`. More information: https://www.unix.com/man-page/osx/1/as/.
* Assemble a file, writing the output to `a.out`:
`as {{path/to/file.s}}`
* Assemble the output to a given file:
`as {{path/to/file.s}} -o {{path/to/output_file.o}}`
* Generate output faster by skipping whitespace and comment preprocessing. (Should only be used for trusted compilers):
`as -f {{path/to/file.s}}`
* Include a given path to the list of directories to search for files specified in `.include` directives:
`as -I {{path/to/directory}} {{path/to/file.s}}`"
What is systemd-cat command,,"# systemd-cat
> Connect a pipeline or program's output streams with the systemd journal.
> More information: https://www.freedesktop.org/software/systemd/man/systemd-
> cat.html.
* Write the output of the specified command to the journal (both output streams are captured):
`systemd-cat {{command}}`
* Write the output of a pipeline to the journal (`stderr` stays connected to the terminal):
`{{command}} | systemd-cat`"
What is git-rev-parse command,,"# git rev-parse
> Display metadata related to specific revisions. More information:
> https://git-scm.com/docs/git-rev-parse.
* Get the commit hash of a branch:
`git rev-parse {{branch_name}}`
* Get the current branch name:
`git rev-parse --abbrev-ref {{HEAD}}`
* Get the absolute path to the root directory:
`git rev-parse --show-toplevel`"
What is patch command,,"# patch
> Patch a file (or files) with a diff file. Note that diff files should be
> generated by the `diff` command. More information: https://manned.org/patch.
* Apply a patch using a diff file (filenames must be included in the diff file):
`patch < {{patch.diff}}`
* Apply a patch to a specific file:
`patch {{path/to/file}} < {{patch.diff}}`
* Patch a file writing the result to a different file:
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
* Apply a patch to the current directory:
`patch -p1 < {{patch.diff}}`
* Apply the reverse of a patch:
`patch -R < {{patch.diff}}`"
What is size command,,"# size
> Displays the sizes of sections inside binary files. More information:
> https://sourceware.org/binutils/docs/binutils/size.html.
* Display the size of sections in a given object or executable file:
`size {{path/to/file}}`
* Display the size of sections in a given object or executable file in [o]ctal:
`size {{-o|--radix=8}} {{path/to/file}}`
* Display the size of sections in a given object or executable file in [d]ecimal:
`size {{-d|--radix=10}} {{path/to/file}}`
* Display the size of sections in a given object or executable file in he[x]adecimal:
`size {{-x|--radix=16}} {{path/to/file}}`"
What is column command,,"# column
> Format `stdin` or a file into multiple columns. Columns are filled before
> rows; the default separator is a whitespace. More information:
> https://manned.org/column.
* Format the output of a command for a 30 characters wide display:
`printf ""header1 header2\nbar foo\n"" | column --output-width {{30}}`
* Split columns automatically and auto-align them in a tabular format:
`printf ""header1 header2\nbar foo\n"" | column --table`
* Specify the column delimiter character for the `--table` option (e.g. "","" for CSV) (defaults to whitespace):
`printf ""header1,header2\nbar,foo\n"" | column --table --separator {{,}}`
* Fill rows before filling columns:
`printf ""header1\nbar\nfoobar\n"" | column --output-width {{30}} --fillrows`"
What is seq command,,"# seq
> Output a sequence of numbers to `stdout`. More information:
> https://www.gnu.org/software/coreutils/seq.
* Sequence from 1 to 10:
`seq 10`
* Every 3rd number from 5 to 20:
`seq 5 3 20`
* Separate the output with a space instead of a newline:
`seq -s "" "" 5 3 20`
* Format output width to a minimum of 4 digits padding with zeros as necessary:
`seq -f ""%04g"" 5 3 20`"
What is fmt command,,"# fmt
> Reformat a text file by joining its paragraphs and limiting the line width
> to given number of characters (75 by default). More information:
> https://www.gnu.org/software/coreutils/fmt.
* Reformat a file:
`fmt {{path/to/file}}`
* Reformat a file producing output lines of (at most) `n` characters:
`fmt -w {{n}} {{path/to/file}}`
* Reformat a file without joining lines shorter than the given width together:
`fmt -s {{path/to/file}}`
* Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs):
`fmt -u {{path/to/file}}`"
What is groups command,,"# groups
> Print group memberships for a user. See also: `groupadd`, `groupdel`,
> `groupmod`. More information: https://www.gnu.org/software/coreutils/groups.
* Print group memberships for the current user:
`groups`
* Print group memberships for a list of users:
`groups {{username1 username2 ...}}`"
What is nm command,,"# nm
> List symbol names in object files. More information: https://manned.org/nm.
* List global (extern) functions in a file (prefixed with T):
`nm -g {{path/to/file.o}}`
* List only undefined symbols in a file:
`nm -u {{path/to/file.o}}`
* List all symbols, even debugging symbols:
`nm -a {{path/to/file.o}}`
* Demangle C++ symbols (make them readable):
`nm --demangle {{path/to/file.o}}`"
What is git-stage command,,"# git stage
> Add file contents to the staging area. Synonym of `git add`. More
> information: https://git-scm.com/docs/git-stage.
* Add a file to the index:
`git stage {{path/to/file}}`
* Add all files (tracked and untracked):
`git stage -A`
* Only add already tracked files:
`git stage -u`
* Also add ignored files:
`git stage -f`
* Interactively stage parts of files:
`git stage -p`
* Interactively stage parts of a given file:
`git stage -p {{path/to/file}}`
* Interactively stage a file:
`git stage -i`"
What is dd command,,"# dd
> Convert and copy a file. More information: https://keith.github.io/xcode-
> man-pages/dd.1.html.
* Make a bootable USB drive from an isohybrid file (such like `archlinux-xxx.iso`) and show the progress:
`dd if={{path/to/file.iso}} of={{/dev/usb_device}} status=progress`
* Clone a drive to another drive with 4 MB block, ignore error and show the progress:
`dd if={{/dev/source_device}} of={{/dev/dest_device}} bs={{4m}}
conv={{noerror}} status=progress`
* Generate a file of 100 random bytes by using kernel random driver:
`dd if=/dev/urandom of={{path/to/random_file}} bs={{100}} count={{1}}`
* Benchmark the write performance of a disk:
`dd if=/dev/zero of={{path/to/1GB_file}} bs={{1024}} count={{1000000}}`
* Generate a system backup into an IMG file and show the progress:
`dd if=/dev/{{drive_device}} of={{path/to/file.img}} status=progress`
* Restore a drive from an IMG file and show the progress:
`dd if={{path/to/file.img}} of={{/dev/drive_device}} status=progress`
* Check the progress of an ongoing dd operation (run this command from another shell):
`kill -USR1 $(pgrep ^dd)`"
What is prlimit command,,"# prlimit
> Get or set process resource soft and hard limits. Given a process ID and one
> or more resources, prlimit tries to retrieve and/or modify the limits. More
> information: https://manned.org/prlimit.
* Display limit values for all current resources for the running parent process:
`prlimit`
* Display limit values for all current resources of a specified process:
`prlimit --pid {{pid number}}`
* Run a command with a custom number of open files limit:
`prlimit --nofile={{10}} {{command}}`"
What is uniq command,,"# uniq
> Output the unique lines from the given input or file. Since it does not
> detect repeated lines unless they are adjacent, we need to sort them first.
> More information: https://www.gnu.org/software/coreutils/uniq.
* Display each line once:
`sort {{path/to/file}} | uniq`
* Display only unique lines:
`sort {{path/to/file}} | uniq -u`
* Display only duplicate lines:
`sort {{path/to/file}} | uniq -d`
* Display number of occurrences of each line along with that line:
`sort {{path/to/file}} | uniq -c`
* Display number of occurrences of each line, sorted by the most frequent:
`sort {{path/to/file}} | uniq -c | sort -nr`"
What is git-remote command,,"# git remote
> Manage set of tracked repositories (""remotes""). More information:
> https://git-scm.com/docs/git-remote.
* Show a list of existing remotes, their names and URL:
`git remote -v`
* Show information about a remote:
`git remote show {{remote_name}}`
* Add a remote:
`git remote add {{remote_name}} {{remote_url}}`
* Change the URL of a remote (use `--add` to keep the existing URL):
`git remote set-url {{remote_name}} {{new_url}}`
* Show the URL of a remote:
`git remote get-url {{remote_name}}`
* Remove a remote:
`git remote remove {{remote_name}}`
* Rename a remote:
`git remote rename {{old_name}} {{new_name}}`"
What is systemd-path command,,"# systemd-path
> List and query system and user paths. More information:
> https://www.freedesktop.org/software/systemd/man/systemd-path.html.
* Display a list of known paths and their current values:
`systemd-path`
* Query the specified path and display its value:
`systemd-path ""{{path_name}}""`
* Suffix printed paths with `suffix_string`:
`systemd-path --suffix {{suffix_string}}`
* Print a short version string and then exit:
`systemd-path --version`"
What is whatis command,,"# whatis
> Tool that searches a set of database files containing short descriptions of
> system commands for keywords. More information:
> http://www.linfo.org/whatis.html.
* Search for information about keyword:
`whatis {{keyword}}`
* Search for information about multiple keywords:
`whatis {{keyword1}} {{keyword2}}`"
What is git-grep command,,"# git-grep
> Find strings inside files anywhere in a repository's history. Accepts a lot
> of the same flags as regular `grep`. More information: https://git-
> scm.com/docs/git-grep.
* Search for a string in tracked files:
`git grep {{search_string}}`
* Search for a string in files matching a pattern in tracked files:
`git grep {{search_string}} -- {{file_glob_pattern}}`
* Search for a string in tracked files, including submodules:
`git grep --recurse-submodules {{search_string}}`
* Search for a string at a specific point in history:
`git grep {{search_string}} {{HEAD~2}}`
* Search for a string across all branches:
`git grep {{search_string}} $(git rev-list --all)`"
What is touch command,,"# touch
> Create files and set access/modification times. More information:
> https://manned.org/man/freebsd-13.1/touch.
* Create specific files:
`touch {{path/to/file1 path/to/file2 ...}}`
* Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:
`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}`
* Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:
`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}`
* Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:
`touch -c -r {{~/.emacs}} {{path/to/file1 path/to/file2 ...}}`"
What is vdir command,,"# vdir
> List directory contents. Drop-in replacement for `ls -l`. More information:
> https://www.gnu.org/software/coreutils/vdir.
* List files and directories in the current directory, one per line, with details:
`vdir`
* List with sizes displayed in human-readable units (KB, MB, GB):
`vdir -h`
* List including hidden files (starting with a dot):
`vdir -a`
* List files and directories sorting entries by size (largest first):
`vdir -S`
* List files and directories sorting entries by modification time (newest first):
`vdir -t`
* List grouping directories first:
`vdir --group-directories-first`
* Recursively list all files and directories in a specific directory:
`vdir --recursive {{path/to/directory}}`"
What is pmap command,,"# pmap
> Report memory map of a process or processes. More information:
> https://manned.org/pmap.
* Print memory map for a specific process id (PID):
`pmap {{pid}}`
* Show the extended format:
`pmap --extended {{pid}}`
* Show the device format:
`pmap --device {{pid}}`
* Limit results to a memory address range specified by `low` and `high`:
`pmap --range {{low}},{{high}}`
* Print memory maps for multiple processes:
`pmap {{pid1 pid2 ...}}`"
What is killall command,,"# killall
> Send kill signal to all instances of a process by name (must be exact name).
> All signals except SIGKILL and SIGSTOP can be intercepted by the process,
> allowing a clean exit. More information: https://manned.org/killall.
* Terminate a process using the default SIGTERM (terminate) signal:
`killall {{process_name}}`
* [l]ist available signal names (to be used without the 'SIG' prefix):
`killall -l`
* Interactively ask for confirmation before termination:
`killall -i {{process_name}}`
* Terminate a process using the SIGINT (interrupt) signal, which is the same signal sent by pressing `Ctrl + C`:
`killall -INT {{process_name}}`
* Force kill a process:
`killall -KILL {{process_name}}`"
What is who command,,"# who
> Display who is logged in and related data (processes, boot time). More
> information: https://www.gnu.org/software/coreutils/who.
* Display the username, line, and time of all currently logged-in sessions:
`who`
* Display information only for the current terminal session:
`who am i`
* Display all available information:
`who -a`
* Display all available information with table headers:
`who -a -H`"
What is mesg command,,"# mesg
> Check or set a terminal's ability to receive messages from other users,
> usually from the write command. See also `write`. More information:
> https://manned.org/mesg.
* Check terminal's openness to write messages:
`mesg`
* Disable receiving messages from the write command:
`mesg n`
* Enable receiving messages from the write command:
`mesg y`"
What is gcov command,,"# gcov
> Code coverage analysis and profiling tool that discovers untested parts of a
> program. Also displays a copy of source code annotated with execution
> frequencies of code segments. More information:
> https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html.
* Generate a coverage report named `file.cpp.gcov`:
`gcov {{path/to/file.cpp}}`
* Write individual execution counts for every basic block:
`gcov --all-blocks {{path/to/file.cpp}}`
* Write branch frequencies to the output file and print summary information to `stdout` as a percentage:
`gcov --branch-probabilities {{path/to/file.cpp}}`
* Write branch frequencies as the number of branches taken, rather than the percentage:
`gcov --branch-counts {{path/to/file.cpp}}`
* Do not create a `gcov` output file:
`gcov --no-output {{path/to/file.cpp}}`
* Write file level as well as function level summaries:
`gcov --function-summaries {{path/to/file.cpp}}`"
What is ltrace command,,"# ltrace
> Display dynamic library calls of a process. More information:
> https://manned.org/ltrace.
* Print (trace) library calls of a program binary:
`ltrace ./{{program}}`
* Count library calls. Print a handy summary at the bottom:
`ltrace -c {{path/to/program}}`
* Trace calls to malloc and free, omit those done by libc:
`ltrace -e malloc+free-@libc.so* {{path/to/program}}`
* Write to file instead of terminal:
`ltrace -o {{file}} {{path/to/program}}`"
What is awk command,,"# awk
> A versatile programming language for working on files. More information:
> https://github.com/onetrueawk/awk.
* Print the fifth column (a.k.a. field) in a space-separated file:
`awk '{print $5}' {{path/to/file}}`
* Print the second column of the lines containing ""foo"" in a space-separated file:
`awk '/{{foo}}/ {print $2}' {{path/to/file}}`
* Print the last column of each line in a file, using a comma (instead of space) as a field separator:
`awk -F ',' '{print $NF}' {{path/to/file}}`
* Sum the values in the first column of a file and print the total:
`awk '{s+=$1} END {print s}' {{path/to/file}}`
* Print every third line starting from the first line:
`awk 'NR%3==1' {{path/to/file}}`
* Print different values based on conditions:
`awk '{if ($1 == ""foo"") print ""Exact match foo""; else if ($1 ~ ""bar"") print
""Partial match bar""; else print ""Baz""}' {{path/to/file}}`
* Print all lines where the 10th column value equals the specified value:
`awk '($10 == value)'`
* Print all the lines which the 10th column value is between a min and a max:
`awk '($10 >= min_value && $10 <= max_value)'`"
What is git-cherry-pick command,,"# git cherry-pick
> Apply the changes introduced by existing commits to the current branch. To
> apply changes to another branch, first use `git checkout` to switch to the
> desired branch. More information: https://git-scm.com/docs/git-cherry-pick.
* Apply a commit to the current branch:
`git cherry-pick {{commit}}`
* Apply a range of commits to the current branch (see also `git rebase --onto`):
`git cherry-pick {{start_commit}}~..{{end_commit}}`
* Apply multiple (non-sequential) commits to the current branch:
`git cherry-pick {{commit_1}} {{commit_2}}`
* Add the changes of a commit to the working directory, without creating a commit:
`git cherry-pick --no-commit {{commit}}`"
What is login command,,"# login
> Initiates a session for a user. More information: https://manned.org/login.
* Log in as a user:
`login {{user}}`
* Log in as user without authentication if user is preauthenticated:
`login -f {{user}}`
* Log in as user and preserve environment:
`login -p {{user}}`
* Log in as a user on a remote host:
`login -h {{host}} {{user}}`"
What is git-branch command,,"# git branch
> Main Git command for working with branches. More information: https://git-
> scm.com/docs/git-branch.
* List all branches (local and remote; the current branch is highlighted by `*`):
`git branch --all`
* List which branches include a specific Git commit in their history:
`git branch --all --contains {{commit_hash}}`
* Show the name of the current branch:
`git branch --show-current`
* Create new branch based on the current commit:
`git branch {{branch_name}}`
* Create new branch based on a specific commit:
`git branch {{branch_name}} {{commit_hash}}`
* Rename a branch (must not have it checked out to do this):
`git branch -m {{old_branch_name}} {{new_branch_name}}`
* Delete a local branch (must not have it checked out to do this):
`git branch -d {{branch_name}}`
* Delete a remote branch:
`git push {{remote_name}} --delete {{remote_branch_name}}`"
What is base64 command,,"# base64
> Encode and decode using Base64 representation. More information:
> https://www.unix.com/man-page/osx/1/base64/.
* Encode a file:
`base64 --input={{plain_file}}`
* Decode a file:
`base64 --decode --input={{base64_file}}`
* Encode from `stdin`:
`echo -n ""{{plain_text}}"" | base64`
* Decode from `stdin`:
`echo -n {{base64_text}} | base64 --decode`"
What is ipcs command,,"# ipcs
> Display information about resources used in IPC (Inter-process
> Communication). More information: https://manned.org/ipcs.
* Specific information about the Message Queue which has the ID 32768:
`ipcs -qi 32768`
* General information about all the IPC:
`ipcs -a`"
What is type command,,"# type
> Display the type of command the shell will execute. More information:
> https://manned.org/type.
* Display the type of a command:
`type {{command}}`
* Display all locations containing the specified executable:
`type -a {{command}}`
* Display the name of the disk file that would be executed:
`type -p {{command}}`"
What is ul command,,"# ul
> Performs the underlining of a text. Each character in a given string must be
> underlined separately. More information: https://manned.org/ul.
* Display the contents of the file with underlines where applicable:
`ul {{file.txt}}`
* Display the contents of the file with underlines made of dashes `-`:
`ul -i {{file.txt}}`"
What is ldd command,,"# ldd
> Display shared library dependencies of a binary. Do not use on an untrusted
> binary, use objdump for that instead. More information:
> https://manned.org/ldd.
* Display shared library dependencies of a binary:
`ldd {{path/to/binary}}`
* Display all information about dependencies:
`ldd --verbose {{path/to/binary}}`
* Display unused direct dependencies:
`ldd --unused {{path/to/binary}}`
* Report missing data objects and perform data relocations:
`ldd --data-relocs {{path/to/binary}}`
* Report missing data objects and functions, and perform relocations for both:
`ldd --function-relocs {{path/to/binary}}`"
What is git-gc command,,"# git gc
> Optimise the local repository by cleaning unnecessary files. More
> information: https://git-scm.com/docs/git-gc.
* Optimise the repository:
`git gc`
* Aggressively optimise, takes more time:
`git gc --aggressive`
* Do not prune loose objects (prunes by default):
`git gc --no-prune`
* Suppress all output:
`git gc --quiet`
* View full usage:
`git gc --help`"
What is git-diff command,,"# git diff
> Show changes to tracked files. More information: https://git-
> scm.com/docs/git-diff.
* Show unstaged, uncommitted changes:
`git diff`
* Show all uncommitted changes (including staged ones):
`git diff HEAD`
* Show only staged (added, but not yet committed) changes:
`git diff --staged`
* Show changes from all commits since a given date/time (a date expression, e.g. ""1 week 2 days"" or an ISO date):
`git diff 'HEAD@{3 months|weeks|days|hours|seconds ago}'`
* Show only names of changed files since a given commit:
`git diff --name-only {{commit}}`
* Output a summary of file creations, renames and mode changes since a given commit:
`git diff --summary {{commit}}`
* Compare a single file between two branches or commits:
`git diff {{branch_1}}..{{branch_2}} [--] {{path/to/file}}`
* Compare different files from the current branch to other branch:
`git diff {{branch}}:{{path/to/file2}} {{path/to/file}}`"
What is unexpand command,,"# unexpand
> Convert spaces to tabs. More information:
> https://www.gnu.org/software/coreutils/unexpand.
* Convert blanks in each file to tabs, writing to `stdout`:
`unexpand {{path/to/file}}`
* Convert blanks to tabs, reading from `stdout`:
`unexpand`
* Convert all blanks, instead of just initial blanks:
`unexpand -a {{path/to/file}}`
* Convert only leading sequences of blanks (overrides -a):
`unexpand --first-only {{path/to/file}}`
* Have tabs a certain number of characters apart, not 8 (enables -a):
`unexpand -t {{number}} {{path/to/file}}`"
What is unlink command,,"# unlink
> Remove a link to a file from the filesystem. The file contents is lost if
> the link is the last one to the file. More information:
> https://www.gnu.org/software/coreutils/unlink.
* Remove the specified file if it is the last link:
`unlink {{path/to/file}}`"
What is ls command,,"# ls
> List directory contents. More information:
> https://www.gnu.org/software/coreutils/ls.
* List files one per line:
`ls -1`
* List all files, including hidden files:
`ls -a`
* List all files, with trailing `/` added to directory names:
`ls -F`
* Long format list (permissions, ownership, size, and modification date) of all files:
`ls -la`
* Long format list with size displayed using human-readable units (KiB, MiB, GiB):
`ls -lh`
* Long format list sorted by size (descending):
`ls -lS`
* Long format list of all files, sorted by modification date (oldest first):
`ls -ltr`
* Only list directories:
`ls -d */`"
What is renice command,,"# renice
> Alters the scheduling priority/niceness of one or more running processes.
> Niceness values range from -20 (most favorable to the process) to 19 (least
> favorable to the process). More information: https://manned.org/renice.
* Change priority of a running process:
`renice -n {{niceness_value}} -p {{pid}}`
* Change priority of all processes owned by a user:
`renice -n {{niceness_value}} -u {{user}}`
* Change priority of all processes that belong to a process group:
`renice -n {{niceness_value}} --pgrp {{process_group}}`"
What is groups command,,"# groups
> Print group memberships for a user. See also: `groupadd`, `groupdel`,
> `groupmod`. More information: https://www.gnu.org/software/coreutils/groups.
* Print group memberships for the current user:
`groups`
* Print group memberships for a list of users:
`groups {{username1 username2 ...}}`"
What is comm command,,"# comm
> Select or reject lines common to two files. Both files must be sorted. More
> information: https://www.gnu.org/software/coreutils/comm.
* Produce three tab-separated columns: lines only in first file, lines only in second file and common lines:
`comm {{file1}} {{file2}}`
* Print only lines common to both files:
`comm -12 {{file1}} {{file2}}`
* Print only lines common to both files, reading one file from `stdin`:
`cat {{file1}} | comm -12 - {{file2}}`
* Get lines only found in first file, saving the result to a third file:
`comm -23 {{file1}} {{file2}} > {{file1_only}}`
* Print lines only found in second file, when the files aren't sorted:
`comm -13 <(sort {{file1}}) <(sort {{file2}})`"
What is iostat command,,"# iostat
> Report statistics for devices and partitions. More information:
> https://manned.org/iostat.
* Display a report of CPU and disk statistics since system startup:
`iostat`
* Display a report of CPU and disk statistics with units converted to megabytes:
`iostat -m`
* Display CPU statistics:
`iostat -c`
* Display disk statistics with disk names (including LVM):
`iostat -N`
* Display extended disk statistics with disk names for device ""sda"":
`iostat -xN {{sda}}`
* Display incremental reports of CPU and disk statistics every 2 seconds:
`iostat {{2}}`"
What is pathchk command,,"# pathchk
> Check the validity and portability of one or more pathnames. More
> information: https://www.gnu.org/software/coreutils/pathchk.
* Check pathnames for validity in the current system:
`pathchk {{path1 path2 …}}`
* Check pathnames for validity on a wider range of POSIX compliant systems:
`pathchk -p {{path1 path2 …}}`
* Check pathnames for validity on all POSIX compliant systems:
`pathchk --portability {{path1 path2 …}}`
* Only check for empty pathnames or leading dashes (-):
`pathchk -P {{path1 path2 …}}`"
What is git-tag command,,"# git tag
> Create, list, delete or verify tags. A tag is a static reference to a
> specific commit. More information: https://git-scm.com/docs/git-tag.
* List all tags:
`git tag`
* Create a tag with the given name pointing to the current commit:
`git tag {{tag_name}}`
* Create a tag with the given name pointing to a given commit:
`git tag {{tag_name}} {{commit}}`
* Create an annotated tag with the given message:
`git tag {{tag_name}} -m {{tag_message}}`
* Delete the tag with the given name:
`git tag -d {{tag_name}}`
* Get updated tags from upstream:
`git fetch --tags`
* List all tags whose ancestors include a given commit:
`git tag --contains {{commit}}`"
What is last command,,"# last
> View the last logged in users. More information: https://manned.org/last.
* View last logins, their duration and other information as read from `/var/log/wtmp`:
`last`
* Specify how many of the last logins to show:
`last -n {{login_count}}`
* Print the full date and time for entries and then display the hostname column last to prevent truncation:
`last -F -a`
* View all logins by a specific user and show the IP address instead of the hostname:
`last {{username}} -i`
* View all recorded reboots (i.e., the last logins of the pseudo user ""reboot""):
`last reboot`
* View all recorded shutdowns (i.e., the last logins of the pseudo user ""shutdown""):
`last shutdown`"
What is git-fetch command,,"# git fetch
> Download objects and refs from a remote repository. More information:
> https://git-scm.com/docs/git-fetch.
* Fetch the latest changes from the default remote upstream repository (if set):
`git fetch`
* Fetch new branches from a specific remote upstream repository:
`git fetch {{remote_name}}`
* Fetch the latest changes from all remote upstream repositories:
`git fetch --all`
* Also fetch tags from the remote upstream repository:
`git fetch --tags`
* Delete local references to remote branches that have been deleted upstream:
`git fetch --prune`"
What is xargs command,,"# xargs
> Execute a command with piped arguments coming from another command, a file,
> etc. The input is treated as a single block of text and split into separate
> pieces on spaces, tabs, newlines and end-of-file. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html.
* Run a command using the input data as arguments:
`{{arguments_source}} | xargs {{command}}`
* Run multiple chained commands on the input data:
`{{arguments_source}} | xargs sh -c ""{{command1}} && {{command2}} |
{{command3}}""`
* Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`
* Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:
`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}`
* Parallel runs of up to `max-procs` processes at a time; the default is 1. If `max-procs` is 0, xargs will run as many processes as possible at a time:
`{{arguments_source}} | xargs -P {{max-procs}} {{command}}`"
What is jobs command,,"# jobs
> Display status of jobs in the current session. More information:
> https://manned.org/jobs.
* Show status of all jobs:
`jobs`
* Show status of a particular job:
`jobs %{{job_id}}`
* Show status and process IDs of all jobs:
`jobs -l`
* Show process IDs of all jobs:
`jobs -p`"
What is objdump command,,"# objdump
> View information about object files. More information:
> https://manned.org/objdump.
* Display the file header information:
`objdump -f {{binary}}`
* Display the disassembled output of executable sections:
`objdump -d {{binary}}`
* Display the disassembled executable sections in intel syntax:
`objdump -M intel -d {{binary}}`
* Display a complete binary hex dump of all sections:
`objdump -s {{binary}}`"
What is git-worktree command,,"# git worktree
> Manage multiple working trees attached to the same repository. More
> information: https://git-scm.com/docs/git-worktree.
* Create a new directory with the specified branch checked out into it:
`git worktree add {{path/to/directory}} {{branch}}`
* Create a new directory with a new branch checked out into it:
`git worktree add {{path/to/directory}} -b {{new_branch}}`
* List all the working directories attached to this repository:
`git worktree list`
* Remove a worktree (after deleting worktree directory):
`git worktree prune`"
What is tee command,,"# tee
> Read from `stdin` and write to `stdout` and files (or commands). More
> information: https://www.gnu.org/software/coreutils/tee.
* Copy `stdin` to each file, and also to `stdout`:
`echo ""example"" | tee {{path/to/file}}`
* Append to the given files, do not overwrite:
`echo ""example"" | tee -a {{path/to/file}}`
* Print `stdin` to the terminal, and also pipe it into another program for further processing:
`echo ""example"" | tee {{/dev/tty}} | {{xargs printf ""[%s]""}}`
* Create a directory called ""example"", count the number of characters in ""example"" and write ""example"" to the terminal:
`echo ""example"" | tee >(xargs mkdir) >(wc -c)`"
What is git-cvsexportcommit command,,"# git cvsexportcommit
> Export a single `Git` commit to a CVS checkout. More information:
> https://git-scm.com/docs/git-cvsexportcommit.
* Merge a specific patch into CVS:
`git cvsexportcommit -v -c -w {{path/to/project_cvs_checkout}}
{{commit_sha1}}`"
What is sdiff command,,"# sdiff
> Compare the differences between and optionally merge 2 files. More
> information: https://manned.org/sdiff.
* Compare 2 files:
`sdiff {{path/to/file1}} {{path/to/file2}}`
* Compare 2 files, ignoring all tabs and whitespace:
`sdiff -W {{path/to/file1}} {{path/to/file2}}`
* Compare 2 files, ignoring whitespace at the end of lines:
`sdiff -Z {{path/to/file1}} {{path/to/file2}}`
* Compare 2 files in a case-insensitive manner:
`sdiff -i {{path/to/file1}} {{path/to/file2}}`
* Compare and then merge, writing the output to a new file:
`sdiff -o {{path/to/merged_file}} {{path/to/file1}} {{path/to/file2}}`"
What is dir command,,"# dir
> List directory contents using one line per file, special characters are
> represented by backslash escape sequences. Works as `ls -C --escape`. More
> information: https://manned.org/dir.
* List all files, including hidden files:
`dir -all`
* List files including their author (`-l` is required):
`dir -l --author`
* List files excluding those that match a specified blob pattern:
`dir --hide={{pattern}}`
* List subdirectories recursively:
`dir --recursive`
* Display help:
`dir --help`"
What is cd command,,"# cd
> Change the current working directory. More information:
> https://manned.org/cd.
* Go to the specified directory:
`cd {{path/to/directory}}`
* Go up to the parent of the current directory:
`cd ..`
* Go to the home directory of the current user:
`cd`
* Go to the home directory of the specified user:
`cd ~{{username}}`
* Go to the previously chosen directory:
`cd -`
* Go to the root directory:
`cd /`"
What is git-revert command,,"# git revert
> Create new commits which reverse the effect of earlier ones. More
> information: https://git-scm.com/docs/git-revert.
* Revert the most recent commit:
`git revert {{HEAD}}`
* Revert the 5th last commit:
`git revert HEAD~{{4}}`
* Revert a specific commit:
`git revert {{0c01a9}}`
* Revert multiple commits:
`git revert {{branch_name~5..branch_name~2}}`
* Don't create new commits, just change the working tree:
`git revert -n {{0c01a9..9a1743}}`"
What is pathchk command,,"# pathchk
> Check the validity and portability of one or more pathnames. More
> information: https://www.gnu.org/software/coreutils/pathchk.
* Check pathnames for validity in the current system:
`pathchk {{path1 path2 …}}`
* Check pathnames for validity on a wider range of POSIX compliant systems:
`pathchk -p {{path1 path2 …}}`
* Check pathnames for validity on all POSIX compliant systems:
`pathchk --portability {{path1 path2 …}}`
* Only check for empty pathnames or leading dashes (-):
`pathchk -P {{path1 path2 …}}`"
What is man command,,"# man
> Format and display manual pages. More information:
> https://www.man7.org/linux/man-pages/man1/man.1.html.
* Display the man page for a command:
`man {{command}}`
* Display the man page for a command from section 7:
`man {{7}} {{command}}`
* List all available sections for a command:
`man -f {{command}}`
* Display the path searched for manpages:
`man --path`
* Display the location of a manpage rather than the manpage itself:
`man -w {{command}}`
* Display the man page using a specific locale:
`man {{command}} --locale={{locale}}`
* Search for manpages containing a search string:
`man -k ""{{search_string}}""`"
What is ps command,,"# ps
> Information about running processes. More information:
> https://www.unix.com/man-page/osx/1/ps/.
* List all running processes:
`ps aux`
* List all running processes including the full command string:
`ps auxww`
* Search for a process that matches a string:
`ps aux | grep {{string}}`
* Get the parent PID of a process:
`ps -o ppid= -p {{pid}}`
* Sort processes by memory usage:
`ps -m`
* Sort processes by CPU usage:
`ps -r`"
What is git-ls-tree command,,"# git ls-tree
> List the contents of a tree object. More information: https://git-
> scm.com/docs/git-ls-tree.
* List the contents of the tree on a branch:
`git ls-tree {{branch_name}}`
* List the contents of the tree on a commit, recursing into subtrees:
`git ls-tree -r {{commit_hash}}`
* List only the filenames of the tree on a commit:
`git ls-tree --name-only {{commit_hash}}`"
What is ssh command,,"# ssh
> Secure Shell is a protocol used to securely log onto remote systems. It can
> be used for logging or executing commands on a remote server. More
> information: https://man.openbsd.org/ssh.
* Connect to a remote server:
`ssh {{username}}@{{remote_host}}`
* Connect to a remote server with a specific identity (private key):
`ssh -i {{path/to/key_file}} {{username}}@{{remote_host}}`
* Connect to a remote server using a specific port:
`ssh {{username}}@{{remote_host}} -p {{2222}}`
* Run a command on a remote server with a [t]ty allocation allowing interaction with the remote command:
`ssh {{username}}@{{remote_host}} -t {{command}} {{command_arguments}}`
* SSH tunneling: Dynamic port forwarding (SOCKS proxy on `localhost:1080`):
`ssh -D {{1080}} {{username}}@{{remote_host}}`
* SSH tunneling: Forward a specific port (`localhost:9999` to `example.org:80`) along with disabling pseudo-[T]ty allocation and executio[N] of remote commands:
`ssh -L {{9999}}:{{example.org}}:{{80}} -N -T {{username}}@{{remote_host}}`
* SSH jumping: Connect through a jumphost to a remote server (Multiple jump hops may be specified separated by comma characters):
`ssh -J {{username}}@{{jump_host}} {{username}}@{{remote_host}}`
* Agent forwarding: Forward the authentication information to the remote machine (see `man ssh_config` for available options):
`ssh -A {{username}}@{{remote_host}}`"
What is set command,,"# set
> Display, set or unset values of shell attributes and positional parameters.
> More information: https://manned.org/set.
* Display the names and values of shell variables:
`set`
* Mark variables that are modified or created for export:
`set -a`
* Notify of job termination immediately:
`set -b`
* Set various options, e.g. enable `vi` style line editing:
`set -o {{vi}}`
* Set the shell to exit as soon as the first error is encountered (mostly used in scripts):
`set -e`"
What is cut command,,"# cut
> Cut out fields from `stdin` or files. More information:
> https://manned.org/man/freebsd-13.0/cut.1.
* Print a specific character/field range of each line:
`{{command}} | cut -{{c|f}} {{1|1,10|1-10|1-|-10}}`
* Print a range of each line with a specific delimiter:
`{{command}} | cut -d ""{{,}}"" -{{c}} {{1}}`
* Print a range of each line of a specific file:
`cut -{{c}} {{1}} {{path/to/file}}`"
What is chfn command,,"# chfn
> Update `finger` info for a user. More information: https://manned.org/chfn.
* Update a user's ""Name"" field in the output of `finger`:
`chfn -f {{new_display_name}} {{username}}`
* Update a user's ""Office Room Number"" field for the output of `finger`:
`chfn -o {{new_office_room_number}} {{username}}`
* Update a user's ""Office Phone Number"" field for the output of `finger`:
`chfn -p {{new_office_telephone_number}} {{username}}`
* Update a user's ""Home Phone Number"" field for the output of `finger`:
`chfn -h {{new_home_telephone_number}} {{username}}`"
What is taskset command,,"# taskset
> Get or set a process' CPU affinity or start a new process with a defined CPU
> affinity. More information: https://manned.org/taskset.
* Get a running process' CPU affinity by PID:
`taskset --pid --cpu-list {{pid}}`
* Set a running process' CPU affinity by PID:
`taskset --pid --cpu-list {{cpu_id}} {{pid}}`
* Start a new process with affinity for a single CPU:
`taskset --cpu-list {{cpu_id}} {{command}}`
* Start a new process with affinity for multiple non-sequential CPUs:
`taskset --cpu-list {{cpu_id_1}},{{cpu_id_2}},{{cpu_id_3}}`
* Start a new process with affinity for CPUs 1 through 4:
`taskset --cpu-list {{cpu_id_1}}-{{cpu_id_4}}`"
What is script command,,"# script
> Make a typescript file of a terminal session. More information:
> https://manned.org/script.
* Start recording in file named ""typescript"":
`script`
* Stop recording:
`exit`
* Start recording in a given file:
`script {{logfile.log}}`
* Append to an existing file:
`script -a {{logfile.log}}`
* Execute quietly without start and done messages:
`script -q {{logfile.log}}`"
What is chown command,,"# chown
> Change user and group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chown.
* Change the owner user of a file/directory:
`chown {{user}} {{path/to/file_or_directory}}`
* Change the owner user and group of a file/directory:
`chown {{user}}:{{group}} {{path/to/file_or_directory}}`
* Recursively change the owner of a directory and its contents:
`chown -R {{user}} {{path/to/directory}}`
* Change the owner of a symbolic link:
`chown -h {{user}} {{path/to/symlink}}`
* Change the owner of a file/directory to match a reference file:
`chown --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`"
What is g++ command,,"# g++
> Compiles C++ source files. Part of GCC (GNU Compiler Collection). More
> information: https://gcc.gnu.org.
* Compile a source code file into an executable binary:
`g++ {{path/to/source.cpp}} -o {{path/to/output_executable}}`
* Display common warnings:
`g++ {{path/to/source.cpp}} -Wall -o {{path/to/output_executable}}`
* Choose a language standard to compile for (C++98/C++11/C++14/C++17):
`g++ {{path/to/source.cpp}} -std={{c++98|c++11|c++14|c++17}} -o
{{path/to/output_executable}}`
* Include libraries located at a different path than the source file:
`g++ {{path/to/source.cpp}} -o {{path/to/output_executable}}
-I{{path/to/header}} -L{{path/to/library}} -l{{library_name}}`
* Compile and link multiple source code files into an executable binary:
`g++ -c {{path/to/source_1.cpp path/to/source_2.cpp ...}} && g++ -o
{{path/to/output_executable}} {{path/to/source_1.o path/to/source_2.o ...}}`
* Display version:
`g++ --version`"
What is cp command,,"# cp
> Copy files and directories. More information:
> https://www.gnu.org/software/coreutils/cp.
* Copy a file to another location:
`cp {{path/to/source_file.ext}} {{path/to/target_file.ext}}`
* Copy a file into another directory, keeping the filename:
`cp {{path/to/source_file.ext}} {{path/to/target_parent_directory}}`
* Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it):
`cp -R {{path/to/source_directory}} {{path/to/target_directory}}`
* Copy a directory recursively, in verbose mode (shows files as they are copied):
`cp -vR {{path/to/source_directory}} {{path/to/target_directory}}`
* Copy multiple files at once to a directory:
`cp -t {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}`
* Copy text files to another location, in interactive mode (prompts user before overwriting):
`cp -i {{*.txt}} {{path/to/target_directory}}`
* Follow symbolic links before copying:
`cp -L {{link}} {{path/to/target_directory}}`
* Use the first argument as the destination directory (useful for `xargs ... | cp -t <DEST_DIR>`):
`cp -t {{path/to/target_directory}} {{path/to/file_or_directory1
path/to/file_or_directory2 ...}}`"
What is sar command,,"# sar
> Monitor performance of various Linux subsystems. More information:
> https://manned.org/sar.
* Report I/O and transfer rate issued to physical devices, one per second (press CTRL+C to quit):
`sar -b {{1}}`
* Report a total of 10 network device statistics, one per 2 seconds:
`sar -n DEV {{2}} {{10}}`
* Report CPU utilization, one per 2 seconds:
`sar -u ALL {{2}}`
* Report a total of 20 memory utilization statistics, one per second:
`sar -r ALL {{1}} {{20}}`
* Report the run queue length and load averages, one per second:
`sar -q {{1}}`
* Report paging statistics, one per 5 seconds:
`sar -B {{5}}`"
What is rename command,,"# rename
> Rename a file or group of files with a regular expression. More information:
> https://www.manpagez.com/man/2/rename/.
* Replace `from` with `to` in the filenames of the specified files:
`rename 's/{{from}}/{{to}}/' {{*.txt}}`"
What is strip command,,"# strip
> Discard symbols from executables or object files. More information:
> https://manned.org/strip.
* Replace the input file with its stripped version:
`strip {{path/to/file}}`
* Strip symbols from a file, saving the output to a specific file:
`strip {{path/to/input_file}} -o {{path/to/output_file}}`
* Strip debug symbols only:
`strip --strip-debug {{path/to/file.o}}`"
What is head command,,"# head
> Output the first part of files. More information:
> https://keith.github.io/xcode-man-pages/head.1.html.
* Output the first few lines of a file:
`head --lines {{8}} {{path/to/file}}`
* Output the first few bytes of a file:
`head --bytes {{8}} {{path/to/file}}`
* Output everything but the last few lines of a file:
`head --lines -{{8}} {{path/to/file}}`
* Output everything but the last few bytes of a file:
`head --bytes -{{8}} {{path/to/file}}`"
What is wall command,,"# wall
> Write a message on the terminals of users currently logged in. More
> information: https://manned.org/wall.
* Send a message:
`wall {{message}}`
* Send a message to users that belong to a specific group:
`wall --group {{group_name}} {{message}}`
* Send a message from a file:
`wall {{file}}`
* Send a message with timeout (default 300):
`wall --timeout {{seconds}} {{file}}`"
What is stat command,,"# stat
> Display file status. More information: https://ss64.com/osx/stat.html.
* Show file properties such as size, permissions, creation and access dates among others:
`stat {{path/to/file}}`
* Same as above but verbose (more similar to Linux's `stat`):
`stat -x {{path/to/file}}`
* Show only octal file permissions:
`stat -f %Mp%Lp {{path/to/file}}`
* Show owner and group of the file:
`stat -f ""%Su %Sg"" {{path/to/file}}`
* Show the size of the file in bytes:
`stat -f ""%z %N"" {{path/to/file}}`"
What is ar command,,"# ar
> Create, modify, and extract from Unix archives. Typically used for static
> libraries (`.a`) and Debian packages (`.deb`). See also: `tar`. More
> information: https://manned.org/ar.
* E[x]tract all members from an archive:
`ar x {{path/to/file.a}}`
* Lis[t] contents in a specific archive:
`ar t {{path/to/file.ar}}`
* [r]eplace or add specific files to an archive:
`ar r {{path/to/file.deb}} {{path/to/debian-binary path/to/control.tar.gz
path/to/data.tar.xz ...}}`
* In[s]ert an object file index (equivalent to using `ranlib`):
`ar s {{path/to/file.a}}`
* Create an archive with specific files and an accompanying object file index:
`ar rs {{path/to/file.a}} {{path/to/file1.o path/to/file2.o ...}}`"
What is git command,,"# git
> Distributed version control system. Some subcommands such as `commit`,
> `add`, `branch`, `checkout`, `push`, etc. have their own usage
> documentation, accessible via `tldr git subcommand`. More information:
> https://git-scm.com/.
* Check the Git version:
`git --version`
* Show general help:
`git --help`
* Show help on a Git subcommand (like `clone`, `add`, `push`, `log`, etc.):
`git help {{subcommand}}`
* Execute a Git subcommand:
`git {{subcommand}}`
* Execute a Git subcommand on a custom repository root path:
`git -C {{path/to/repo}} {{subcommand}}`
* Execute a Git subcommand with a given configuration set:
`git -c '{{config.key}}={{value}}' {{subcommand}}`"
What is printenv command,,"# printenv
> Print values of all or specific environment variables. More information:
> https://www.gnu.org/software/coreutils/printenv.
* Display key-value pairs of all environment variables:
`printenv`
* Display the value of a specific variable:
`printenv {{HOME}}`
* Display the value of a variable and end with NUL instead of newline:
`printenv --null {{HOME}}`"
What is chsh command,,"# chsh
> Change user's login shell. More information: https://manned.org/chsh.
* Set a specific login shell for the current user interactively:
`chsh`
* Set a specific login [s]hell for the current user:
`chsh -s {{path/to/shell}}`
* Set a login [s]hell for a specific user:
`chsh -s {{path/to/shell}} {{username}}`
* [l]ist available shells:
`chsh -l`"
What is pax command,,"# pax
> Archiving and copying utility. More information: https://manned.org/pax.1p.
* List the contents of an archive:
`pax -f {{archive.tar}}`
* List the contents of a gzipped archive:
`pax -zf {{archive.tar.gz}}`
* Create an archive from files:
`pax -wf {{target.tar}} {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`
* Create an archive from files, using output redirection:
`pax -w {{path/to/file1}} {{path/to/file2}} {{path/to/file3}} >
{{target.tar}}`
* Extract an archive into the current directory:
`pax -rf {{source.tar}}`
* Copy to a directory, while keeping the original metadata; `target/` must exist:
`pax -rw {{path/to/file1}} {{path/to/directory1}} {{path/to/directory2}}
{{target/}}`"
What is git-replace command,,"# git replace
> Create, list, and delete refs to replace objects. More information:
> https://git-scm.com/docs/git-replace.
* Replace any commit with a different one, leaving other commits unchanged:
`git replace {{object}} {{replacement}}`
* Delete existing replace refs for the given objects:
`git replace --delete {{object}}`
* Edit an object’s content interactively:
`git replace --edit {{object}}`"
What is yes command,,"# yes
> Output something repeatedly. This command is commonly used to answer yes to
> every prompt by install commands (such as apt-get). More information:
> https://www.gnu.org/software/coreutils/yes.
* Repeatedly output ""message"":
`yes {{message}}`
* Repeatedly output ""y"":
`yes`
* Accept everything prompted by the `apt-get` command:
`yes | sudo apt-get install {{program}}`"
What is mkdir command,,"# mkdir
> Create directories and set their permissions. More information:
> https://www.gnu.org/software/coreutils/mkdir.
* Create specific directories:
`mkdir {{path/to/directory1 path/to/directory2 ...}}`
* Create specific directories and their [p]arents if needed:
`mkdir -p {{path/to/directory1 path/to/directory2 ...}}`
* Create directories with specific permissions:
`mkdir -m {{rwxrw-r--}} {{path/to/directory1 path/to/directory2 ...}}`"
What is ipcrm command,,"# ipcrm
> Delete IPC (Inter-process Communication) resources. More information:
> https://manned.org/ipcrm.
* Delete a shared memory segment by ID:
`ipcrm --shmem-id {{shmem_id}}`
* Delete a shared memory segment by key:
`ipcrm --shmem-key {{shmem_key}}`
* Delete an IPC queue by ID:
`ipcrm --queue-id {{ipc_queue_id}}`
* Delete an IPC queue by key:
`ipcrm --queue-key {{ipc_queue_key}}`
* Delete a semaphore by ID:
`ipcrm --semaphore-id {{semaphore_id}}`
* Delete a semaphore by key:
`ipcrm --semaphore-key {{semaphore_key}}`
* Delete all IPC resources:
`ipcrm --all`"
What is chmod command,,"# chmod
> Change the access permissions of a file or directory. More information:
> https://www.gnu.org/software/coreutils/chmod.
* Give the [u]ser who owns a file the right to e[x]ecute it:
`chmod u+x {{path/to/file}}`
* Give the [u]ser rights to [r]ead and [w]rite to a file/directory:
`chmod u+rw {{path/to/file_or_directory}}`
* Remove e[x]ecutable rights from the [g]roup:
`chmod g-x {{path/to/file}}`
* Give [a]ll users rights to [r]ead and e[x]ecute:
`chmod a+rx {{path/to/file}}`
* Give [o]thers (not in the file owner's group) the same rights as the [g]roup:
`chmod o=g {{path/to/file}}`
* Remove all rights from [o]thers:
`chmod o= {{path/to/file}}`
* Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite:
`chmod -R g+w,o+w {{path/to/directory}}`
* Recursively give [a]ll users [r]ead permissions to files and e[X]ecute permissions to sub-directories within a directory:
`chmod -R a+rX {{path/to/directory}}`"
What is git-help command,,"# git help
> Display help information about Git. More information: https://git-
> scm.com/docs/git-help.
* Display help about a specific Git subcommand:
`git help {{subcommand}}`
* Display help about a specific Git subcommand in a web browser:
`git help --web {{subcommand}}`
* Display a list of all available Git subcommands:
`git help --all`
* List the available guides:
`git help --guide`
* List all possible configuration variables:
`git help --config`"
What is sort command,,"# sort
> Sort lines of text files. More information:
> https://www.gnu.org/software/coreutils/sort.
* Sort a file in ascending order:
`sort {{path/to/file}}`
* Sort a file in descending order:
`sort --reverse {{path/to/file}}`
* Sort a file in case-insensitive way:
`sort --ignore-case {{path/to/file}}`
* Sort a file using numeric rather than alphabetic order:
`sort --numeric-sort {{path/to/file}}`
* Sort `/etc/passwd` by the 3rd field of each line numerically, using "":"" as a field separator:
`sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}`
* Sort a file preserving only unique lines:
`sort --unique {{path/to/file}}`
* Sort a file, printing the output to the specified output file (can be used to sort a file in-place):
`sort --output={{path/to/file}} {{path/to/file}}`
* Sort numbers with exponents:
`sort --general-numeric-sort {{path/to/file}}`"
What is md5sum command,,"# md5sum
> Calculate MD5 cryptographic checksums. More information:
> https://www.gnu.org/software/coreutils/md5sum.
* Calculate the MD5 checksum for one or more files:
`md5sum {{path/to/file1 path/to/file2 ...}}`
* Calculate and save the list of MD5 checksums to a file:
`md5sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.md5}}`
* Calculate an MD5 checksum from `stdin`:
`{{command}} | md5sum`
* Read a file of MD5 sums and filenames and verify all files have matching checksums:
`md5sum --check {{path/to/file.md5}}`
* Only show a message for missing files or when verification fails:
`md5sum --check --quiet {{path/to/file.md5}}`
* Only show a message when verification fails, ignoring missing files:
`md5sum --ignore-missing --check --quiet {{path/to/file.md5}}`"
What is kill command,,"# kill
> Sends a signal to a process, usually related to stopping the process. All
> signals except for SIGKILL and SIGSTOP can be intercepted by the process to
> perform a clean exit. More information: https://manned.org/kill.
* Terminate a program using the default SIGTERM (terminate) signal:
`kill {{process_id}}`
* List available signal names (to be used without the `SIG` prefix):
`kill -l`
* Terminate a background job:
`kill %{{job_id}}`
* Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
`kill -{{1|HUP}} {{process_id}}`
* Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`:
`kill -{{2|INT}} {{process_id}}`
* Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):
`kill -{{9|KILL}} {{process_id}}`
* Signal the operating system to pause a program until a SIGCONT (""continue"") signal is received:
`kill -{{17|STOP}} {{process_id}}`
* Send a `SIGUSR1` signal to all processes with the given GID (group id):
`kill -{{SIGUSR1}} -{{group_id}}`"
What is groff command,,"# groff
> GNU replacement for the `troff` and `nroff` typesetting utilities. More
> information: https://www.gnu.org/software/groff.
* Format output for a PostScript printer, saving the output to a file:
`groff {{path/to/input.roff}} > {{path/to/output.ps}}`
* Render a man page using the ASCII output device, and display it using a pager:
`groff -man -T ascii {{path/to/manpage.1}} | less --RAW-CONTROL-CHARS`
* Render a man page into an HTML file:
`groff -man -T html {{path/to/manpage.1}} > {{path/to/manpage.html}}`
* Typeset a roff file containing [t]ables and [p]ictures, using the [me] macro set, to PDF, saving the output:
`groff {{-t}} {{-p}} -{{me}} -T {{pdf}} {{path/to/input.me}} >
{{path/to/output.pdf}}`
* Run a `groff` command with preprocessor and macro options guessed by the `grog` utility:
`eval ""$(grog -T utf8 {{path/to/input.me}})""`"
What is git-checkout-index command,,"# git checkout-index
> Copy files from the index to the working tree. More information:
> https://git-scm.com/docs/git-checkout-index.
* Restore any files deleted since the last commit:
`git checkout-index --all`
* Restore any files deleted or changed since the last commit:
`git checkout-index --all --force`
* Restore any files changed since the last commit, ignoring any files that were deleted:
`git checkout-index --all --force --no-create`
* Export a copy of the entire tree at the last commit to the specified directory (the trailing slash is important):
`git checkout-index --all --force --prefix={{path/to/export_directory/}}`"
What is trace-cmd command,,"# trace-cmd
> Utility to interact with the Ftrace Linux kernel internal tracer. This
> utility only runs as root. More information: https://manned.org/trace-cmd.
* Display the status of tracing system:
`trace-cmd stat`
* List available tracers:
`trace-cmd list -t`
* Start tracing with a specific plugin:
`trace-cmd start -p
{{timerlat|osnoise|hwlat|blk|mmiotrace|function_graph|wakeup_dl|wakeup_rt|wakeup|function|nop}}`
* View the trace output:
`trace-cmd show`
* Stop the tracing but retain the buffers:
`trace-cmd stop`
* Clear the trace buffers:
`trace-cmd clear`
* Clear the trace buffers and stop tracing:
`trace-cmd reset`"
What is umask command,,"# umask
> Manage the read/write/execute permissions that are masked out (i.e.
> restricted) for newly created files by the user. More information:
> https://manned.org/umask.
* Display the current mask in octal notation:
`umask`
* Display the current mask in symbolic (human-readable) mode:
`umask -S`
* Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged):
`umask {{a+r}}`
* Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else:
`umask {{077}}`"
What is touch command,,"# touch
> Create files and set access/modification times. More information:
> https://manned.org/man/freebsd-13.1/touch.
* Create specific files:
`touch {{path/to/file1 path/to/file2 ...}}`
* Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:
`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}`
* Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:
`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}`
* Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:
`touch -c -r {{~/.emacs}} {{path/to/file1 path/to/file2 ...}}`"
What is echo command,,"# echo
> Print given arguments. More information:
> https://www.gnu.org/software/coreutils/echo.
* Print a text message. Note: quotes are optional:
`echo ""{{Hello World}}""`
* Print a message with environment variables:
`echo ""{{My path is $PATH}}""`
* Print a message without the trailing newline:
`echo -n ""{{Hello World}}""`
* Append a message to the file:
`echo ""{{Hello World}}"" >> {{file.txt}}`
* Enable interpretation of backslash escapes (special characters):
`echo -e ""{{Column 1\tColumn 2}}""`
* Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively):
`echo $?`"
What is systemctl command,,"# systemctl
> Control the systemd system and service manager. More information:
> https://www.freedesktop.org/software/systemd/man/systemctl.html.
* Show all running services:
`systemctl status`
* List failed units:
`systemctl --failed`
* Start/Stop/Restart/Reload a service:
`systemctl {{start|stop|restart|reload}} {{unit}}`
* Show the status of a unit:
`systemctl status {{unit}}`
* Enable/Disable a unit to be started on bootup:
`systemctl {{enable|disable}} {{unit}}`
* Mask/Unmask a unit to prevent enablement and manual activation:
`systemctl {{mask|unmask}} {{unit}}`
* Reload systemd, scanning for new or changed units:
`systemctl daemon-reload`
* Check if a unit is enabled:
`systemctl is-enabled {{unit}}`"
What is patch command,,"# patch
> Patch a file (or files) with a diff file. Note that diff files should be
> generated by the `diff` command. More information: https://manned.org/patch.
* Apply a patch using a diff file (filenames must be included in the diff file):
`patch < {{patch.diff}}`
* Apply a patch to a specific file:
`patch {{path/to/file}} < {{patch.diff}}`
* Patch a file writing the result to a different file:
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
* Apply a patch to the current directory:
`patch -p1 < {{patch.diff}}`
* Apply the reverse of a patch:
`patch -R < {{patch.diff}}`"
What is find command,,"# find
> Find files or directories under the given directory tree, recursively. More
> information: https://manned.org/find.
* Find files by extension:
`find {{root_path}} -name '{{*.ext}}'`
* Find files matching multiple path/name patterns:
`find {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'`
* Find directories matching a given name, in case-insensitive mode:
`find {{root_path}} -type d -iname '{{*lib*}}'`
* Find files matching a given pattern, excluding specific paths:
`find {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'`
* Find files matching a given size range, limiting the recursive depth to ""1"":
`find {{root_path}} -maxdepth 1 -size {{+500k}} -size {{-10M}}`
* Run a command for each file (use `{}` within the command to access the filename):
`find {{root_path}} -name '{{*.ext}}' -exec {{wc -l {} }}\;`
* Find files modified in the last 7 days:
`find {{root_path}} -daystart -mtime -{{7}}`
* Find empty (0 byte) files and delete them:
`find {{root_path}} -type {{f}} -empty -delete`"
What is expect command,,"# expect
> Script executor that interacts with other programs that require user input.
> More information: https://manned.org/expect.
* Execute an expect script from a file:
`expect {{path/to/file}}`
* Execute a specified expect script:
`expect -c ""{{commands}}""`
* Enter an interactive REPL (use `exit` or Ctrl + D to exit):
`expect -i`"
What is du command,,"# du
> Disk usage: estimate and summarize file and directory space usage. More
> information: https://ss64.com/osx/du.html.
* List the sizes of a directory and any subdirectories, in the given unit (KiB/MiB/GiB):
`du -{{k|m|g}} {{path/to/directory}}`
* List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
`du -h {{path/to/directory}}`
* Show the size of a single directory, in human-readable units:
`du -sh {{path/to/directory}}`
* List the human-readable sizes of a directory and of all the files and directories within it:
`du -ah {{path/to/directory}}`
* List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
`du -h -d {{2}} {{path/to/directory}}`
* List the human-readable size of all `.jpg` files in subdirectories of the current directory, and show a cumulative total at the end:
`du -ch {{*/*.jpg}}`"
What is fold command,,"# fold
> Wrap each line in an input file to fit a specified width and print it to
> `stdout`. More information: https://manned.org/fold.1p.
* Wrap each line to default width (80 characters):
`fold {{path/to/file}}`
* Wrap each line to width ""30"":
`fold -w30 {{path/to/file}}`
* Wrap each line to width ""5"" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped):
`fold -w5 -s {{path/to/file}}`"
What is nohup command,,"# nohup
> Allows for a process to live when the terminal gets killed. More
> information: https://www.gnu.org/software/coreutils/nohup.
* Run a process that can live beyond the terminal:
`nohup {{command}} {{argument1 argument2 ...}}`
* Launch `nohup` in background mode:
`nohup {{command}} {{argument1 argument2 ...}} &`
* Run a shell script that can live beyond the terminal:
`nohup {{path/to/script.sh}} &`
* Run a process and write the output to a specific file:
`nohup {{command}} {{argument1 argument2 ...}} > {{path/to/output_file}} &`"
What is git-rm command,,"# git rm
> Remove files from repository index and local filesystem. More information:
> https://git-scm.com/docs/git-rm.
* Remove file from repository index and filesystem:
`git rm {{path/to/file}}`
* Remove directory:
`git rm -r {{path/to/directory}}`
* Remove file from repository index but keep it untouched locally:
`git rm --cached {{path/to/file}}`"
What is getconf command,,"# getconf
> Get configuration values from your Linux system. More information:
> https://manned.org/getconf.1.
* List [a]ll configuration values available:
`getconf -a`
* List the configuration values for a specific directory:
`getconf -a {{path/to/directory}}`
* Check if your linux system is a 32-bit or 64-bit:
`getconf LONG_BIT`
* Check how many processes the current user can run at once:
`getconf CHILD_MAX`
* List every configuration value and then find patterns with the grep command (i.e every value with MAX in it):
`getconf -a | grep MAX`"
What is wget command,,"# wget
> Download files from the Web. Supports HTTP, HTTPS, and FTP. More
> information: https://www.gnu.org/software/wget.
* Download the contents of a URL to a file (named ""foo"" in this case):
`wget {{https://example.com/foo}}`
* Download the contents of a URL to a file (named ""bar"" in this case):
`wget --output-document {{bar}} {{https://example.com/foo}}`
* Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):
`wget --page-requisites --convert-links --wait=3
{{https://example.com/somepage.html}}`
* Download all listed files within a directory and its sub-directories (does not download embedded page elements):
`wget --mirror --no-parent {{https://example.com/somepath/}}`
* Limit the download speed and the number of connection retries:
`wget --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}`
* Download a file from an HTTP server using Basic Auth (also works for FTP):
`wget --user={{username}} --password={{password}} {{https://example.com}}`
* Continue an incomplete download:
`wget --continue {{https://example.com}}`
* Download all URLs stored in a text file to a specific directory:
`wget --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}`"
What is systemd-mount command,,"# systemd-mount
> Establish and destroy transient mount or auto-mount points. More
> information: https://www.freedesktop.org/software/systemd/man/systemd-
> mount.html.
* Mount a file system (image or block device) at `/run/media/system/LABEL` where LABEL is the filesystem label or the device name if there is no label:
`systemd-mount {{path/to/file_or_device}}`
* Mount a file system (image or block device) at a specific location:
`systemd-mount {{path/to/file_or_device}} {{path/to/mount_point}}`
* Show a list of all local, known block devices with file systems that may be mounted:
`systemd-mount --list`
* Create an automount point that mounts the actual file system at the time of first access:
`systemd-mount --automount=yes {{path/to/file_or_device}}`
* Unmount one or more devices:
`systemd-mount --umount {{path/to/mount_point_or_device1}}
{{path/to/mount_point_or_device2}}`
* Mount a file system (image or block device) with a specific file system type:
`systemd-mount --type={{file_system_type}} {{path/to/file_or_device}}
{{path/to/mount_point}}`
* Mount a file system (image or block device) with additional mount options:
`systemd-mount --options={{mount_options}} {{path/to/file_or_device}}
{{path/to/mount_point}}`"
What is date command,,"# date
> Set or display the system date. More information:
> https://ss64.com/osx/date.html.
* Display the current date using the default locale's format:
`date +%c`
* Display the current date in UTC and ISO 8601 format:
`date -u +%Y-%m-%dT%H:%M:%SZ`
* Display the current date as a Unix timestamp (seconds since the Unix epoch):
`date +%s`
* Display a specific date (represented as a Unix timestamp) using the default format:
`date -r 1473305798`"
What is mcookie command,,"# mcookie
> Generates random 128-bit hexadecimal numbers. More information:
> https://manned.org/mcookie.
* Generate a random number:
`mcookie`
* Generate a random number, using the contents of a file as a seed for the randomness:
`mcookie --file {{path/to/file}}`
* Generate a random number, using a specific number of bytes from a file as a seed for the randomness:
`mcookie --file {{path/to/file}} --max-size {{number_of_bytes}}`
* Print the details of the randomness used, such as the origin and seed for each source:
`mcookie --verbose`"
What is scriptreplay command,,"# scriptreplay
> Replay a typescript created by the `script` command to `stdout`. More
> information: https://manned.org/scriptreplay.
* Replay a typescript at the speed it was recorded:
`scriptreplay {{path/to/timing_file}} {{path/to/typescript}}`
* Replay a typescript at double the original speed:
`scriptreplay {{path/to/timingfile}} {{path/to/typescript}} 2`
* Replay a typescript at half the original speed:
`scriptreplay {{path/to/timingfile}} {{path/to/typescript}} 0.5`"
What is git-repack command,,"# git repack
> Pack unpacked objects in a Git repository. More information: https://git-
> scm.com/docs/git-repack.
* Pack unpacked objects in the current directory:
`git repack`
* Also remove redundant objects after packing:
`git repack -d`"
What is rev command,,"# rev
> Reverse a line of text. More information: https://manned.org/rev.
* Reverse the text string ""hello"":
`echo ""hello"" | rev`
* Reverse an entire file and print to `stdout`:
`rev {{path/to/file}}`"
What is logname command,,"# logname
> Shows the user's login name. More information:
> https://www.gnu.org/software/coreutils/logname.
* Display the currently logged in user's name:
`logname`"
What is true command,,"# true
> Returns a successful exit status code of 0. Use this with the || operator to
> make a command always exit with 0. More information:
> https://www.gnu.org/software/coreutils/true.
* Return a successful exit code:
`true`"
What is sed command,,"# sed
> Edit text in a scriptable manner. See also: `awk`, `ed`. More information:
> https://keith.github.io/xcode-man-pages/sed.1.html.
* Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`:
`{{command}} | sed 's/apple/mango/g'`
* Execute a specific script [f]ile and print the result to `stdout`:
`{{command}} | sed -f {{path/to/script_file.sed}}`
* Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`:
`{{command}} | sed -E 's/(apple)/\U\1/g'`
* Print just a first line to `stdout`:
`{{command}} | sed -n '1p'`
* Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a `file` and save a backup of the original to `file.bak`:
`sed -i bak 's/apple/mango/g' {{path/to/file}}`"
What is lsattr command,,"# lsattr
> List file attributes on a Linux filesystem. More information:
> https://manned.org/lsattr.
* Display the attributes of the files in the current directory:
`lsattr`
* List the attributes of files in a particular path:
`lsattr {{path}}`
* List file attributes recursively in the current and subsequent directories:
`lsattr -R`
* Show attributes of all the files in the current directory, including hidden ones:
`lsattr -a`
* Display attributes of directories in the current directory:
`lsattr -d`"
What is delta command,,"# delta
> A viewer for Git and diff output. More information:
> https://github.com/dandavison/delta.
* Compare files or directories:
`delta {{path/to/old_file_or_directory}} {{path/to/new_file_or_directory}}`
* Compare files or directories, showing the line numbers:
`delta --line-numbers {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare files or directories, showing the differences side by side:
`delta --side-by-side {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare files or directories, ignoring any Git configuration settings:
`delta --no-gitconfig {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Compare, rendering commit hashes, file names, and line numbers as hyperlinks, according to the hyperlink spec for terminal emulators:
`delta --hyperlinks {{path/to/old_file_or_directory}}
{{path/to/new_file_or_directory}}`
* Display the current settings:
`delta --show-config`
* Display supported languages and associated file extensions:
`delta --list-languages`"
What is git-submodule command,,"# git submodule
> Inspects, updates and manages submodules. More information: https://git-
> scm.com/docs/git-submodule.
* Install a repository's specified submodules:
`git submodule update --init --recursive`
* Add a Git repository as a submodule:
`git submodule add {{repository_url}}`
* Add a Git repository as a submodule at the specified directory:
`git submodule add {{repository_url}} {{path/to/directory}}`
* Update every submodule to its latest commit:
`git submodule foreach git pull`"
What is git-send-email command,,"# git send-email
> Send a collection of patches as emails. Patches can be specified as files,
> directions, or a revision list. More information: https://git-
> scm.com/docs/git-send-email.
* Send the last commit in the current branch:
`git send-email -1`
* Send a given commit:
`git send-email -1 {{commit}}`
* Send multiple (e.g. 10) commits in the current branch:
`git send-email {{-10}}`
* Send an introductory email message for the patch series:
`git send-email -{{number_of_commits}} --compose`
* Review and edit the email message for each patch you're about to send:
`git send-email -{{number_of_commits}} --annotate`"
What is git-checkout command,,"# git checkout
> Checkout a branch or paths to the working tree. More information:
> https://git-scm.com/docs/git-checkout.
* Create and switch to a new branch:
`git checkout -b {{branch_name}}`
* Create and switch to a new branch based on a specific reference (branch, remote/branch, tag are examples of valid references):
`git checkout -b {{branch_name}} {{reference}}`
* Switch to an existing local branch:
`git checkout {{branch_name}}`
* Switch to the previously checked out branch:
`git checkout -`
* Switch to an existing remote branch:
`git checkout --track {{remote_name}}/{{branch_name}}`
* Discard all unstaged changes in the current directory (see `git reset` for more undo-like commands):
`git checkout .`
* Discard unstaged changes to a given file:
`git checkout {{path/to/file}}`
* Replace a file in the current directory with the version of it committed in a given branch:
`git checkout {{branch_name}} -- {{path/to/file}}`"
What is git-show-ref command,,"# git show-ref
> Git command for listing references. More information: https://git-
> scm.com/docs/git-show-ref.
* Show all refs in the repository:
`git show-ref`
* Show only heads references:
`git show-ref --heads`
* Show only tags references:
`git show-ref --tags`
* Verify that a given reference exists:
`git show-ref --verify {{path/to/ref}}`"
What is tbl command,,"# tbl
> Table preprocessor for the groff (GNU Troff) document formatting system. See
> also `groff` and `troff`. More information: https://manned.org/tbl.
* Process input with tables, saving the output for future typesetting with groff to PostScript:
`tbl {{path/to/input_file}} > {{path/to/output.roff}}`
* Typeset input with tables to PDF using the [me] macro package:
`tbl -T {{pdf}} {{path/to/input.tbl}} | groff -{{me}} -T {{pdf}} >
{{path/to/output.pdf}}`"
What is fg command,,"# fg
> Run jobs in foreground. More information: https://manned.org/fg.
* Bring most recently suspended or running background job to foreground:
`fg`
* Bring a specific job to foreground:
`fg %{{job_id}}`"
What is kill command,,"# kill
> Sends a signal to a process, usually related to stopping the process. All
> signals except for SIGKILL and SIGSTOP can be intercepted by the process to
> perform a clean exit. More information: https://manned.org/kill.
* Terminate a program using the default SIGTERM (terminate) signal:
`kill {{process_id}}`
* List available signal names (to be used without the `SIG` prefix):
`kill -l`
* Terminate a background job:
`kill %{{job_id}}`
* Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
`kill -{{1|HUP}} {{process_id}}`
* Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`:
`kill -{{2|INT}} {{process_id}}`
* Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):
`kill -{{9|KILL}} {{process_id}}`
* Signal the operating system to pause a program until a SIGCONT (""continue"") signal is received:
`kill -{{17|STOP}} {{process_id}}`
* Send a `SIGUSR1` signal to all processes with the given GID (group id):
`kill -{{SIGUSR1}} -{{group_id}}`"
What is git-credential command,,"# git credential
> Retrieve and store user credentials. More information: https://git-
> scm.com/docs/git-credential.
* Display credential information, retrieving the username and password from configuration files:
`echo ""{{url=http://example.com}}"" | git credential fill`
* Send credential information to all configured credential helpers to store for later use:
`echo ""{{url=http://example.com}}"" | git credential approve`
* Erase the specified credential information from all the configured credential helpers:
`echo ""{{url=http://example.com}}"" | git credential reject`"
What is git-stripspace command,,"# git stripspace
> Read text (e.g. commit messages, notes, tags, and branch descriptions) from
> `stdin` and clean it into the manner used by Git. More information:
> https://git-scm.com/docs/git-stripspace.
* Trim whitespace from a file:
`cat {{path/to/file}} | git stripspace`
* Trim whitespace and Git comments from a file:
`cat {{path/to/file}} | git stripspace --strip-comments`
* Convert all lines in a file into Git comments:
`git stripspace --comment-lines < {{path/to/file}}`"
What is hostname command,,"# hostname
> Show or set the system's host name. More information:
> https://manned.org/hostname.
* Show current host name:
`hostname`
* Show the network address of the host name:
`hostname -i`
* Show all network addresses of the host:
`hostname -I`
* Show the FQDN (Fully Qualified Domain Name):
`hostname --fqdn`
* Set current host name:
`hostname {{new_hostname}}`"
What is fuser command,,"# fuser
> Display process IDs currently using files or sockets. More information:
> https://manned.org/fuser.
* Find which processes are accessing a file or directory:
`fuser {{path/to/file_or_directory}}`
* Show more fields (`USER`, `PID`, `ACCESS` and `COMMAND`):
`fuser --verbose {{path/to/file_or_directory}}`
* Identify processes using a TCP socket:
`fuser --namespace tcp {{port}}`
* Kill all processes accessing a file or directory (sends the `SIGKILL` signal):
`fuser --kill {{path/to/file_or_directory}}`
* Find which processes are accessing the filesystem containing a specific file or directory:
`fuser --mount {{path/to/file_or_directory}}`
* Kill all processes with a TCP connection on a specific port:
`fuser --kill {{port}}/tcp`"
What is git-mergetool command,,"# git mergetool
> Run merge conflict resolution tools to resolve merge conflicts. More
> information: https://git-scm.com/docs/git-mergetool.
* Launch the default merge tool to resolve conflicts:
`git mergetool`
* List valid merge tools:
`git mergetool --tool-help`
* Launch the merge tool identified by a name:
`git mergetool --tool {{tool_name}}`
* Don't prompt before each invocation of the merge tool:
`git mergetool --no-prompt`
* Explicitly use the GUI merge tool (see the `merge.guitool` config variable):
`git mergetool --gui`
* Explicitly use the regular merge tool (see the `merge.tool` config variable):
`git mergetool --no-gui`"
What is su command,,"# su
> Switch shell to another user. More information: https://manned.org/su.
* Switch to superuser (requires the root password):
`su`
* Switch to a given user (requires the user's password):
`su {{username}}`
* Switch to a given user and simulate a full login shell:
`su - {{username}}`
* Execute a command as another user:
`su - {{username}} -c ""{{command}}""`"
What is git-request-pull command,,"# git request-pull
> Generate a request asking the upstream project to pull changes into its
> tree. More information: https://git-scm.com/docs/git-request-pull.
* Produce a request summarizing the changes between the v1.1 release and a specified branch:
`git request-pull {{v1.1}} {{https://example.com/project}} {{branch_name}}`
* Produce a request summarizing the changes between the v0.1 release on the `foo` branch and the local `bar` branch:
`git request-pull {{v0.1}} {{https://example.com/project}} {{foo:bar}}`"
What is perf command,,"# perf
> Framework for Linux performance counter measurements. More information:
> https://perf.wiki.kernel.org.
* Display basic performance counter stats for a command:
`perf stat {{gcc hello.c}}`
* Display system-wide real-time performance counter profile:
`sudo perf top`
* Run a command and record its profile into `perf.data`:
`sudo perf record {{command}}`
* Record the profile of an existing process into `perf.data`:
`sudo perf record -p {{pid}}`
* Read `perf.data` (created by `perf record`) and display the profile:
`sudo perf report`"
What is chrt command,,"# chrt
> Manipulate the real-time attributes of a process. More information:
> https://man7.org/linux/man-pages/man1/chrt.1.html.
* Display attributes of a process:
`chrt --pid {{PID}}`
* Display attributes of all threads of a process:
`chrt --all-tasks --pid {{PID}}`
* Display the min/max priority values that can be used with `chrt`:
`chrt --max`
* Set the scheduling policy for a process:
`chrt --pid {{PID}} --{{deadline|idle|batch|rr|fifo|other}}`"
What is git-describe command,,"# git describe
> Give an object a human-readable name based on an available ref. More
> information: https://git-scm.com/docs/git-describe.
* Create a unique name for the current commit (the name contains the most recent annotated tag, the number of additional commits, and the abbreviated commit hash):
`git describe`
* Create a name with 4 digits for the abbreviated commit hash:
`git describe --abbrev={{4}}`
* Generate a name with the tag reference path:
`git describe --all`
* Describe a Git tag:
`git describe {{v1.0.0}}`
* Create a name for the last commit of a given branch:
`git describe {{branch_name}}`"
What is tail command,,"# tail
> Display the last part of a file. See also: `head`. More information:
> https://manned.org/man/freebsd-13.0/tail.1.
* Show last 'count' lines in file:
`tail -n {{8}} {{path/to/file}}`
* Print a file from a specific line number:
`tail -n +{{8}} {{path/to/file}}`
* Print a specific count of bytes from the end of a given file:
`tail -c {{8}} {{path/to/file}}`
* Print the last lines of a given file and keep reading file until `Ctrl + C`:
`tail -f {{path/to/file}}`
* Keep reading file until `Ctrl + C`, even if the file is inaccessible:
`tail -F {{path/to/file}}`
* Show last 'count' lines in 'file' and refresh every 'seconds' seconds:
`tail -n {{8}} -s {{10}} -f {{path/to/file}}`"
What is truncate command,,"# truncate
> Shrink or extend the size of a file to the specified size. More information:
> https://www.gnu.org/software/coreutils/truncate.
* Set a size of 10 GB to an existing file, or create a new file with the specified size:
`truncate --size {{10G}} {{filename}}`
* Extend the file size by 50 MiB, fill with holes (which reads as zero bytes):
`truncate --size +{{50M}} {{filename}}`
* Shrink the file by 2 GiB, by removing data from the end of file:
`truncate --size -{{2G}} {{filename}}`
* Empty the file's content:
`truncate --size 0 {{filename}}`
* Empty the file's content, but do not create the file if it does not exist:
`truncate --no-create --size 0 {{filename}}`"
What is git-check-attr command,,"# git check-attr
> For every pathname, list if each attribute is unspecified, set, or unset as
> a gitattribute on that pathname. More information: https://git-
> scm.com/docs/git-check-attr.
* Check the values of all attributes on a file:
`git check-attr --all {{path/to/file}}`
* Check the value of a specific attribute on a file:
`git check-attr {{attribute}} {{path/to/file}}`
* Check the value of a specific attribute on files:
`git check-attr --all {{path/to/file1}} {{path/to/file2}}`
* Check the value of a specific attribute on one or more files:
`git check-attr {{attribute}} {{path/to/file1}} {{path/to/file2}}`"
What is tr command,,"# tr
> Translate characters: run replacements based on single characters and
> character sets. More information: https://www.gnu.org/software/coreutils/tr.
* Replace all occurrences of a character in a file, and print the result:
`tr {{find_character}} {{replace_character}} < {{path/to/file}}`
* Replace all occurrences of a character from another command's output:
`echo {{text}} | tr {{find_character}} {{replace_character}}`
* Map each character of the first set to the corresponding character of the second set:
`tr '{{abcd}}' '{{jkmn}}' < {{path/to/file}}`
* Delete all occurrences of the specified set of characters from the input:
`tr -d '{{input_characters}}' < {{path/to/file}}`
* Compress a series of identical characters to a single character:
`tr -s '{{input_characters}}' < {{path/to/file}}`
* Translate the contents of a file to upper-case:
`tr ""[:lower:]"" ""[:upper:]"" < {{path/to/file}}`
* Strip out non-printable characters from a file:
`tr -cd ""[:print:]"" < {{path/to/file}}`"
What is cp command,,"# cp
> Copy files and directories. More information:
> https://www.gnu.org/software/coreutils/cp.
* Copy a file to another location:
`cp {{path/to/source_file.ext}} {{path/to/target_file.ext}}`
* Copy a file into another directory, keeping the filename:
`cp {{path/to/source_file.ext}} {{path/to/target_parent_directory}}`
* Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it):
`cp -R {{path/to/source_directory}} {{path/to/target_directory}}`
* Copy a directory recursively, in verbose mode (shows files as they are copied):
`cp -vR {{path/to/source_directory}} {{path/to/target_directory}}`
* Copy multiple files at once to a directory:
`cp -t {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}`
* Copy text files to another location, in interactive mode (prompts user before overwriting):
`cp -i {{*.txt}} {{path/to/target_directory}}`
* Follow symbolic links before copying:
`cp -L {{link}} {{path/to/target_directory}}`
* Use the first argument as the destination directory (useful for `xargs ... | cp -t <DEST_DIR>`):
`cp -t {{path/to/target_directory}} {{path/to/file_or_directory1
path/to/file_or_directory2 ...}}`"
What is git-push command,,"# git push
> Push commits to a remote repository. More information: https://git-
> scm.com/docs/git-push.
* Send local changes in the current branch to its default remote counterpart:
`git push`
* Send changes from a specific local branch to its remote counterpart:
`git push {{remote_name}} {{local_branch}}`
* Send changes from a specific local branch to its remote counterpart, and set the remote one as the default push/pull target of the local one:
`git push -u {{remote_name}} {{local_branch}}`
* Send changes from a specific local branch to a specific remote branch:
`git push {{remote_name}} {{local_branch}}:{{remote_branch}}`
* Send changes on all local branches to their counterparts in a given remote repository:
`git push --all {{remote_name}}`
* Delete a branch in a remote repository:
`git push {{remote_name}} --delete {{remote_branch}}`
* Remove remote branches that don't have a local counterpart:
`git push --prune {{remote_name}}`
* Publish tags that aren't yet in the remote repository:
`git push --tags`"
What is lpstat command,,"# lpstat
> Display status information about the current classes, jobs, and printers.
> More information: https://ss64.com/osx/lpstat.html.
* Show a long listing of printers, classes, and jobs:
`lpstat -l`
* Force encryption when connecting to the CUPS server:
`lpstat -E`
* Show the ranking of print jobs:
`lpstat -R`
* Show whether or not the CUPS server is running:
`lpstat -r`
* Show all status information:
`lpstat -t`"
What is find command,,"# find
> Find files or directories under the given directory tree, recursively. More
> information: https://manned.org/find.
* Find files by extension:
`find {{root_path}} -name '{{*.ext}}'`
* Find files matching multiple path/name patterns:
`find {{root_path}} -path '{{**/path/**/*.ext}}' -or -name '{{*pattern*}}'`
* Find directories matching a given name, in case-insensitive mode:
`find {{root_path}} -type d -iname '{{*lib*}}'`
* Find files matching a given pattern, excluding specific paths:
`find {{root_path}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'`
* Find files matching a given size range, limiting the recursive depth to ""1"":
`find {{root_path}} -maxdepth 1 -size {{+500k}} -size {{-10M}}`
* Run a command for each file (use `{}` within the command to access the filename):
`find {{root_path}} -name '{{*.ext}}' -exec {{wc -l {} }}\;`
* Find files modified in the last 7 days:
`find {{root_path}} -daystart -mtime -{{7}}`
* Find empty (0 byte) files and delete them:
`find {{root_path}} -type {{f}} -empty -delete`"
What is flock command,,"# flock
> Manage locks from shell scripts. It can be used to ensure that only one
> process of a command is running. More information: https://manned.org/flock.
* Run a command with a file lock as soon as the lock is not required by others:
`flock {{path/to/lock.lock}} --command ""{{command}}""`
* Run a command with a file lock, and exit if the lock doesn't exist:
`flock {{path/to/lock.lock}} --nonblock --command ""{{command}}""`
* Run a command with a file lock, and exit with a specific error code if the lock doesn't exist:
`flock {{path/to/lock.lock}} --nonblock --conflict-exit-code {{error_code}} -c
""{{command}}""`"
What is ssh-add command,,"# ssh-add
> Manage loaded ssh keys in the ssh-agent. Ensure that ssh-agent is up and
> running for the keys to be loaded in it. More information:
> https://man.openbsd.org/ssh-add.
* Add the default ssh keys in `~/.ssh` to the ssh-agent:
`ssh-add`
* Add a specific key to the ssh-agent:
`ssh-add {{path/to/private_key}}`
* List fingerprints of currently loaded keys:
`ssh-add -l`
* Delete a key from the ssh-agent:
`ssh-add -d {{path/to/private_key}}`
* Delete all currently loaded keys from the ssh-agent:
`ssh-add -D`
* Add a key to the ssh-agent and the keychain:
`ssh-add -K {{path/to/private_key}}`"
What is git-show-branch command,,"# git show-branch
> Show branches and their commits. More information: https://git-
> scm.com/docs/git-show-branch.
* Show a summary of the latest commit on a branch:
`git show-branch {{branch_name|ref|commit}}`
* Compare commits in the history of multiple commits or branches:
`git show-branch {{branch_name|ref|commit}}`
* Compare all remote tracking branches:
`git show-branch --remotes`
* Compare both local and remote tracking branches:
`git show-branch --all`
* List the latest commits in all branches:
`git show-branch --all --list`
* Compare a given branch with the current branch:
`git show-branch --current {{commit|branch_name|ref}}`
* Display the commit name instead of the relative name:
`git show-branch --sha1-name --current {{current|branch_name|ref}}`
* Keep going a given number of commits past the common ancestor:
`git show-branch --more {{5}} {{commit|branch_name|ref}}
{{commit|branch_name|ref}} {{...}}`"
What is gawk command,,"# gawk
> This command is an alias of GNU `awk`.
* View documentation for the original command:
`tldr -p linux awk`"
What is trap command,,"# trap
> Automatically execute commands after receiving signals by processes or the
> operating system. Can be used to perform cleanups for interruptions by the
> user or other actions. More information: https://manned.org/trap.
* List available signals to set traps for:
`trap -l`
* List active traps for the current shell:
`trap -p`
* Set a trap to execute commands when one or more signals are detected:
`trap 'echo ""Caught signal {{SIGHUP}}""' {{SIGHUP}}`
* Remove active traps:
`trap - {{SIGHUP}} {{SIGINT}}`"
What is git-whatchanged command,,"# git whatchanged
> Show what has changed with recent commits or files. See also `git log`. More
> information: https://git-scm.com/docs/git-whatchanged.
* Display logs and changes for recent commits:
`git whatchanged`
* Display logs and changes for recent commits within the specified time frame:
`git whatchanged --since=""{{2 hours ago}}""`
* Display logs and changes for recent commits for specific files or directories:
`git whatchanged {{path/to/file_or_directory}}`"
What is troff command,,"# troff
> Typesetting processor for the groff (GNU Troff) document formatting system.
> See also `groff`. More information: https://manned.org/troff.
* Format output for a PostScript printer, saving the output to a file:
`troff {{path/to/input.roff}} | grops > {{path/to/output.ps}}`
* Format output for a PostScript printer using the [me] macro package, saving the output to a file:
`troff -{{me}} {{path/to/input.roff}} | grops > {{path/to/output.ps}}`
* Format output as [a]SCII text using the [man] macro package:
`troff -T {{ascii}} -{{man}} {{path/to/input.roff}} | grotty`
* Format output as a [pdf] file, saving the output to a file:
`troff -T {{pdf}} {{path/to/input.roff}} | gropdf > {{path/to/output.pdf}}`"
What is ar command,,"# ar
> Create, modify, and extract from Unix archives. Typically used for static
> libraries (`.a`) and Debian packages (`.deb`). See also: `tar`. More
> information: https://manned.org/ar.
* E[x]tract all members from an archive:
`ar x {{path/to/file.a}}`
* Lis[t] contents in a specific archive:
`ar t {{path/to/file.ar}}`
* [r]eplace or add specific files to an archive:
`ar r {{path/to/file.deb}} {{path/to/debian-binary path/to/control.tar.gz
path/to/data.tar.xz ...}}`
* In[s]ert an object file index (equivalent to using `ranlib`):
`ar s {{path/to/file.a}}`
* Create an archive with specific files and an accompanying object file index:
`ar rs {{path/to/file.a}} {{path/to/file1.o path/to/file2.o ...}}`"
What is hostnamectl command,,"# hostnamectl
> Get or set the hostname of the computer. More information:
> https://manned.org/hostnamectl.
* Get the hostname of the computer:
`hostnamectl`
* Set the hostname of the computer:
`sudo hostnamectl set-hostname ""{{hostname}}""`
* Set a pretty hostname for the computer:
`sudo hostnamectl set-hostname --static ""{{hostname.example.com}}"" && sudo
hostnamectl set-hostname --pretty ""{{hostname}}""`
* Reset hostname to its default value:
`sudo hostnamectl set-hostname --pretty """"`"
What is split command,,"# split
> Split a file into pieces. More information: https://ss64.com/osx/split.html.
* Split a file, each split having 10 lines (except the last split):
`split -l {{10}} {{filename}}`
* Split a file by a regular expression. The matching line will be the first line of the next output file:
`split -p {{cat|^[dh]og}} {{filename}}`
* Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
`split -b {{512}} {{filename}}`
* Split a file into 5 files. File is split such that each split has same size (except the last split):
`split -n {{5}} {{filename}}`"
What is sftp command,,"# sftp
> Secure File Transfer Program. Interactive program to copy files between
> hosts over SSH. For non-interactive file transfers, see `scp` or `rsync`.
> More information: https://manned.org/sftp.
* Connect to a remote server and enter an interactive command mode:
`sftp {{remote_user}}@{{remote_host}}`
* Connect using an alternate port:
`sftp -P {{remote_port}} {{remote_user}}@{{remote_host}}`
* Connect using a predefined host (in `~/.ssh/config`):
`sftp {{host}}`
* Transfer remote file to the local system:
`get {{/path/remote_file}}`
* Transfer local file to the remote system:
`put {{/path/local_file}}`
* Transfer remote directory to the local system recursively (works with `put` too):
`get -R {{/path/remote_directory}}`
* Get list of files on local machine:
`lls`
* Get list of files on remote machine:
`ls`"
What is renice command,,"# renice
> Alters the scheduling priority/niceness of one or more running processes.
> Niceness values range from -20 (most favorable to the process) to 19 (least
> favorable to the process). More information: https://manned.org/renice.
* Change priority of a running process:
`renice -n {{niceness_value}} -p {{pid}}`
* Change priority of all processes owned by a user:
`renice -n {{niceness_value}} -u {{user}}`
* Change priority of all processes that belong to a process group:
`renice -n {{niceness_value}} --pgrp {{process_group}}`"
What is envsubst command,,"# envsubst
> Substitutes environment variables with their value in shell format strings.
> Variables to be replaced should be in either `${var}` or `$var` format. More
> information: https://www.gnu.org/software/gettext/manual/html_node/envsubst-
> Invocation.html.
* Replace environment variables in `stdin` and output to `stdout`:
`echo '{{$HOME}}' | envsubst`
* Replace environment variables in an input file and output to `stdout`:
`envsubst < {{path/to/input_file}}`
* Replace environment variables in an input file and output to a file:
`envsubst < {{path/to/input_file}} > {{path/to/output_file}}`
* Replace environment variables in an input file from a space-separated list:
`envsubst '{{$USER $SHELL $HOME}}' < {{path/to/input_file}}`"
What is comm command,,"# comm
> Select or reject lines common to two files. Both files must be sorted. More
> information: https://www.gnu.org/software/coreutils/comm.
* Produce three tab-separated columns: lines only in first file, lines only in second file and common lines:
`comm {{file1}} {{file2}}`
* Print only lines common to both files:
`comm -12 {{file1}} {{file2}}`
* Print only lines common to both files, reading one file from `stdin`:
`cat {{file1}} | comm -12 - {{file2}}`
* Get lines only found in first file, saving the result to a third file:
`comm -23 {{file1}} {{file2}} > {{file1_only}}`
* Print lines only found in second file, when the files aren't sorted:
`comm -13 <(sort {{file1}}) <(sort {{file2}})`"
What is gdb command,,"# gdb
> The GNU Debugger. More information: https://www.gnu.org/software/gdb.
* Debug an executable:
`gdb {{executable}}`
* Attach a process to gdb:
`gdb -p {{procID}}`
* Debug with a core file:
`gdb -c {{core}} {{executable}}`
* Execute given GDB commands upon start:
`gdb -ex ""{{commands}}"" {{executable}}`
* Start `gdb` and pass arguments to the executable:
`gdb --args {{executable}} {{argument1}} {{argument2}}`"
What is git-prune command,,"# git prune
> Git command for pruning all unreachable objects from the object database.
> This command is often not used directly but as an internal command that is
> used by Git gc. More information: https://git-scm.com/docs/git-prune.
* Report what would be removed by Git prune without removing it:
`git prune --dry-run`
* Prune unreachable objects and display what has been pruned to `stdout`:
`git prune --verbose`
* Prune unreachable objects while showing progress:
`git prune --progress`"
What is oomctl command,,"# oomctl
> Analyze the state stored in `systemd-oomd`. More information:
> https://www.freedesktop.org/software/systemd/man/oomctl.html.
* Show the current state of the cgroups and system contexts stored by `systemd-oomd`:
`oomctl dump`"
What is git-config command,,"# git config
> Manage custom configuration options for Git repositories. These
> configurations can be local (for the current repository) or global (for the
> current user). More information: https://git-scm.com/docs/git-config.
* List only local configuration entries (stored in `.git/config` in the current repository):
`git config --list --local`
* List only global configuration entries (stored in `~/.gitconfig` by default or in `$XDG_CONFIG_HOME/git/config` if such a file exists):
`git config --list --global`
* List only system configuration entries (stored in `/etc/gitconfig`), and show their file location:
`git config --list --system --show-origin`
* Get the value of a given configuration entry:
`git config alias.unstage`
* Set the global value of a given configuration entry:
`git config --global alias.unstage ""reset HEAD --""`
* Revert a global configuration entry to its default value:
`git config --global --unset alias.unstage`
* Edit the Git configuration for the current repository in the default editor:
`git config --edit`
* Edit the global Git configuration in the default editor:
`git config --global --edit`"
What is git-merge-base command,,"# git merge-base
> Find a common ancestor of two commits. More information: https://git-
> scm.com/docs/git-merge-base.
* Print the best common ancestor of two commits:
`git merge-base {{commit_1}} {{commit_2}}`
* Output all best common ancestors of two commits:
`git merge-base --all {{commit_1}} {{commit_2}}`
* Check if a commit is an ancestor of a specific commit:
`git merge-base --is-ancestor {{ancestor_commit}} {{commit}}`"
What is pwd command,,"# pwd
> Print name of current/working directory. More information:
> https://www.gnu.org/software/coreutils/pwd.
* Print the current directory:
`pwd`
* Print the current directory, and resolve all symlinks (i.e. show the ""physical"" path):
`pwd -P`"
What is git-unpack-file command,,"# git unpack-file
> Create a temporary file with a blob's contents. More information:
> https://git-scm.com/docs/git-unpack-file.
* Create a file holding the contents of the blob specified by its ID then print the name of the temporary file:
`git unpack-file {{blob_id}}`"
What is git-fsck command,,"# git fsck
> Verify the validity and connectivity of nodes in a Git repository index.
> Does not make any modifications. See `git gc` for cleaning up dangling
> blobs. More information: https://git-scm.com/docs/git-fsck.
* Check the current repository:
`git fsck`
* List all tags found:
`git fsck --tags`
* List all root nodes found:
`git fsck --root`"
What is chgrp command,,"# chgrp
> Change group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chgrp.
* Change the owner group of a file/directory:
`chgrp {{group}} {{path/to/file_or_directory}}`
* Recursively change the owner group of a directory and its contents:
`chgrp -R {{group}} {{path/to/directory}}`
* Change the owner group of a symbolic link:
`chgrp -h {{group}} {{path/to/symlink}}`
* Change the owner group of a file/directory to match a reference file:
`chgrp --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`"
What is free command,,"# free
> Display amount of free and used memory in the system. More information:
> https://manned.org/free.
* Display system memory:
`free`
* Display memory in Bytes/KB/MB/GB:
`free -{{b|k|m|g}}`
* Display memory in human-readable units:
`free -h`
* Refresh the output every 2 seconds:
`free -s {{2}}`"
What is id command,,"# id
> Display current user and group identity. More information:
> https://www.gnu.org/software/coreutils/id.
* Display current user's ID (UID), group ID (GID) and groups to which they belong:
`id`
* Display the current user identity as a number:
`id -u`
* Display the current group identity as a number:
`id -g`
* Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong:
`id {{username}}`"
What is readelf command,,"# readelf
> Displays information about ELF files. More information:
> http://man7.org/linux/man-pages/man1/readelf.1.html.
* Display all information about the ELF file:
`readelf -all {{path/to/binary}}`
* Display all the headers present in the ELF file:
`readelf --headers {{path/to/binary}}`
* Display the entries in symbol table section of the ELF file, if it has one:
`readelf --symbols {{path/to/binary}}`
* Display the information contained in the ELF header at the start of the file:
`readelf --file-header {{path/to/binary}}`"
What is ld command,,"# ld
> Link object files together. More information:
> https://sourceware.org/binutils/docs-2.38/ld.html.
* Link a specific object file with no dependencies into an executable:
`ld {{path/to/file.o}} --output {{path/to/output_executable}}`
* Link two object files together:
`ld {{path/to/file1.o}} {{path/to/file2.o}} --output
{{path/to/output_executable}}`
* Dynamically link an x86_64 program to glibc (file paths change depending on the system):
`ld --output {{path/to/output_executable}} --dynamic-linker /lib/ld-
linux-x86-64.so.2 /lib/crt1.o /lib/crti.o -lc {{path/to/file.o}} /lib/crtn.o`"
What is git-commit command,,"# git commit
> Commit files to the repository. More information: https://git-
> scm.com/docs/git-commit.
* Commit staged files to the repository with a message:
`git commit --message ""{{message}}""`
* Commit staged files with a message read from a file:
`git commit --file {{path/to/commit_message_file}}`
* Auto stage all modified and deleted files and commit with a message:
`git commit --all --message ""{{message}}""`
* Commit staged files and sign them with the specified GPG key (or the one defined in the config file if no argument is specified):
`git commit --gpg-sign {{key_id}} --message ""{{message}}""`
* Update the last commit by adding the currently staged changes, changing the commit's hash:
`git commit --amend`
* Commit only specific (already staged) files:
`git commit {{path/to/file1}} {{path/to/file2}}`
* Create a commit, even if there are no staged files:
`git commit --message ""{{message}}"" --allow-empty`"
What is xargs command,,"# xargs
> Execute a command with piped arguments coming from another command, a file,
> etc. The input is treated as a single block of text and split into separate
> pieces on spaces, tabs, newlines and end-of-file. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html.
* Run a command using the input data as arguments:
`{{arguments_source}} | xargs {{command}}`
* Run multiple chained commands on the input data:
`{{arguments_source}} | xargs sh -c ""{{command1}} && {{command2}} |
{{command3}}""`
* Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`
* Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:
`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}`
* Parallel runs of up to `max-procs` processes at a time; the default is 1. If `max-procs` is 0, xargs will run as many processes as possible at a time:
`{{arguments_source}} | xargs -P {{max-procs}} {{command}}`"
What is stty command,,"# stty
> Set options for a terminal device interface. More information:
> https://www.gnu.org/software/coreutils/stty.
* Display all settings for the current terminal:
`stty --all`
* Set the number of rows or columns:
`stty {{rows|cols}} {{count}}`
* Get the actual transfer speed of a device:
`stty --file {{path/to/device_file}} speed`
* Reset all modes to reasonable values for the current terminal:
`stty sane`"
What is git-ls-files command,,"# git ls-files
> Show information about files in the index and the working tree. More
> information: https://git-scm.com/docs/git-ls-files.
* Show deleted files:
`git ls-files --deleted`
* Show modified and deleted files:
`git ls-files --modified`
* Show ignored and untracked files:
`git ls-files --others`
* Show untracked files, not ignored:
`git ls-files --others --exclude-standard`"
What is shred command,,"# shred
> Overwrite files to securely delete data. More information:
> https://www.gnu.org/software/coreutils/shred.
* Overwrite a file:
`shred {{path/to/file}}`
* Overwrite a file, leaving zeroes instead of random data:
`shred --zero {{path/to/file}}`
* Overwrite a file 25 times:
`shred -n25 {{path/to/file}}`
* Overwrite a file and remove it:
`shred --remove {{path/to/file}}`"
What is tac command,,"# tac
> Display and concatenate files with lines in reversed order. See also: `cat`.
> More information: https://www.gnu.org/software/coreutils/tac.
* Concatenate specific files in reversed order:
`tac {{path/to/file1 path/to/file2 ...}}`
* Display `stdin` in reversed order:
`{{cat path/to/file}} | tac`
* Use a specific [s]eparator:
`tac -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
* Use a specific [r]egex as a [s]eparator:
`tac -r -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
* Use a separator [b]efore each file:
`tac -b {{path/to/file1 path/to/file2 ...}}`"
What is write command,,"# write
> Write a message on the terminal of a specified logged in user (ctrl-C to
> stop writing messages). Use the `who` command to find out all terminal_ids
> of all active users active on the system. See also `mesg`. More information:
> https://manned.org/write.
* Send a message to a given user on a given terminal id:
`write {{username}} {{terminal_id}}`
* Send message to ""testuser"" on terminal `/dev/tty/5`:
`write {{testuser}} {{tty/5}}`
* Send message to ""johndoe"" on pseudo terminal `/dev/pts/5`:
`write {{johndoe}} {{pts/5}}`"
What is git-ls-remote command,,"# git ls-remote
> Git command for listing references in a remote repository based on name or
> URL. If no name or URL are given, then the configured upstream branch will
> be used, or remote origin if the former is not configured. More information:
> https://git-scm.com/docs/git-ls-remote.
* Show all references in the default remote repository:
`git ls-remote`
* Show only heads references in the default remote repository:
`git ls-remote --heads`
* Show only tags references in the default remote repository:
`git ls-remote --tags`
* Show all references from a remote repository based on name or URL:
`git ls-remote {{repository_url}}`
* Show references from a remote repository filtered by a pattern:
`git ls-remote {{repository_name}} ""{{pattern}}""`"
What is git-merge command,,"# git merge
> Merge branches. More information: https://git-scm.com/docs/git-merge.
* Merge a branch into your current branch:
`git merge {{branch_name}}`
* Edit the merge message:
`git merge --edit {{branch_name}}`
* Merge a branch and create a merge commit:
`git merge --no-ff {{branch_name}}`
* Abort a merge in case of conflicts:
`git merge --abort`
* Merge using a specific strategy:
`git merge --strategy {{strategy}} --strategy-option {{strategy_option}}
{{branch_name}}`"
What is chown command,,"# chown
> Change user and group ownership of files and directories. More information:
> https://www.gnu.org/software/coreutils/chown.
* Change the owner user of a file/directory:
`chown {{user}} {{path/to/file_or_directory}}`
* Change the owner user and group of a file/directory:
`chown {{user}}:{{group}} {{path/to/file_or_directory}}`
* Recursively change the owner of a directory and its contents:
`chown -R {{user}} {{path/to/directory}}`
* Change the owner of a symbolic link:
`chown -h {{user}} {{path/to/symlink}}`
* Change the owner of a file/directory to match a reference file:
`chown --reference={{path/to/reference_file}} {{path/to/file_or_directory}}`"
What is sshfs command,,"# sshfs
> Filesystem client based on SSH. More information:
> https://github.com/libfuse/sshfs.
* Mount remote directory:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}`
* Unmount remote directory:
`umount {{mountpoint}}`
* Mount remote directory from server with specific port:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -p {{2222}}`
* Use compression:
`sshfs {{username}}@{{remote_host}}:{{remote_directory}} -C`
* Follow symbolic links:
`sshfs -o follow_symlinks {{username}}@{{remote_host}}:{{remote_directory}}
{{mountpoint}}`"
What is sleep command,,"# sleep
> Delay for a specified amount of time. More information:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html.
* Delay in seconds:
`sleep {{seconds}}`
* Execute a specific command after 20 seconds delay:
`sleep 20 && {{command}}`"
What is manpath command,,"# manpath
> Determine the search path for manual pages. More information:
> https://manned.org/manpath.
* Display the search path used to find man pages:
`manpath`
* Show the entire global manpath:
`manpath --global`"
What is mv command,,"# mv
> Move or rename files and directories. More information:
> https://www.gnu.org/software/coreutils/mv.
* Rename a file or directory when the target is not an existing directory:
`mv {{path/to/source}} {{path/to/target}}`
* Move a file or directory into an existing directory:
`mv {{path/to/source}} {{path/to/existing_directory}}`
* Move multiple files into an existing directory, keeping the filenames unchanged:
`mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}`
* Do not prompt for confirmation before overwriting existing files:
`mv -f {{path/to/source}} {{path/to/target}}`
* Prompt for confirmation before overwriting existing files, regardless of file permissions:
`mv -i {{path/to/source}} {{path/to/target}}`
* Do not overwrite existing files at the target:
`mv -n {{path/to/source}} {{path/to/target}}`
* Move files in verbose mode, showing files after they are moved:
`mv -v {{path/to/source}} {{path/to/target}}`"
What is whereis command,,"# whereis
> Locate the binary, source, and manual page files for a command. More
> information: https://manned.org/whereis.
* Locate binary, source and man pages for ssh:
`whereis {{ssh}}`
* Locate binary and man pages for ls:
`whereis -bm {{ls}}`
* Locate source of gcc and man pages for Git:
`whereis -s {{gcc}} -m {{git}}`
* Locate binaries for gcc in `/usr/bin/` only:
`whereis -b -B {{/usr/bin/}} -f {{gcc}}`
* Locate unusual binaries (those that have more or less than one binary on the system):
`whereis -u *`
* Locate binaries that have unusual manual entries (binaries that have more or less than one manual installed):
`whereis -u -m *`"
What is git-daemon command,,"# git daemon
> A really simple server for Git repositories. More information: https://git-
> scm.com/docs/git-daemon.
* Launch a Git daemon with a whitelisted set of directories:
`git daemon --export-all {{path/to/directory1}} {{path/to/directory2}}`
* Launch a Git daemon with a specific base directory and allow pulling from all sub-directories that look like Git repositories:
`git daemon --base-path={{path/to/directory}} --export-all --reuseaddr`
* Launch a Git daemon for the specified directory, verbosely printing log messages and allowing Git clients to write to it:
`git daemon {{path/to/directory}} --enable=receive-pack --informative-errors
--verbose`"
|