From 102082a98e6476171031d7b19069a56ad801bc07 Mon Sep 17 00:00:00 2001 From: ptux Date: Thu, 8 Sep 2022 01:00:08 +0900 Subject: [PATCH] add ja day17 --- ja/Days/day17.md | 60 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ja/Days/day17.md b/ja/Days/day17.md index 7996aee..0703cdb 100644 --- a/ja/Days/day17.md +++ b/ja/Days/day17.md @@ -1,85 +1,85 @@ --- -title: '#90DaysOfDevOps - Text Editors - nano vs vim - Day 17' +title: '#90DaysOfDevOps - テキストエディター - nano vs vim - 17日目' published: false -description: 90DaysOfDevOps - Text Editors - nano vs vim +description: 90DaysOfDevOps - テキストエディター - nano vs vim tags: "devops, 90daysofdevops, learning" cover_image: null canonical_url: null id: 1048703 --- -## Text Editors - nano vs vim +## テキストエディター - nano vs vim -The majority of your Linux systems are going to be servers and these are not going to have a GUI. I also mentioned in the last session that Linux is mostly made up of configuration files, to make changes you are going to need to be able to edit those configuration files to change anything on the system. +Linuxシステムの大半はサーバーであり、GUIを持たないでしょう。前回のセッションで、Linuxはほとんど設定ファイルで構成されており、システム上の何かを変更するためには、設定ファイルを編集できる必要があることを述べました。 -There are lots of options out there but I think we should cover probably the two most common terminal text editors. I have used both of these editors and for me, I find `nano` the easy button when it comes to quick changes but `vim` has such a broad set of capabilities. +たくさんのオプションがありますが、おそらく最も一般的な2つのターミナル・テキストエディタをカバーする必要があると思います。私はこの2つのエディタを使ったことがありますが、素早い変更には `nano` が簡単で、`vim` は非常に幅広い機能を持っています。 ### nano -- Not available on every system. -- Great for getting started. +- すべてのシステムで利用できるわけではありません。 +- 使い始めに最適です。 -If you run `nano 90DaysOfDevOps.txt` we will create a new file with nothing in, from here we can add our text and we have our instructions below for what we want to do with that file. +`nano 90DaysOfDevOps.txt` を実行すると、何も入っていない新しいファイルが作成されます。ここからテキストを追加して、そのファイルに対して何をしたいかを以下に説明します。 ![](Images/Day17_Linux1.png) -We can now use `control x + enter` and then run `ls` you can now see our new text file. +次に、`control x + enter`を使用して、`ls`を実行すると、新しいテキストファイルが表示されます。 ![](Images/Day17_Linux2.png) -We can now run `cat` against that file to read our file. We can then use that same `nano 90DaysOfDevOps.txt` to add additional text or modify your file. +これで、そのファイルに対して `cat` を実行し、ファイルを読み込むことができます。それから同じように `nano 90DaysOfDevOps.txt` を使って、テキストを追加したりファイルを修正したりすることができます。 -For me, nano is super easy when it comes to getting small changes done on configuration files. +私にとっては、設定ファイルにちょっとした変更を加えるのに、nanoはとても簡単です。 -### vim +### vim -Possibly the most common text editor around? A sibling of the UNIX text editor vi from 1976 we get a lot of functionality with vim. +最も一般的なテキストエディタと言えるかもしれません。1976年に発売されたUNIXのテキストエディタviの兄弟で、vimで多くの機能を手に入れることができます。 -- Pretty much supported on every single Linux distribution. -- Incredibly powerful! You can likely find a full 7-hour course just covering vim. +- すべてのLinuxディストリビューションでサポートされています。 +- 信じられないほど強力です。7時間コースでvimを学ぶことができます。 -We can jump into vim with the `vim` command or if we want to edit our new txt file we could run `vim 90DaysOfDevOps.txt` but you are going to first see the lack of help menus at the bottom. +`vim` コマンドで vim に飛び込んだり、新しい txt ファイルを編集したい場合は `vim 90DaysOfDevOps.txt` を実行しますが、まず最初に下の方にあるヘルプメニューがないことに気がつくと思います。 -The first question might be "How do I exit vim?" that is going to be `escape` and if we have not made any changes then it will be `:q` +最初の質問は "How do I exit vim?" で、これは `escape` で、もし何も変更していなければ `:q` となります。 ![](Images/Day17_Linux3.png) -You start in `normal` mode, there are other modes `command, normal, visual, insert` , if we want to add the text we will need to switch from `normal` to `insert` we need to press `i` if you have added some text and would like to save these changes then you would hit escape and then `:wq` +テキストを追加したい場合は、`normal`から`insert`に切り替える必要があります。テキストを追加して、その変更を保存したい場合は、escapeキーを押して、次に `:wq` を押します。 ![](Images/Day17_Linux4.png) ![](Images/Day17_Linux5.png) -You can confirm this with the `cat` command to check you have saved those changes. +この確認は `cat` コマンドで変更内容が保存されているかどうかを確認します。 -There is some cool fast functionality with vim that allows you to do menial tasks very quickly if you know the shortcuts which is a lecture in itself. Let's say we have added a list of repeated words and we now need to change that, maybe it's a configuration file and we repeat a network name and now this has changed and we quickly want to change this. I am using the word day for this example. +vim にはクールな高速機能があり、ショートカットを知っていれば、ちょっとした作業を非常に素早く行うことができます。例えば、繰り返される単語のリストを追加して、それを変更する必要があるとします。例えば、設定ファイルで、ネットワーク名を繰り返していますが、これが変更されたので、すぐにこれを変更したいとします。この例では、dayという単語を使っています。 ![](Images/Day17_Linux6.png) -Now we want to replace that word with 90DaysOfDevOps, we can do this by hitting `esc` and typing `:%s/Day/90DaysOfDevOps` +この単語を 90DaysOfDevOps に置き換えるには、`esc` を押して `:%s/Day/90DaysOfDevOps` と入力してください。 ![](Images/Day17_Linux7.png) -The outcome when you hit enter is that the word day is then replaced with 90DaysOfDevOps. +エンターキーを押すと、dayという単語が90DaysOfDevOpsに置き換わります。 ![](Images/Day17_Linux8.png) -Copy and Paste was a big eye-opener for me. Copy is not copy it is yank. we can copy using `yy` on our keyboard in normal mode. `p` paste on the same line, `P` paste on a new line. +コピー&ペーストは、私にとって大きな目から鱗でした。キーボードの「yy」を使ってコピーすることができます。同じ行に`p`ペースト、新しい行に`p`ペースト。 -You can also delete these lines by choosing the number of lines you wish to delete followed by `dd` +また、削除したい行数を選んでから`dd`を押すと、その行を削除することができます。 -There is also likely a time you will need to search a file, now we can use `grep` as mentioned in a previous session but we can also use vim. we can use `/word` and this will find the first match, to navigate through to the next you will use the `n` key and so on. +以前のセッションで紹介したように `grep` を使うこともできますが、vim を使うこともできます。 -For vim this is not even touching the surface, the biggest advice I can give is to get hands-on and use vim wherever possible. +vimの場合、これは表面的なことにさえ触れていません。私ができる最大のアドバイスは、可能な限り手を動かしてvimを使用することです。 -A common interview question is what is your favourite text editor in Linux and I would make sure you have at least this knowledge of both so you can answer, it is fine to say nano because it's simple. At least you show competence in understanding what a text editor is. But get hands-on with them to be more proficient. +よくある面接の質問で、Linuxで好きなテキストエディタは何かというのがありますが、私は少なくともこの2つの知識があることを確認し、答えられるようにします。少なくとも、テキストエディタが何であるかを理解する能力があることを示すことができます。しかし、より熟練するために、それらと手をつないでください。 -Another pointer to navigate around in vim we can use `H,J,K,L` as well as our arrow keys. +もう一つのポインターは、vim では矢印キーの他に `H,J,K,L` を使って移動することができます。 -## Resources +## リソース - [Vim in 100 Seconds](https://www.youtube.com/watch?v=-txKSRn0qeA) - [Vim tutorial](https://www.youtube.com/watch?v=IiwGbcd8S7I) - [Learn the Linux Fundamentals - Part 1](https://www.youtube.com/watch?v=kPylihJRG70) - [Linux for hackers (don't worry you don't need to be a hacker!)](https://www.youtube.com/watch?v=VbEx7B_PTOE) -See you on [Day18](day18.md) +[Day18](day18.md)でお会いしましょう。