Linux debian 10 (buster)
-
cd
change directory
-
ls
show folder
ls -a
show hidden files
ls -l
show detailed list
du
used disc spac by folder
sudo du -xhd1 / 2>/dev/null | sort -h
mkdir
make directory
rm
remove
rm -r
remove recursive
rmdir
remove directory
arp
connected machines in LAN
SSH
ssh USERNAME@IP
Raspberry Pi Model
cat /proc/device-tree/model
find MAC Address
ip link
Checking Raspberry Pi Revision Number & Board Version
pinout
cat /proc/cpuinfo
cat /proc/device-tree/model
cat /etc/os-release
hostname
sudo hostnamectl set-hostname [NEWHOSTNAME]
sudo nano /etc/hosts
edit
127.0.1.1 [NEWHOSTNAME]
VideoCore GPU
vcgencmd measure_temp
| Bit |
Hexadecimal value |
Meaning |
0 |
0x1
|
Undervoltage detected |
1 |
0x2
|
Arm frequency capped |
2 |
0x4
|
Currently throttled |
3 |
0x8
|
Soft temperature limit active |
16 |
0x10000
|
Undervoltage has occurred |
17 |
0x20000
|
Arm frequency capping has occurred |
18 |
0x40000
|
Throttling has occurred |
19 |
0x80000
|
Soft temperature limit has occurred |
find
find a direktory: find / -name "[directory]"
Getting a detailed list of files/dirs: find / -name "apt" -ls
chmod
“chmod 777” means making the file readable, writable and executable by everyone.
shell scripts executable
help: wiki.ubuntuusers.de
file starts with:
#!/bin/bash
permission to execute:
sudo chmod +x [FILENAME].sh
run:
./[FILENAME].sh
cp
copy
scp
scp -rp sourcedirectory user@dest:/path
ssl
ssl [IP]
y at first connect
mv
move files
df -h
"disk-free"
fdisk -l
disk size
disk used
Update/Upgrade
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update --allow-releaseinfo-change
aptitude
sudo apt-get update
sudo apt-get install aptitude
sudo aptitude install [name]
z.B.:
sudo aptitude install libpam-systemd:i386
curl
transfer data to or from a server
pwd
current dir
whatis
what is the program
pip
install Python-Modules
crontab
| usage: | crontab | [-u user] file |
| crontab | [ -u user ] [ -i ] { -e | -l | -r } |
| | (default operation is replace, per 1003.2) |
| -e | (edit user's crontab) |
| -l | (list user's crontab) |
| -r | (delete user's crontab) |
| -i | (prompt before deleting user's crontab) |
start
sudo service cron start
status
sudo service cron status
Crontab tutorial
cron-job-examples
man
Manual
shutdown
shutdown -h
dhcpcd.service
service dhcpcd restart
DNS
/etc/resolv.conf
nslookup
nslookup shadow.my-wan.de
CPU
top
RAM
free
mount network
Quelle: fraunerd.de
sudo nano /etc/fstab
//CLOUD-IP/FOLDER /home/pi/FOLDER cifs username=USERNAME,password=PASSWORD,uid=pi,gid=pi 0 0
sudo mount -a
mount usb stick
sudo fdisk -l
note device name
create mount point
mkdir /media/usb-drive
mount
mount /dev/[DEVICENAME] /media/usb-drive/
change folder
cd /media/usb-drive
unmount
umount /media/usb-drive
timedatezone
timedatectl status
change time zone
sudo timedatectl set-timezone Europe/Berlin
timedatezone
NTP needs protocol TCP+UDP
and
sudo reboot now
or set with:
sudo date -s '2014-12-25 12:34:56'
timedatezone
sudo nano /etc/systemd/timesyncd.conf
[Time]
NTP=192.168.4.1
FallbackNTPServers=
sudo systemctl restart systemd-timesyncd
timedatectl show-timesync
Create a Service
as Systemd Service