issue179:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue179:c_c [2022/03/27 14:54] – créée auntiee | issue179:c_c [2022/03/30 17:10] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Most of us don’t think twice when typing at a terminal, it’s just there. What is actually happening is that you are typing commands into a shell that is interpreting your commands. By default, Ubuntu ships with bash, but you can install another if you like. I will focus on bash. The reason: if you ever get to use servers or containers on the internet, chances are good that it is bash. | + | **Most of us don’t think twice when typing at a terminal, it’s just there. What is actually happening is that you are typing commands into a shell that is interpreting your commands. By default, Ubuntu ships with bash, but you can install another if you like. I will focus on bash. The reason: if you ever get to use servers or containers on the internet, chances are good that it is bash. ** |
- | Back in the day, we did not have Whatscrap or Telegram so we would use Screen to chat with each other; the session stays open when you connect from somewhere else. This was great for remote support, as you could be at a distant site and chat with the programmer or database admin whilst fixing the issue. (A sort of poor man’s direct chat). This is sometimes what you see in movies, when there is typing on the terminal without interaction. Wake up Neo... Screen ships with Ubuntu, | + | La plupart d' |
- | I like to think of Screen | + | **Back in the day, we did not have Whatscrap or Telegram so we would use Screen |
- | You can move between these sessions (or tabs if you want to think of it that way: ‘CTRL+a’ and ‘w’ to see them from within a session) with keyboard shortcuts. You can even name sessions so that managing them is easier. I say, whatever works for you. The reason I think of it this way, is that you can have multiple | + | I like to think of Screen like you do a normal modern web browser, only with tabs you cannot |
- | So why would you want to use something like Screen? Even in our 99.9% uptime world, the connection from one place to another is not. Running scripts on a remote host that take a lot of time to parse data, for instance, may not complete, and you will have to restart them. This is a pain in the butt. This is where Screen | + | Autrefois, nous n’avions pas Whatscrap ou Telegram et nous utilisions |
- | Since the manpage is longer than the list of excuses politicians use, there is a quicker way to get help. Whilst you have an attached screen, press ‘CTRL+a’ and ‘?’. This will bring up what you need. Go ahead and try that now. | + | J’aime penser à Screen comme on pense à un navigateur Web moderne et normal, mais avec des onglets invisibles. Voyez-vous, des sessions multiples sont possibles dans Screen. |
+ | |||
+ | **You can move between these sessions (or tabs if you want to think of it that way: ‘CTRL+a’ and ‘w’ to see them from within a session) with keyboard shortcuts. You can even name sessions so that managing them is easier. I say, whatever works for you. The reason I think of it this way, is that you can have multiple “tabs” open in a screen session (pressing ‘CTRL+a’ and ‘c’ to open one). | ||
+ | |||
+ | So why would you want to use something like Screen? Even in our 99.9% uptime world, the connection from one place to another is not. Running scripts on a remote host that take a lot of time to parse data, for instance, may not complete, and you will have to restart them. This is a pain in the butt. This is where Screen comes in, allowing you to instantly reconnect to your session where the script may be running, even from a different PC!** | ||
+ | |||
+ | Vous pouvez vous déplacer entre les sessions (ou onglets, si vous voulez y penser ainsi) : « CTRL+a » et « w » pour les voir de l’intérieur d’une session) avec des raccourcis clavier. Vous pouvez même nommer les sessions pour rendre leur gestion plus facile. Moi, je dis faites ce qui vous plaît. La raison pour laquelle j’y pense ainsi, c’est que de multiples « onglets » peuvent être ouverts dans une session de screen (appuyez sur « CTRL+a » et « c » pour en ouvrir un. | ||
+ | |||
+ | Mais pourquoi voudriez-vous utiliser quelque chose comme Screen ? Même dans notre monde connecté à 99,9 % du temps, la connexion d’un endroit à un autre n’est pas simple. Lancer, sur un hôte à distance, des scripts qui nécessitent beaucoup de temps pour analyser les données, par exemple, peut ne pas aller au bout et vous devrez les redémarrer. Ça fait chier… C’est là où Screen entre en scène : il vous permet de vous reconnecter instantanément à la session où le script s’exécute, | ||
+ | |||
+ | **Since the manpage is longer than the list of excuses politicians use, there is a quicker way to get help. Whilst you have an attached screen, press ‘CTRL+a’ and ‘?’. This will bring up what you need. Go ahead and try that now. | ||
Caveat: Screen does not support all the “advanced” terminal bling that you may have become accustomed to, so fancy terminal prompts may disappear. | Caveat: Screen does not support all the “advanced” terminal bling that you may have become accustomed to, so fancy terminal prompts may disappear. | ||
Ligne 15: | Ligne 25: | ||
The power of Screen lies in these shortcuts. If you have a few open, pressing ‘CTRL+a’ and ‘a’ is really quick (pressing ‘a’ twice whilst ‘CTRL’ is held down, will tab you to the next session or tab). Let’s assume you need to do something else quickly; while your scripts are running, you can detach from the session with ‘CTRL+a’ and ‘d’. To reattach is as simple as typing ‘screen -r’ or ‘screen -x’ and you will be back where you left off. | The power of Screen lies in these shortcuts. If you have a few open, pressing ‘CTRL+a’ and ‘a’ is really quick (pressing ‘a’ twice whilst ‘CTRL’ is held down, will tab you to the next session or tab). Let’s assume you need to do something else quickly; while your scripts are running, you can detach from the session with ‘CTRL+a’ and ‘d’. To reattach is as simple as typing ‘screen -r’ or ‘screen -x’ and you will be back where you left off. | ||
- | Now for some practical learning; open a terminal emulator and fire up Screen. Open top or htop, now press ‘CTRL+a’ and ‘c’ to open another tab, and type ‘ls -la / -R’ so that it takes a while to complete. Type ‘CTRL+a’ and ‘n’ or ‘p’ to switch between the two. Open another, now type ‘CTRL+a’ and ‘w’ to see the current tabs or sessions. Switch to one and type exit. Now type ‘CTRL+a’ and ‘w’ again. What do you see? | + | Now for some practical learning; open a terminal emulator and fire up Screen. Open top or htop, now press ‘CTRL+a’ and ‘c’ to open another tab, and type ‘ls -la / -R’ so that it takes a while to complete. Type ‘CTRL+a’ and ‘n’ or ‘p’ to switch between the two. Open another, now type ‘CTRL+a’ and ‘w’ to see the current tabs or sessions. Switch to one and type exit. Now type ‘CTRL+a’ and ‘w’ again. What do you see? ** |
- | These are the very basic navigation commands of Screen. The reason I typed the commands as ‘CTRL+a’ and ‘a’, not CTRL+a+a is that I want you to get used to understanding that the first part is an activation, before the next key. It is to not lead you astray, rather to get muscle memory going. A lot of the time, you will find that holding down CTRL and pressing the next two keys is the same as not holding down CTRL with the last keypress, but I have noticed some differences here in bash and other shells and terminal emulators and operating systems. Some commands are different, like the vertical split. Here you have to type ‘CTRL+a’ then release and press ‘SHIFT+|’ (pipe). Now to switch, we need to activate with ‘CTRL+a’ then press ‘Tab’. The same goes for the horizontal split, ‘CTRL+a’ and ‘SHIFT+s” – so learn when to remove your finger from the ‘CTRL’ key. | + | Puisque la page man est plus longue que la liste des excuses utilisées par les hommes ou femmes politiques, il y a une façon plus rapide d’obtenir de l’aide. Quand vous avez un screen attaché, appuyez sur « CTRL+a » et « ? » et ce dont vous avez besoin s’affichera. Allez-y, essayez-le maintenant. |
- | At any time, you can also have another session by typing | + | Mise en garde : |
- | I did tell you that you can name your Screen sessions; simply type: screen -S < | + | La puissance de Screen est dans ces raccourcis. Si plusieurs onglets sont ouverts, un appui sur « CTRL+a » et « a » est vraiment rapide (appuyer deux fois sur « a » pendant « CTRL » est enfoncé, vous amènera à la session, ou onglet, suivante). Supposons que vous devez faire quelque chose d’autre rapidement ; |
+ | |||
+ | Maintenant un peu d' | ||
+ | |||
+ | **These are the very basic navigation commands of Screen. The reason I typed the commands as ‘CTRL+a’ and ‘a’, not CTRL+a+a is that I want you to get used to understanding that the first part is an activation, before the next key. It is to not lead you astray, rather to get muscle memory going. A lot of the time, you will find that holding down CTRL and pressing the next two keys is the same as not holding down CTRL with the last keypress, but I have noticed some differences here in bash and other shells and terminal emulators and operating systems. Some commands are different, like the vertical split. Here you have to type ‘CTRL+a’ then release and press ‘SHIFT+|’ (pipe). Now to switch, we need to activate with ‘CTRL+a’ then press ‘Tab’. The same goes for the horizontal split, ‘CTRL+a’ and ‘SHIFT+s” – so learn when to remove your finger from the ‘CTRL’ key. | ||
+ | |||
+ | At any time, you can also have another session by typing Screen again, even if another terminal emulator is on your same machine, and if you go look at your list; they should be there. This comes in handy when you need to keep things apart, working with one group in one terminal and another group in a separate terminal. However, it does not stop you from connecting to the “other side” so-to-speak, | ||
+ | |||
+ | Ce sont les très basiques commandes de navigation dans Screen. La raison pour laquelle j'ai tapé les commandes comme « CTRL+a » et « a » et NON CTRL+a+a est que je veux que vous vous habituiez à comprendre que la première partie est une activation, avant la touche suivante. Il ne s'agit pas de vous induire en erreur, mais de faire démarrer votre mémoire musculaire. La plupart du temps, vous trouverez que maintenir l' | ||
+ | |||
+ | À n’importe quel moment vous pouvez également avoir une autre session en tapant Screen à nouveau, même si un autre émulateur de terminal est sur votre même machine et, si vous allez regarder votre liste, elles devraient y être. Cela est utile quand vous avez besoin de séparer des choses, travailler avec un groupe dans un terminal et avec un autre groupe dans un autre terminal. Cependant, cela ne vous empêche pas de vous connecter à « l’autre côté », pour ainsi dire, et il faut faire attention. | ||
+ | |||
+ | **I did tell you that you can name your Screen sessions; simply type: screen -S < | ||
If you have opened more than 2 or three Screen sessions, you can also use CTRL+a and SHIFT+” (just one double-quote) to list them. If you do not get it right the first time, try again, I don’t know why, but my students used to struggle with this one. | If you have opened more than 2 or three Screen sessions, you can also use CTRL+a and SHIFT+” (just one double-quote) to list them. If you do not get it right the first time, try again, I don’t know why, but my students used to struggle with this one. | ||
- | For those a little more advanced than absolute beginners, there are some customizations in ~/ | + | For those a little more advanced than absolute beginners, there are some customizations in ~/ |
+ | |||
+ | Je vous ai bien dit que vous pouvez donner un nom à vos sessions de Screen. Il suffit de taper screen -S <nom> et la prochaine fois que vous faites une commande -ls dans Screen, vous devrez voir le nom au lieu du numéro. | ||
+ | |||
+ | Si vous avez ouvert plus de deux ou trois sessions de Screen vous pouvez également utiliser CTRL+a et MAJ+" | ||
+ | |||
+ | Pour ceux qui sont un peu plus avancés que des débutants complets, il y a quelques personnalisations dans ~/ | ||
issue179/c_c.1648385657.txt.gz · Dernière modification : 2022/03/27 14:54 de auntiee