Admin's Guide

Basic tools and libraries that might be useful

apt update && apt upgrade
apt install bash-completion && . /etc/bash_completion && echo . /etc/bash_completion >> .bashrc
apt install mc net-tools apt-transport-https aptitude wget ca-certificates curl git vlan htop ssh nano sudo dirmngr software-properties-common nfs-common cifs-utils samba-client

Executing multiple commands

( https://unix.stackexchange.com/questions/37069/what-is-the-difference-between-and-when-chaining-commands )

cmd1; cmd2 cmd1 && cmd2

echo

echo #CoChcemeVlozit > soubor.txt
  • přepíše soubor a vloží pouze #
echo #CoChcemeVlozit >> soubor.txt
  • vloží # na konec souboru

uzitecne prikazy

Zobraz uživatele

cat /etc/passwd

Zobraz pouze uživatele, bez dalších informací (jako UID apod.)

awk -F':' '{ print $1}' /etc/passwd

To check free space | https://shapeshed.com/unix-du/

du -chs /var/www
DATABASE
show databases;
use nameofdatabase;
show tables;

SSH

Vytvoření souboru pro klíče, které budou povoleny

mkdir .ssh && nano .ssh/authorized_keys

Obecně: ssh-rsa KLIC jmeno@prijmeni

ssh-rsa 1234567890AbCdEf jan@stepanek
ssh-ed25519 aBcDeF1234567890 stepi@homepc