issue189:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue189:c_c [2023/01/29 20:30] – créée d52fr | issue189:c_c [2023/02/02 09:41] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Welcome back to another edition of FCM, may your year be filled with Ubuntu. | + | **Welcome back to another edition of FCM, may your year be filled with Ubuntu. |
Since we have been spending a lot of time in the terminal, let’s discuss some terminal tips. Bring on the disco fonts as we do some tinkering and a little deeper dive (just so you know what you are copying from some random website) for the total n00bs. | Since we have been spending a lot of time in the terminal, let’s discuss some terminal tips. Bring on the disco fonts as we do some tinkering and a little deeper dive (just so you know what you are copying from some random website) for the total n00bs. | ||
Ligne 9: | Ligne 9: | ||
Bash is everywhere, chances of you finding another shell when you connect to another machine are low. Yes, we know things like Fish exist, but bash is functional and usually ships with Ubuntu by default. | Bash is everywhere, chances of you finding another shell when you connect to another machine are low. Yes, we know things like Fish exist, but bash is functional and usually ships with Ubuntu by default. | ||
- | Bash is a collection of variables, which simply means things that can change. (Yes, sometimes it does things too, but let’s go with the flow). | + | Bash is a collection of variables, which simply means things that can change. (Yes, sometimes it does things too, but let’s go with the flow).** |
- | Here are some environment variables that an average user may encounter: | + | Bienvenue dans une nouvelle édition de FCM ; que votre année soit remplie d' |
+ | |||
+ | Puisque nous avons passé beaucoup de temps dans le terminal, discutons de quelques astuces pour celui-ci. Apportez les polices disco car nous faisons quelques bricolages et une petite plongée plus profonde (juste pour que vous sachiez ce que vous copiez d'un site Web aléatoire) pour les débutants complets. | ||
+ | |||
+ | Avant de commencer, il s'agit d'un comment et d'un pourquoi, plutôt que d'un travail de copier-coller. | ||
+ | |||
+ | OK, je plaisante - nous n' | ||
+ | |||
+ | Bash est partout, les chances que vous trouviez un autre shell lorsque vous vous connectez à une autre machine sont faibles. Oui, nous savons que des choses comme Fish existent, mais bash est fonctionnel et généralement livré avec Ubuntu par défaut. | ||
+ | |||
+ | Bash est une collection de variables, ce qui signifie simplement des choses qui peuvent changer. (Oui, parfois il fait des choses aussi, mais suivons le mouvement). | ||
+ | |||
+ | |||
+ | **Here are some environment variables that an average user may encounter: | ||
• PWD – Current working directory. | • PWD – Current working directory. | ||
• HOME – The user’s home directory location. | • HOME – The user’s home directory location. | ||
Ligne 30: | Ligne 43: | ||
printenv | less | lolcat | printenv | less | lolcat | ||
- | If you were paying attention, you would see that they are all in caps, and because they are variables, they need to be prefixed by a $ - dollar sign, when you use them in commands; for instance, if I wanted to see my LOGNAME, I’d type: echo $LOGNAME. | + | If you were paying attention, you would see that they are all in caps, and because they are variables, they need to be prefixed by a $ - dollar sign, when you use them in commands; for instance, if I wanted to see my LOGNAME, I’d type: echo $LOGNAME.** |
- | Since I always create three users, ed, edd and eddy to test things with, it can be handy for me to see which profile I am in, you may have only one, but the idea stands. | + | Voici quelques variables d' |
+ | ••PWD - Répertoire de travail actuel. | ||
+ | ••HOME - Emplacement du répertoire personnel de l' | ||
+ | ••SHELL - Shell actuel (bash, zsh, etc.). | ||
+ | ••LOGNAME - Nom de l' | ||
+ | ••UID - Identifiant unique de l' | ||
+ | ••HOSTNAME - Nom d' | ||
+ | ••MAIL - Répertoire de messagerie de l' | ||
+ | ••EDITOR - L' | ||
+ | ••TEMP - Emplacement du répertoire pour les fichiers temporaires. | ||
+ | |||
+ | Pour afficher toutes les variables d' | ||
+ | |||
+ | printenv | less | ||
+ | |||
+ | ou nous pouvons goûter à l' | ||
+ | |||
+ | printenv | less | lolcat | ||
+ | |||
+ | Si vous êtes attentif, vous verrez qu' | ||
+ | |||
+ | |||
+ | **Since I always create three users, ed, edd and eddy to test things with, it can be handy for me to see which profile I am in, you may have only one, but the idea stands. | ||
Environmental variables can be stored in a few places, like ~/.bashrc or .bash-profile or just .profile – so be sure to look at what “dotfiles” you have. Dotfiles are hidden configuration files, much like Windows .cfg or .ini files. If you use a fancy GPU-Accelerated terminal, you can set it in your $TERM variable. | Environmental variables can be stored in a few places, like ~/.bashrc or .bash-profile or just .profile – so be sure to look at what “dotfiles” you have. Dotfiles are hidden configuration files, much like Windows .cfg or .ini files. If you use a fancy GPU-Accelerated terminal, you can set it in your $TERM variable. | ||
Ligne 38: | Ligne 73: | ||
There are four commands you need to remember here, to manipulate your environment variables, namely: export, env, set, and unset | There are four commands you need to remember here, to manipulate your environment variables, namely: export, env, set, and unset | ||
- | A lot of the settings can be set from a modern terminal, and as these vary from terminal to terminal, you may need to dig some. Here we will just look at a standard terminal. Usually things like, unlimited scroll back, can now be a tick-box away, though you may want to set that in the bashrc in your /etc/ folder, but that is out of the scope of this article. | + | A lot of the settings can be set from a modern terminal, and as these vary from terminal to terminal, you may need to dig some. Here we will just look at a standard terminal. Usually things like, unlimited scroll back, can now be a tick-box away, though you may want to set that in the bashrc in your /etc/ folder, but that is out of the scope of this article. |
- | Fonts, colours, background images are just a setting away if you open your terminal preferences. As you can see here, usually on the first three tabs. A word of warning about fonts: you may see a font you like, that looks good on a web page, that looks terrible on the terminal. Always test first! | + | Puisque je crée toujours trois utilisateurs, |
+ | |||
+ | Les variables d' | ||
+ | |||
+ | Il y a quatre commandes dont vous devez vous souvenir ici, pour manipuler vos variables d' | ||
+ | |||
+ | La plupart des paramètres peuvent être définis à partir d'un terminal moderne et, comme ils varient d'un terminal à l' | ||
+ | |||
+ | **Fonts, colours, background images are just a setting away if you open your terminal preferences. As you can see here, usually on the first three tabs. A word of warning about fonts: you may see a font you like, that looks good on a web page, that looks terrible on the terminal. Always test first! | ||
Let’s talk about customising your prompt: | Let’s talk about customising your prompt: | ||
Ligne 49: | Ligne 92: | ||
TIP: If you use ‘nerd fonts’ (https:// | TIP: If you use ‘nerd fonts’ (https:// | ||
- | On that note, you can peek at your selected font’s glyphs: https:// | + | On that note, you can peek at your selected font’s glyphs: https:// |
- | We are not going to list out all the backslash-escaped special characters you need to pimp your terminal, as it would just be reinventing the wheel. We will, however, point you to a great resource: | + | Les polices, les couleurs et les images d' |
+ | |||
+ | Parlons maintenant de la personnalisation de votre invite : | ||
+ | |||
+ | L' | ||
+ | |||
+ | |||
+ | ASTUCE : Si vous utilisez des polices « nerd » (https:// | ||
+ | |||
+ | À ce propos, vous pouvez jeter un coup d'œil aux glyphes de la police que vous avez sélectionnée : https:// | ||
+ | |||
+ | |||
+ | **We are not going to list out all the backslash-escaped special characters you need to pimp your terminal, as it would just be reinventing the wheel. We will, however, point you to a great resource: | ||
Another thing to remember is that modern terminals do not only support colors, but font weights too, so you may have something in bold or dimmed. | Another thing to remember is that modern terminals do not only support colors, but font weights too, so you may have something in bold or dimmed. | ||
Ligne 61: | Ligne 116: | ||
source ~/.bashrc | source ~/.bashrc | ||
- | We hope this brings a better understanding and a desire to have your own prompt rather than something you saw on the internet that every second terminal has. | + | We hope this brings a better understanding and a desire to have your own prompt rather than something you saw on the internet that every second terminal has. ** |
+ | |||
+ | Nous n' | ||
+ | |||
+ | N' | ||
+ | |||
+ | Enfin, en tant que débutant, vous pouvez remarquer que vos modifications ne sont pas prises en compte une fois que vous les avez effectuées. Cela est dû au fait que vous devez recharger la session en cours pour appliquer les changements. | ||
+ | |||
+ | Cela se fait par : | ||
+ | |||
+ | source ~/.bashrc | ||
+ | |||
+ | Nous espérons que cela vous a permis de mieux comprendre et d' | ||
issue189/c_c.1675020602.txt.gz · Dernière modification : 2023/01/29 20:30 de d52fr