index.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <h1 id="byebyemouse">🐭 Bye Bye Mouse</h1>
  2. <p><marquee>
  3. Because real power users don’t double-click—they type :)
  4. </marquee></p>
  5. <p>Escape the tyranny of the GUI one command at a time! This repo is your golden ticket to slick shell tricks, terminal wizardry, and keyboard-fueled productivity. Unplug that mouse and watch your workflow sprint.
  6. </br></p>
  7. <h2 id="quicklinks">Quick Links</h2>
  8. <ol>
  9. <li><a href="#copy-a-file">copy a file</a></li>
  10. <li><a href="#duplicate-a-file">duplicate a file</a></li>
  11. <li><a href="#copy-a-directory">copy a directory</a></li>
  12. <li><a href="#duplicate-a-directory">duplicate a directory</a></li>
  13. <li><a href="#move-a-file">move a file</a></li>
  14. <li><a href="#rename-a-file">rename a file</a></li>
  15. <li><a href="#move-a-directory">move a directory</a></li>
  16. <li><a href="#rename-a-directory">rename a directory</a></li>
  17. <li><a href="#merge-directories">merge directories</a></li>
  18. <li><a href="#create-a-new-file">create a new file</a></li>
  19. <li><a href="#create-a-new-directory">create a new directory</a></li>
  20. <li><a href="#show-filedirectory-size">show file/directory size</a></li>
  21. <li><a href="#show-filedirectory-info">show file/directory info</a></li>
  22. <li><a href="#open-a-file-with-the-default-program">open a file with the default program</a></li>
  23. <li><a href="#open-a-file-in-any-application">open a file in any application</a></li>
  24. <li><a href="#zip-a-directory">zip a directory</a></li>
  25. <li><a href="#unzip-a-directory">unzip a directory</a></li>
  26. <li><a href="#peek-files-in-a-zip-file">peek files in a zip file</a></li>
  27. <li><a href="#remove-a-file">remove a file</a></li>
  28. <li><a href="#remove-a-directory">remove a directory</a></li>
  29. <li><a href="#remove-all-files-of-certain-criteria">remove all files of certain criteria</a></li>
  30. <li><a href="#list-directory-contents">list directory contents</a></li>
  31. <li><a href="#tree-view-a-directory-and-its-subdirectories">tree view a directory and its subdirectories</a></li>
  32. <li><a href="#find-a-stale-file">find a stale file</a></li>
  33. <li><a href="#show-a-calendar">show a calendar</a></li>
  34. <li><a href="#find-a-future-date">find a future date</a></li>
  35. <li><a href="#use-a-calculator">use a calculator</a></li>
  36. <li><a href="#force-quit-a-program">force quit a program</a></li>
  37. <li><a href="#check-server-response">check server response</a></li>
  38. <li><a href="#view-content-of-a-file">view content of a file</a></li>
  39. <li><a href="#search-for-a-text-in-a-file">search for a text in a file</a></li>
  40. <li><a href="#search-in-all-files-in-current-working-directory-quickly-entire-disk-in-less-than-15-minutes">search in all files in current working directory, quickly (entire disk in less than 15 minutes)</a></li>
  41. <li><a href="#view-an-image">view an image</a></li>
  42. <li><a href="#show-disk-size">show disk size</a></li>
  43. <li><a href="#check-cpu-usage-processes-and-ram">check cpu usage, processes and RAM</a></li>
  44. <li><a href="#know-whether-your-computer-is-under-load-and-whether-its-due-to-memory-or-cpu">know whether your computer is under load, and whether it's due to memory or CPU</a></li>
  45. <li><a href="#poweroff-or-reboot-your-computer">poweroff or reboot your computer</a></li>
  46. <li><a href="#locate-usb-drives">locate USB drives</a></li>
  47. <li><a href="#unmount-usb-drives">unmount USB drives</a></li>
  48. <li><a href="#format-usb-drives">format USB drives</a></li>
  49. <li><a href="#check-usb-format">check USB format</a></li>
  50. <li><a href="#run-command-on-all-files-of-a-directory">run command on all files of a directory</a></li>
  51. <li><a href="#check-network-connectivity-to-a-remote-address-and-port">check network connectivity to a remote address and port</a></li>
  52. <li><a href="#check-dns-config-of-a-domain">check DNS config of a domain</a></li>
  53. <li><a href="#check-the-ownership-and-registration-of-a-domain">check the ownership and registration of a domain</a></li>
  54. </ol>
  55. <!-- 1. [Quick tips](#quick-tips) -->
  56. <ol>
  57. <li><a href="#hotkeys">Hotkeys</a></li>
  58. <li><a href="#i-cant-remember-these-cryptic-commands">I can't remember these cryptic commands</a></li>
  59. </ol>
  60. <h2 id="copyafile">copy a file</h2>
  61. <p><strong>STOP DRAG AND DROPPING A FILE, OR CMD/CTRL + C, CMD/CTRL + V A FILE</strong> :-1:</p>
  62. <p>Copy <code>readme.txt</code> to the <code>documents</code> directory</p>
  63. <pre><code class="shell language-shell">$ cp readme.txt documents/
  64. </code></pre>
  65. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  66. <h2 id="duplicateafile">duplicate a file</h2>
  67. <p><strong>STOP RIGHT CLICKING AND DUPLICATE A FILE</strong> :-1:</p>
  68. <pre><code class="shell language-shell">$ cp readme.txt readme.bak.txt
  69. </code></pre>
  70. <p>More advanced:</p>
  71. <pre><code class="shell language-shell">$ cp readme{,.bak}.txt
  72. # Note: learn how the {} works with touch foo{1,2,3}.txt and see what happens.
  73. </code></pre>
  74. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  75. <h2 id="copyadirectory">copy a directory</h2>
  76. <p><strong>STOP DRAG AND DROPPING A DIRECTORY, OR CMD/CTRL + C, CMD/CTRL + V A DIRECTORY</strong> :-1:</p>
  77. <p>Copy <code>myMusic</code> directory to the <code>myMedia</code> directory</p>
  78. <pre><code class="shell language-shell">$ cp -a myMusic myMedia/
  79. # or
  80. $ cp -a myMusic/ myMedia/myMusic/
  81. </code></pre>
  82. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  83. <h2 id="duplicateadirectory">duplicate a directory</h2>
  84. <p><strong>STOP RIGHT CLICKING AND DUPLICATE A DIRECTORY</strong> :-1:</p>
  85. <pre><code class="shell language-shell">$ cp -a myMusic/ myMedia/
  86. # or if `myMedia` folder doesn't exist
  87. $ cp -a myMusic myMedia/
  88. </code></pre>
  89. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  90. <h2 id="moveafile">move a file</h2>
  91. <p><strong>STOP DRAG AND DROPPING A FILE, OR CMD/CTRL + X, CMD/CTRL + V A FILE</strong> :-1:</p>
  92. <pre><code class="shell language-shell">$ mv readme.txt documents/
  93. </code></pre>
  94. <p><strong>Always</strong> use a trailing slash when moving files, <a href="http://unix.stackexchange.com/a/50533">for this reason</a>.</p>
  95. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  96. <h2 id="renameafile">rename a file</h2>
  97. <p><strong>STOP RIGHT CLICKING AND RENAME A FILE</strong> :-1:</p>
  98. <pre><code class="shell language-shell">$ mv readme.txt README.md
  99. </code></pre>
  100. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  101. <h2 id="moveadirectory">move a directory</h2>
  102. <p><strong>STOP DRAG AND DROPPING A DIRECTORY, OR CMD/CTRL + X, CMD/CTRL + V A DIRECTORY</strong> :-1:</p>
  103. <pre><code class="shell language-shell">$ mv myMedia myMusic/
  104. # or
  105. $ mv myMedia/ myMusic/myMedia
  106. </code></pre>
  107. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  108. <h2 id="renameadirectory">rename a directory</h2>
  109. <p><strong>STOP RIGHT CLICKING AND RENAME A DIRECTORY</strong> :-1:</p>
  110. <pre><code class="shell language-shell">$ mv myMedia/ myMusic/
  111. </code></pre>
  112. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  113. <h2 id="mergedirectories">merge directories</h2>
  114. <p><strong>STOP DRAG AND DROPPING TO MERGE DIRECTORIES</strong> :-1:</p>
  115. <pre><code class="shell language-shell">$ rsync -a /images/ /images2/ # note: may over-write files with the same name, so be careful!
  116. </code></pre>
  117. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  118. <h2 id="createanewfile">create a new file</h2>
  119. <p><strong>STOP RIGHT CLICKING AND CREATE A NEW FILE</strong> :-1:</p>
  120. <pre><code class="shell language-shell">$ touch 'new file' # updates the file's access and modification timestamp if it already exists
  121. # or
  122. $ &gt; 'new file' # note: erases the content if it already exists
  123. </code></pre>
  124. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  125. <h2 id="createanewdirectory">create a new directory</h2>
  126. <p><strong>STOP RIGHT CLICKING AND CREATE A NEW DIRECTORY</strong> :-1:</p>
  127. <pre><code class="shell language-shell">$ mkdir 'untitled folder'
  128. # or
  129. $ mkdir -p 'path/may/not/exist/untitled folder'
  130. </code></pre>
  131. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  132. <h2 id="showfiledirectorysize">show file/directory size</h2>
  133. <p><strong>STOP RIGHT CLICKING AND SHOW FILE/directory INFO</strong> :-1:</p>
  134. <pre><code class="shell language-shell">$ du -sh node_modules/
  135. </code></pre>
  136. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  137. <h2 id="showfiledirectoryinfo">show file/directory info</h2>
  138. <p><strong>STOP RIGHT CLICKING AND SHOW FILE/DIRECTORY INFO</strong> :-1:</p>
  139. <pre><code class="shell language-shell">$ stat -x readme.md # on macOS
  140. $ stat readme.md # on Linux
  141. </code></pre>
  142. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  143. <h2 id="openafilewiththedefaultprogram">open a file with the default program</h2>
  144. <p><strong>STOP DOUBLE CLICKING ON A FILE</strong> :-1:</p>
  145. <pre><code class="shell language-shell">$ xdg-open file # on Linux
  146. $ open file # on MacOS
  147. $ start file # on Windows
  148. </code></pre>
  149. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  150. <h2 id="openafileinanyapplication">open a file in any application</h2>
  151. <p><strong>STOP RIGHT CLICKING AND OPEN WITH</strong> :-1:</p>
  152. <pre><code class="shell language-shell">$ open -a appName file
  153. </code></pre>
  154. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  155. <h2 id="zipadirectory">zip a directory</h2>
  156. <p><strong>STOP RIGHT CLICKING AND COMPRESS DIRECTORY</strong> :-1:</p>
  157. <pre><code class="shell language-shell">$ zip -r archive_name.zip folder_to_compress
  158. </code></pre>
  159. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  160. <h2 id="unzipadirectory">unzip a directory</h2>
  161. <p><strong>STOP RIGHT CLICKING AND UNCOMPRESS DIRECTORY</strong> :-1:</p>
  162. <pre><code class="shell language-shell">$ unzip archive_name.zip
  163. </code></pre>
  164. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  165. <h2 id="decompressfilesofanyformat">decompress files of any format</h2>
  166. <p><strong>STOP RIGHT CLICKING AND UNCOMPRESS DIRECTORY</strong> :-1:</p>
  167. <pre><code class="shell language-shell">$ unar archive_name.zip
  168. $ unar archive_name.7z
  169. $ unar archive_name.rar
  170. $ unar archive_name.ISO
  171. $ unar archive_name.tar.gz
  172. </code></pre>
  173. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  174. <h2 id="peekfilesinazipfile">peek files in a zip file</h2>
  175. <p><strong>STOP USING WinRAR</strong> :-1:</p>
  176. <pre><code class="shell language-shell">$ zipinfo archive_name.zip
  177. # or
  178. $ unzip -l archive_name.zip
  179. </code></pre>
  180. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  181. <h2 id="peekfilesinacompressfileofanyformat">peek files in a compress file of any format</h2>
  182. <p><strong>STOP USING WinRAR</strong> :-1:</p>
  183. <pre><code class="shell language-shell">$ lsar -l archive_name.zip
  184. $ lsar -l archive_name.7z
  185. $ lsar -l archive_name.ISO
  186. $ lsar -l archive_name.rar
  187. $ lsar -l archive_name.tar.gz
  188. </code></pre>
  189. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  190. <h2 id="removeafile">remove a file</h2>
  191. <p><strong>STOP RIGHT CLICKING AND DELETE A FILE PERMANENTLY</strong> :-1:</p>
  192. <pre><code class="shell language-shell">$ rm my_useless_file
  193. </code></pre>
  194. <p><strong>IMPORTANT</strong>: The <code>rm</code> command deletes <code>my_useless_file</code> permanently, which is equivalent to move <code>my_useless_file</code> to Recycle Bin and hit Empty Recycle Bin.</p>
  195. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  196. <h2 id="removeadirectory">remove a directory</h2>
  197. <p><strong>STOP RIGHT CLICKING AND DELETE A DIRECTORY PERMANENTLY</strong> :-1:</p>
  198. <pre><code class="shell language-shell">$ rm -r my_useless_folder
  199. </code></pre>
  200. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  201. <h2 id="removeallfilesofcertaincriteria">remove all files of certain criteria</h2>
  202. <pre><code class="shell language-shell">$ find . -name "*.bak" -type f -delete
  203. </code></pre>
  204. <p><strong>IMPORTANT</strong>: run <code>find . -name "*.bak" -type f</code> first to see exactly which files you will remove.</p>
  205. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  206. <h2 id="listdirectorycontents">list directory contents</h2>
  207. <p><strong>STOP OPENING YOUR FINDER OR FILE EXPLORER</strong> :-1:</p>
  208. <pre><code class="shell language-shell">$ ls my_folder # Simple
  209. $ ls -la my_folder # -l: show in list format. -a: show all files, including hidden. -la combines those options.
  210. $ ls -ltrha my_folder # -r: reverse output. -t: sort by time (modified). -h: output human-readable sizes.
  211. </code></pre>
  212. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  213. <h2 id="treeviewadirectoryanditssubdirectories">tree view a directory and its subdirectories</h2>
  214. <p><strong>STOP OPENING YOUR FINDER OR FILE EXPLORER</strong> :-1:</p>
  215. <pre><code class="shell language-shell">$ tree # on Linux
  216. $ find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' # on MacOS
  217. # Note: install homebrew (https://brew.sh) to be able to use (some) Linux utilities such as tree.
  218. # brew install tree
  219. </code></pre>
  220. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  221. <h2 id="findastalefile">find a stale file</h2>
  222. <p><strong>STOP USING YOUR FILE EXPLORER TO FIND A FILE</strong> :-1:</p>
  223. <p>Find all files modified more than 5 days ago</p>
  224. <pre><code class="shell language-shell">$ find my_folder -mtime +5
  225. </code></pre>
  226. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  227. <h2 id="showacalendar">show a calendar</h2>
  228. <p><strong>STOP LOOKING UP WHAT THIS MONTH LOOKS LIKE BY CALENDAR WIDGETS</strong> :-1:</p>
  229. <p>Display a text calendar</p>
  230. <pre><code class="shell language-shell">$ cal
  231. </code></pre>
  232. <p>Display selected month and year calendar</p>
  233. <pre><code class="shell language-shell">$ cal 11 2018
  234. </code></pre>
  235. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  236. <h2 id="findafuturedate">find a future date</h2>
  237. <p><strong>STOP USING WEBAPPS TO CALCULATE FUTURE DATES</strong> :-1:</p>
  238. <p>What is today's date?</p>
  239. <pre><code class="shell language-shell">$ date +%m/%d/%Y
  240. </code></pre>
  241. <p>What about a week from now?</p>
  242. <pre><code class="shell language-shell">$ date -d "+7 days" # on Linux
  243. $ date -j -v+7d # on MacOS
  244. </code></pre>
  245. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  246. <h2 id="useacalculator">use a calculator</h2>
  247. <p><strong>STOP USING CALCULATOR WIDGET</strong> :-1:</p>
  248. <pre><code class="shell language-shell">$ bc -l
  249. </code></pre>
  250. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  251. <h2 id="forcequitaprogram">force quit a program</h2>
  252. <p><strong>STOP CTRL + ALT + DELETE and choose the program to kill</strong> :-1:</p>
  253. <pre><code class="shell language-shell">$ killall -9 program_name
  254. </code></pre>
  255. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  256. <h2 id="checkserverresponse">check server response</h2>
  257. <p><strong>STOP OPENING A BROWSER</strong> :-1:</p>
  258. <pre><code class="shell language-shell">$ curl -i rbtreevi.web.app
  259. # curl's -i (--include) option includes HTTP response headers in its output.
  260. </code></pre>
  261. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  262. <h2 id="viewcontentofafile">view content of a file</h2>
  263. <p><strong>STOP DOUBLE CLICKING A FILE</strong> :-1:</p>
  264. <pre><code class="shell language-shell">$ cat apps/settings.py
  265. # if the file is too big to fit on one page, you can use a 'pager' (less) which shows you one page at a time.
  266. $ less apps/settings.py
  267. </code></pre>
  268. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  269. <h2 id="searchforatextinafile">search for a text in a file</h2>
  270. <p><strong>STOP CMD/CTRL + F IN A FILE</strong> :-1:</p>
  271. <pre><code class="shell language-shell">$ grep -i "Query" file.txt
  272. </code></pre>
  273. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  274. <h2 id="searchinallfilesincurrentworkingdirectoryquicklyentirediskinlessthan15minutes">search in all files in current working directory, quickly (entire disk in less than 15 minutes)</h2>
  275. <p><strong>STOP CMD/CTRL + F IN A DIRECTORY</strong> :-1:</p>
  276. <pre><code class="shell language-shell">$ ripgrep -i "Query"
  277. # brew install ripgrep
  278. </code></pre>
  279. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  280. <h2 id="viewanimage">view an image</h2>
  281. <p><strong>STOP USING PREVIEW</strong> :-1:</p>
  282. <pre><code class="shell language-shell">$ imgcat image.png
  283. # Note: requires iTerm2 terminal.
  284. </code></pre>
  285. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  286. <h2 id="showdisksize">show disk size</h2>
  287. <p><strong>STOP RIGHT CLICKING DISK ICON OR OPENING DISK UTILITY</strong> :-1:</p>
  288. <pre><code class="shell language-shell">$ df -h
  289. </code></pre>
  290. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  291. <h2 id="checkcpuusageprocessesandram">check cpu usage, processes and RAM</h2>
  292. <p><strong>STOP OPENING YOUR ACTIVITY MONITOR OR TASK MANAGER</strong> :-1:</p>
  293. <pre><code class="shell language-shell">$ top
  294. </code></pre>
  295. <p>if you want some more details:</p>
  296. <pre><code class="shell language-shell">$ htop
  297. </code></pre>
  298. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  299. <h2 id="knowwhetheryourcomputerisunderloadandwhetheritsduetomemoryorcpu">know whether your computer is under load, and whether it's due to memory or CPU</h2>
  300. <pre><code class="shell language-shell">$ glances
  301. # brew install glances
  302. # pip install --user 'glances[all]'
  303. </code></pre>
  304. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  305. <h2 id="powerofforrebootyourcomputer">poweroff or reboot your computer</h2>
  306. <p>This can be useful when you're patching a server that is accessed via SSH and you don't have a GUI.</p>
  307. <pre><code class="shell language-shell"># poweroff
  308. $ sudo shutdown -h now
  309. # reboot
  310. $ sudo shutdown -r now
  311. </code></pre>
  312. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  313. <h2 id="locateusbdrives">locate USB drives</h2>
  314. <pre><code class="shell language-shell">$ df
  315. </code></pre>
  316. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  317. <h2 id="unmountusbdrives">unmount USB drives</h2>
  318. <pre><code class="shell language-shell">$ sudo umount /dev/sdb1
  319. </code></pre>
  320. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  321. <h2 id="formatusbdrives">format USB drives</h2>
  322. <pre><code class="shell language-shell"># FAT32
  323. $ sudo mkfs.vfat /dev/sdb1
  324. # NTFS
  325. $ sudo mkfs.ntfs /dev/sdb1
  326. # exFAT
  327. $ sudo mkfs.exfat /dev/sdb1
  328. </code></pre>
  329. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  330. <h2 id="checkusbformat">check USB format</h2>
  331. <pre><code class="shell language-shell">$ sudo fsck /dev/sdb1
  332. </code></pre>
  333. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  334. <h2 id="runcommandonallfilesofadirectory">run command on all files of a directory</h2>
  335. <p><strong>STOP CLICKING THE FILES ONE BY ONE</strong> :-1:</p>
  336. <pre><code class="shell language-shell">$ for FILE in *; do echo $FILE; done
  337. </code></pre>
  338. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  339. <h2 id="checknetworkconnectivitytoaremoteaddressandport">check network connectivity to a remote address and port</h2>
  340. <p><strong>STOP USING NETWORK UTILITY</strong></p>
  341. <pre><code class="shell language-shell">$ nc -vz www.google.com 443
  342. $ nc -vz 1.1.1.1 53
  343. </code></pre>
  344. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  345. <h2 id="checkdnsconfigofadomain">check DNS config of a domain</h2>
  346. <p><strong>STOP USING NETWORK UTILITY</strong></p>
  347. <pre><code class="shell language-shell">$ dig www.google.com
  348. </code></pre>
  349. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  350. <h2 id="checktheownershipandregistrationofadomain">check the ownership and registration of a domain</h2>
  351. <p><strong>STOP USING NETWORK UTILITY AND THE WEBSITE OF DOMAIN REGISTRATION PROVIDERS</strong></p>
  352. <pre><code class="shell language-shell">$ whois www.google.com
  353. </code></pre>
  354. <p><a href="#quick-links">Go to table of contents 🔼</a></p>
  355. <!-- ## Quick tips
  356. ![CLI tips](./cli_tips.jpg)
  357. [Go to table of contents 🔼](#quick-links) -->
  358. <h2 id="hotkeys">Hotkeys</h2>
  359. <p>| Hotkey | Description |
  360. |----------|-------------|
  361. | <kbd>Ctrl</kbd>+<kbd>A</kbd> | Go to the beginning of the line you are currently typing on |
  362. | <kbd>Ctrl</kbd>+<kbd>E</kbd> | Go to the end of the line you are currently typing on |
  363. | <kbd>Ctrl</kbd>+<kbd>L</kbd> | Clears the Screen, similar to the clear command |
  364. | <kbd>Ctrl</kbd>+<kbd>U</kbd> | Clears the line before the cursor position. If you are at the end of the line, clears the entire line. |
  365. | <kbd>Ctrl</kbd>+<kbd>H</kbd> | Same as backspace |
  366. | <kbd>Ctrl</kbd>+<kbd>R</kbd> | Lets you search through previously used commands |
  367. | <kbd>Ctrl</kbd>+<kbd>C</kbd> | Kill whatever you are running |
  368. | <kbd>Ctrl</kbd>+<kbd>D</kbd> | Exit the current shell |
  369. | <kbd>Ctrl</kbd>+<kbd>Z</kbd> | Puts whatever you are running into a suspended background process. fg restores it. |
  370. | <kbd>Ctrl</kbd>+<kbd>W</kbd> | Delete the word before the cursor |
  371. | <kbd>Ctrl</kbd>+<kbd>K</kbd> | Clear the line after the cursor |
  372. | <kbd>Ctrl</kbd>+<kbd>T</kbd> | Swap the last two characters before the cursor |
  373. | <kbd>Ctrl</kbd>+<kbd>F</kbd> | Move cursor forward one character |
  374. | <kbd>Ctrl</kbd>+<kbd>B</kbd> | Move cursor backward one character |
  375. | <kbd>Esc</kbd>+<kbd>T</kbd> | Swap the last two words before the cursor |
  376. | <kbd>Alt</kbd>+<kbd>T</kbd> | Same as <kbd>Esc</kbd> + <kbd>T</kbd> |
  377. | <kbd>Alt</kbd>+<kbd>F</kbd> | Move cursor forward one word on the current line |
  378. | <kbd>Alt</kbd>+<kbd>B</kbd> | Move cursor backward one word on the current line |
  379. | <kbd>Esc</kbd>+<kbd>F</kbd> | Same as <kbd>Alt</kbd> + <kbd>F</kbd> |
  380. | <kbd>Esc</kbd>+<kbd>B</kbd> | Same as <kbd>Alt</kbd> + <kbd>B</kbd> |
  381. | <kbd>Alt</kbd>+<kbd>.</kbd> | Paste the last word of the most recently command |
  382. | <kbd>Tab</kbd> | Auto-complete files and directory names |
  383. <a href="#quick-links">Go to table of contents 🔼</a></p>
  384. <h2 id="icantrememberthesecrypticcommands">I can't remember these cryptic commands</h2>
  385. <p>You can always google or <code>man</code> the commands you are not familiar with. Or, checkout <a href="https://github.com/tldr-pages/tldr">tldr</a>, a collection of simplified and community-driven man pages.</p>
  386. <p><a href="#quick-links">Go to table of contents 🔼</a></p>