Commit cb8549d9 authored by bobloblaw's avatar bobloblaw
Browse files

Updates basics_of_linux.md

Auto commit by GitBook Editor
parent 8b520d54
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
    * [Linux](linux.md)
        * [Basics of linux](basics_of_linux.md)
        * [Bash-scripting](bash-scripting.md)
        * Vim
    * Windows
        * [Basics of windows](basics_of_windows.md)
        * [Powershell](powershell.md)
+0 −40
Original line number Diff line number Diff line
@@ -304,46 +304,6 @@ awk 'BEGIN{printf "IP-address \tPort\n"} /nop/ {print $3} END {printf "End of th

Here we are printing IP-address    PORT to the first line of the file.

## Vim

### Search

In command-mode:

```
/
```

### Show line-number

```
:set number
:set nonumber
```

### Go to line

```
:100G
:100gg
```

### To to last line

```
G
```

#### Add character to the beginning of each line

I have needed to do this several time when I write batch-scripts that I want to copy-paste into a windows-machine using echo. Instead of having to add a `echo on each line I want to do it all at onece.`

Here is how you do it

Use Ctrl + V to enter visual block mode.  
Move Up / Down to select the columns of text in the lines you want to comment.  
Then hit Shift + i and type the text you want to insert.  
Then hit Esc , wait 1 second and the inserted text will appear on every line.

## 4. User management