# Linux
- [Distros](#distros)
- [Graphical Environment](#graphical-environment)
- [Display Managers](#display-managers)
- [Graphical Applications](#graphical-applications)
- [Gnome Files/Nautilus](#gnome-filesnautilus)
- [Commands and Utilities](#commands-and-utilities)
- [Navigation and File Management](#navigation-and-file-management)
- [Archiving and Compression](#archiving-and-compression)
- [tar](#tar)
- [Users, Groups, and File permissions](#users-groups-and-file-permissions)
- [Network Configuration](#network-configuration)
- [hostname / hostnamectl](#hostname--hostnamectl)
- [static ip](#static-ip)
- [System Monitoring Utilities](#system-monitoring-utilities)
- [btop](#btop)
- [Storage](#storage)
- [hdparm](#hdparm)
- [Network Storage](#network-storage)
- [smb](#smb)
- [CLI Diagnostics and System Topology](#cli-diagnostics-and-system-topology)
- [lspci](#lspci)
## Distros
- [Debian](./docs/distros/debian.md)
- [Fedora](./docs/distros/fedora.md)
- [Proxmox pve](https://git.limbosolutions.com/kb/proxmox)
## Graphical Environment
### Display Managers
🎛️ A display manager is the graphical login screen you see when you boot your system.
Main job: It handles user sessions — letting you log in, choose a user, select a desktop environment, and start the graphical session.
Examples:
- LightDM (lightweight and flexible)
- GDM (GNOME Display Manager)
- SDDM (used by KDE)
- LXDM (used by LXDE)
### Graphical Applications
#### Gnome Files/Nautilus
## Commands and Utilities
### Navigation and File Management
📁 List information about the FILEs (the current directory by default).
```bash
#order by date
ls -t
#order by date reverse
ls -r
# list all
ls -lah
```
### Archiving and Compression
#### tar
**📦 tar** is a command-line utility in Unix/Linux used to archive multiple files into a single file, often for backup, compression, or distribution. The name stands for “tape archive”, originally designed for writing data to magnetic tape.
**Flags:**
- -c Create a new archive
- -v Verbose — show progress while archiving
- -p Preserve permissions — keeps original file permissions
- -z Compress using gzip
- -f File name — expects a filename right after this flag
- -I compressor
- -p preserve file permissions
```bash
tar -cvf --exclude='.cache' --exclude='Cache' --exclude='.cache' --exclude='.tmp' --exclude='tmp' /tmp/filename.tar.gz \
$source_path_to_tar
#(Parallel Implementation of Gzip) to to create a fast, compressed archive
tar -I pigz -cvf - /fileserver/media/music/*
# splits the output into 8 GB chunks,
tar -I pigz -cvf - /sourcefolder/* | split --bytes=8GB - /tmp/file.tar.gz
```## Visual Linux
🖥️
### Display Manager (DM)
🎛️
What it is: A display manager is the graphical login screen you see when you boot your system.
Main job: It handles user sessions — letting you log in, choose a user, select a desktop environment, and start the graphical session.
Examples:
- LightDM (lightweight and flexible)
- GDM (GNOME Display Manager)
- SDDM (used by KDE)
- LXDM (used by LXDE)
### Graphical Apps
🧰
## Gnome Files/Nautilus
```bash
tar -cvpzf "/vault/.backups/devices/homeserver/tar/backup_$(date +"%Y%m%d%H%M%S").tar.gz \
--exclude=/proc \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/dev \
--exclude=/sys \
--exclude=/run \
--exclude=/media \
--one-file-system \
/
```
### Users, Groups, and File permissions
```bash
#create
useradd USERNAME
# create with home directory
useradd -m USERNAME
#remove
userdel USERNAME
#useradd -r USERNAME
passwd
passwd USERNAME
groups
groupadd GROUPNAME
groups USERNAME
usermod -a -G GROUPNAME USERNAME
```
### Network Configuration
#### hostname / hostnamectl
``` bash
#get hostname
hostname
#set hostname
hostnamectl## Visual Linux
🖥️
### Display Manager (DM)
🎛️
What it is: A display manager is the graphical login screen you see when you boot your system.
Main job: It handles user sessions — letting you log in, choose a user, select a desktop environment, and start the graphical session.
Examples:
- LightDM (lightweight and flexible)
- GDM (GNOME Display Manager)
- SDDM (used by KDE)
- LXDM (used by LXDE)
### Graphical Apps
🧰
## Gnome Files/Nautilus
sudo nano /etc/hostname
#alterar o nome
sudo nano /etc/hosts
#alterar o nome
Static IP
A configuração para um ip estático poderá ser um pouco diferente de distribuição para distribuição mas a lógica é similar
```
#### static ip
Debian
sudo nano /etc/network/interfaces
Exemplo de configuração
``` bash
# neste exemplo de configuração a place de rede tem o nome enxd0374555c1f8
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enxd0374555c1f8
iface enxd0374555c1f8 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 89.207.128.252 89.207.130.252
Reiniciar configuração sem reboot de computador
```
``` bash
# restart configuration servicce
sudo /etc/init.d/networking restart
```
### System Monitoring Utilities
#### btop
**Install Debian & Ubuntu:**
```bash
apt update && apt install btop -y
```
### Storage
#### hdparm
hdparm is a powerful command-line utility in Linux used to view and configure low-level parameters of SATA, IDE, and some USB hard drives. It’s commonly used for performance tuning, diagnostics, and power management.
``` bash
sudo apt install hdparm
sudo hdparm -Tt /dev/sdc
```
``` bash
df
df -h
du -h --max-depth=1
```
### Network Storage
#### smb
smb share
Create credentials file
``` bash
#/home/mf/.credentials/smb:mf@nas.lan
username=shareuser
password=sharepassword
domain=domain_or_workgroupname
```
Secure credentials file permission
``` bash
chmod 0600 /home/mf/.credentials/smb:mf@nas.lan
```
Add line
``` bash
#/etc/fstab
//nas.lan/homes /mnt/smb-share:mf@nas.lan,share=homes cifs credentials=/home/mf/.credentials/smb:mf@nas.lan,uid=1000,gid=1000,nofail 0 0
```
### CLI Diagnostics and System Topology
#### lspci
Displays information about each PCI bus on your system. This includes information about the devices connected to the PCI subsystem.
lspci [options]
| Option | Description |
| -------- | ------------- |
| -v | Verbose |
``` bash
lspci -v
```