issue132:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue132:c_c [2018/04/30 15:01] – d52fr | issue132:c_c [2018/05/02 19:19] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | **I’ve frequently written articles on tools and websites that I find useful in my work life. However, it has been a long time since I focused on CLI tools. As such, I thought it would be good to revisit this topic and share an up-to-date list of commands that I find myself using almost every day.** | + | **I’ve frequently written articles on tools and websites that I find useful in my work life. However, it has been a long time since I focused on CLI tools. As such, I thought it would be good to revisit this topic and share an up-to-date list of commands that I find myself using almost every day. |
- | **dig | + | dig |
Dig is a tool which lets you pull in DNS information about a particular domain. This is extremely helpful when you’re migrating websites (to see if the error is an error or the DNS not having updated yet), and is also a troubleshooting step I like to use when I have no internet access, as occasionally the issue is with the DNS and not the actual connection. | Dig is a tool which lets you pull in DNS information about a particular domain. This is extremely helpful when you’re migrating websites (to see if the error is an error or the DNS not having updated yet), and is also a troubleshooting step I like to use when I have no internet access, as occasionally the issue is with the DNS and not the actual connection. | ||
Ligne 8: | Ligne 8: | ||
The @ indicates what DNS server it should use - omitting this will use your default DNS.** | The @ indicates what DNS server it should use - omitting this will use your default DNS.** | ||
+ | |||
+ | J'ai fréquemment écrit des articles sur les outils et les sites Web que je trouve utiles pour ma vie professionnelle. Cependant, il s'est passé longtemps depuis que j'ai ciblé les outils en ligne de commande (CLI), de sorte que j'ai pensé qu'il serait bien de revisiter ce sujet et de partager une liste à jour des commandes que j' | ||
+ | |||
+ | dig | ||
+ | |||
+ | Dig est un outil qui vous permet d' | ||
+ | |||
+ | dig @8.8.8.8 google.com | ||
+ | |||
+ | Le @ indique quel serveur DNS il faut utiliser, sans cela, il utilisera votre DNS par défaut. | ||
**time | **time | ||
Ligne 15: | Ligne 25: | ||
time < | time < | ||
- | Replace “< | + | Replace “< |
- | **ping | + | ping |
Most likely, everyone already knows this command - but if you’re looking for a domain’s IP, or just checking whether or not something responds, this is a tool I use every day. If Ping indicates to me that one domain isn’t responding while another is, then I’ll move onto something like downforeveryoneorjustme.com | Most likely, everyone already knows this command - but if you’re looking for a domain’s IP, or just checking whether or not something responds, this is a tool I use every day. If Ping indicates to me that one domain isn’t responding while another is, then I’ll move onto something like downforeveryoneorjustme.com | ||
+ | |||
ping www.google.com** | ping www.google.com** | ||
+ | |||
+ | time | ||
+ | |||
+ | Que vous soyez un programmeur, | ||
+ | |||
+ | time < | ||
+ | |||
+ | Remplacez < | ||
+ | |||
+ | ping | ||
+ | |||
+ | Très probablement, | ||
+ | |||
+ | ping www.google.com | ||
+ | |||
**lynx | **lynx | ||
- | Lynx is a CLI-based browser. While this isn’t a tool I use too frequently, it can be useful if you want a text-based display of a site (eg, a tutorial), or if your X Server won’t start and you need to google something without the aid of another device.** | + | Lynx is a CLI-based browser. While this isn’t a tool I use too frequently, it can be useful if you want a text-based display of a site (eg, a tutorial), or if your X Server won’t start and you need to google something without the aid of another device. |
- | **tmux | + | tmux |
- | A few months ago, I switched from two monitors to a single ultra wide display. Previously I’d dedicate a single monitor to my terminal, but nowadays I have to split my display in order to have a comfortable size browser and terminal. While I can use i3 to vertically/ | + | A few months ago, I switched from two monitors to a single ultra wide display. Previously I’d dedicate a single monitor to my terminal, but nowadays I have to split my display in order to have a comfortable size browser and terminal. While I can use i3 to vertically/ |
+ | |||
+ | lynx | ||
+ | |||
+ | Lynx est un navigateur en ligne de commande. Bien qu'il ne soit pas un outil que j' | ||
+ | |||
+ | tmux | ||
+ | |||
+ | Il y a quelques mois, je suis passé de deux moniteurs à un seul avec un affichage ultra-large. Avant, j' | ||
+ | |||
+ | **tmux -d -s “Session Name” < | ||
+ | |||
+ | The example creates a detached (hidden) session using the given command and session name. If you then want to check the output for errors (for example), you simply need to run the tmux attach command (and indicate the ID of the detached session). | ||
+ | |||
+ | grep or find | ||
+ | |||
+ | Very often, I’ll have some configuration files, or small text files with notes or fixes I’ve hastily typed up. When looking for the correct files, I almost always use grep (or find). Grep is used to check the contents of a file, while find can be used to search for files by name, type, etc. You can also combine the two commands by executing a grep search on all results returned by find (see example below).** | ||
tmux -d -s “Session Name” < | tmux -d -s “Session Name” < | ||
- | The example creates a detached | + | L' |
- | **grep or find | + | grep ou find |
- | Very often, I’ll have some configuration | + | Très souvent, j' |
+ | |||
+ | **find . -name “*.py” -exec grep -H “searchterm” {} \; | ||
+ | |||
+ | The above command searches all python files in the local directory and subfolders for the word “searchterm”. The -H flag tells grep to list the file name, so you can actually know what file it is you’re looking for. You can adjust any of the parameters as necessary. | ||
+ | |||
+ | killall | ||
+ | |||
+ | Also a command that most people probably know. It takes the name of an application, | ||
find . -name “*.py” -exec grep -H “searchterm” {} \; | find . -name “*.py” -exec grep -H “searchterm” {} \; | ||
- | The above command searches all python | + | La commande ci-dessus cherche le mot « searchterm » dans tous les fichiers |
- | **killall | + | killall |
- | Also a command that most people probably know. It takes the name of an application, and kills all instances | + | Encore une commande que tout le monde connaît probablement. Je donne le nom d' |
- | < | + | **< |
- | Not really a command, but a feature of the Linux Shell that I use all the time. It essentially says “if command1 completes successfully, | + | Not really a command, but a feature of the Linux Shell that I use all the time. It essentially says “if command1 completes successfully, |
- | **mkdir -p | + | mkdir -p |
This is simply an additional argument to mkdir, which creates any folders along the path if they don’t exist. So, if you tell it to create ~/ | This is simply an additional argument to mkdir, which creates any folders along the path if they don’t exist. So, if you tell it to create ~/ | ||
{item1, | {item1, | ||
+ | |||
+ | < | ||
+ | |||
+ | Ce n'est pas vraiment une commande, mais une fonctionnalité du Shell de Linux que j' | ||
+ | |||
+ | mkdir -p | ||
+ | |||
+ | C'est juste un argument complémentaire pour mkdir, qui crée tous les dossiers d'un chemin quand ils n' | ||
+ | |||
+ | {item1, | ||
**This is a convention that Bash and most other shells allow. It is essentially a list of options that it cycles through one by one. Combining it with the mkdir command from above, something like this is possible: | **This is a convention that Bash and most other shells allow. It is essentially a list of options that it cycles through one by one. Combining it with the mkdir command from above, something like this is possible: | ||
- | mkdir -p ~/ | + | mkdir -p ~/ |
- | **The command would create the folders 2017 and 2018 in the folder taxes. Each year would also contain the folders “receipts” and “forms”. The key thing here is to avoid using spaces around the commas. If you’re using spaces in the items, be sure to escape them or to enclose the items in quotes. | + | The command would create the folders 2017 and 2018 in the folder taxes. Each year would also contain the folders “receipts” and “forms”. The key thing here is to avoid using spaces around the commas. If you’re using spaces in the items, be sure to escape them or to enclose the items in quotes. |
I hope this list introduces you to a few new commands or shell tricks. If you know of a tool or a trick that I haven’t covered that you can’t live without, feel free to let me know about it via email. As always, I can be reached at lswest34+fcm@gmail.com.** | I hope this list introduces you to a few new commands or shell tricks. If you know of a tool or a trick that I haven’t covered that you can’t live without, feel free to let me know about it via email. As always, I can be reached at lswest34+fcm@gmail.com.** | ||
+ | |||
+ | C'est une convention que Bash et la plupart des shells autorisent. C'est en gros une liste d' | ||
+ | |||
+ | mkdir -p ~/ | ||
+ | |||
+ | La commande créera les dossiers 2017 et 2018 dans le dossier taxes. Chacune des années contiendra aussi les dossiers « receipts » et « forms ». Le point clé ici est d' | ||
+ | |||
+ | J' | ||
issue132/c_c.1525093276.txt.gz · Dernière modification : 2018/04/30 15:01 de d52fr