# Använda OS - Att använda ett OS, såsom Linux
```
icon: 🐧
author: krm
created: 2021-01-09
image: /image/courses/penguin.png
```

Att använda OS. Framför allt Linux.

- [Övningen "Fun with files"](https://htsit.se/f/fun-with-files.zip)

# 0. Prov

- [Frågor om ett filsystem](https://docs.google.com/document/d/1Yt9AkNhP70-56UJpQDmp5WsH0nMLpqwYs3GNnpr37KQ/edit?tab=t.0)
- [Bland frågorna](https://docs.google.com/document/d/1k_ZjU0ErZ9yqzgdvFCOP12aQtZTsem7tDhuPkvzzGis/edit?tab=t.0)
- [Diverse frågor](https://docs.google.com/document/d/1lEJqvHapNyrZck-71gZ1fZ8XDdxYvvEKRdapZyWJhkI/edit?tab=t.0)


# 1. Introduktion till terminal - tty, bash, ssh

- 📄 [Om terminal](https://bit.ly/3yGbSSl)
- tty
- terminal
- bash
- små program
- 🔗 [https://bellard.org/jslinux/](https://bellard.org/jslinux/)

# 2. Läsa filer - ls, echo, cat, head, tail, more

- ⚙️ [dir-1.zip](http://htsit.se/f/dir-1.zip) - Exempel med många olika filer.
- 📄 [Echo, cat, head, tail och more](https://docs.google.com/document/d/1F0PV-Pf7JspDl0b33DFiofRfMaqxjKqzVVN5xClC_lQ/edit?usp=sharing)
- Att [navigera ett filsystem](/a/computer/terminal/Sections/using-filesystem.sv.html)
- comandon
- argument
- flagor
- tab
- pil-up
- ls
- echo
- cat
- more/less
- tail
- head

# 3. Hantera filsystem - cd, mkdir, pwd, mv, cp, rm, tree

- 📄 [ls,cd,mv och mkdir](https://docs.google.com/document/d/1z3dct1EcNbTxrKX5d5kwdskOegLnwvWQtT4b8qIunBo/edit?usp=sharing)
- 📄 [cp-mv-ln-rm](https://docs.google.com/document/d/1BSvDsJCM4YeB8O3AgVl9JwiIx8j5VUIyZoMaLTMYDOE/edit?usp=sharing)
- Att [förändra filsystem](/a/computer/terminal/Sections/changing-filesystem.sv.html)
- cd
- mkdir
- pwd
- mv
- cp
- rm
- _sudo apt install tree_
- tree

# 4. Pipes - grep med mera

- 📄 [pipes](https://docs.google.com/document/d/1Lc4hVz3N4X8sv-pv1w4ijIYHtZXJrDODArsvVgF44zY/edit?usp=sharing)
- 📄 [Alternativ förklaring](https://linuxhandbook.com/redirection-linux/)
- Att [använda rör](/a/computer/terminal/Sections/pipes.sv.html)

# 5. Hitta information - find, man och olika webbsidor.

- 📄 [find-grep](https://docs.google.com/document/d/16hgwIFjrGXb6DHIUUMKRwUuagy2RAxN0axa6ZN1E-wk/edit?usp=sharing)
- find
- grep
- _sudo apt install fzf_
- 🔗 [fzf](https://github.com/junegunn/fzf)
- /a/computer/terminal/Sections/manage-files.sv.html

# 6. Hitta information om komandon

- Flagor: help, h, version
- man
- 🔗 [man sidor på internet](https://linux.die.net/man/)
- 🔗 [superuser](https://superuser.com/) - som stackoverflow men för system
  administration.
- 🔗 [linuxquestion](https://www.linuxquestions.org/) - forum för linux frågor,
  finns många flera.
- git issues, bloggar
- Testa alla svar på ditt system!

# 7. Editorer - vim, emacs, nano, micro

- Att [använda editor](/a/computer/terminal/Sections/editors.sv.html)
- Funktion
  - Editors
  - IDE - VS code, Eclipse
- User interfase
  - Grafiskt - Geany
  - Text - vim, emacs, nano, micro
  - Command line - sed
  - Web - Code mirror
- 🔗 [vim](https://www.vim.org/)
- 🎥 [Hur vim kan göra livet enklare](https://www.youtube.com/watch?v=NzD2UdQl5Gc)
- 🔗 [emacs](https://www.gnu.org/software/emacs/)
- 🔗 [nano](https://www.nano-editor.org/)
- 🔗 [micro](https://micro-editor.github.io/)
- 🔗 [sed](https://www.geeksforgeeks.org/sed-command-in-linux-unix-with-examples/)

# 8. Mineshantering - du, df, free

- 📄 [du-df-free](https://docs.google.com/document/d/1AgjiQMmIfuyGNhqfYXkz-qVzB7nbDzwbKtl1ILM-LhA/edit?usp=sharing)
- _find ./Downloads/ -type f -size +100M_

# 9. Processhantering - kill, ps och htop

- 📄 [kill-ps-htop](https://docs.google.com/document/d/1upg478W0TYG6OrG2rJ8Vh4GZKM0VOs9oHlIiboZ-pmQ/edit?usp=sharing)
- Ctrl-c - avbryter en process.
- Ctrl-z - Sparar en process i bakgrunden.
- [Ctrl comands for process](https://prateeksrivastav598.medium.com/understanding-ctrl-z-and-ctrl-c-in-the-linux-terminal-c28bd1e00dbe)
- [Linux vs Windows process hantering. OBS! Våldsam!](https://htsit.se/f/linux-vs-mine.jpg)

# 10. Hantera filer - ln, curl, tar, zip, gpg

- Att [hantera filer](/a/computer/terminal/Sections/manage-files.sv.html)
- ln
- curl - curl -LO
- tar
- zip
- gpg
- [Film opm gpg](https://www.youtube.com/watch?v=DMGIlj7u7Eo)

# 11. Hantera rättigheter i systemet - chmod, chown, chgrp

- 📄 [Om rättigheter i linux](https://docs.google.com/document/d/1UEhfBLNEH7IyJG9PgAv_9AmqjCWo6uRadz55FsDXrJE/edit?usp=sharing)

# 12. Installation av programvara - apt, make med mera.

- sudo apt install
- Installera programmer **sl**
- Installera med **./configure;make;make install**
- Testa med [cmatrix](https://github.com/abishekvashok/cmatrix)
- Alternativ:
- 🔗 [AppImage](https://appimage.org/)
- 🔗 [Flatpack](https://flatpak.org/)
- 🔗 [Snap](https://snapcraft.io/)

# 13. Konfigurera ditt system - bashrc, alias samt hantera använder

- sudo
- 📄 [Om variabler](https://docs.google.com/document/d/1atfVTC3Yrnyd9NwN06a0AP6NG9W63wEUtMj4HUo2kmQ/edit?usp=sharing)
- 📄 [Alias](https://docs.google.com/document/d/1tOPKq1k3bMXC74MmO3WwvmJ0f5eb-kRxo8hibiX5_Fs/edit?usp=sharing)
- 🔗 [adduser](https://linuxcommandlibrary.com/man/adduser)
- su

# 14. Miljö variabler.

- 📄 [Om script](https://docs.google.com/document/d/1mzC4kjfAOAQMT2UQrm4BgMhQyr7OmR1mjc41yqhM4F0/edit?usp=sharing)

# 15. Grundläggande bash script

- 📄 [Om script](https://docs.google.com/document/d/1mzC4kjfAOAQMT2UQrm4BgMhQyr7OmR1mjc41yqhM4F0/edit?usp=sharing)

# Fler kommandon och tips

- history
- 📄 [Tips](https://docs.google.com/document/d/1I7T7TQbr5fhEMLBQRPZBrzIIb2x_eMb36vro0f9ckms/edit?usp=sharing)

# Användning av ssh

- Det vanligaste programmet.

# Andra Linux Skall

- Fish
- ash

## PowerShell

- För windows

