MyDebianBashHistory v128
![debian.png](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmSF3Wq9AddzodYTnE3vCowRLBEUSaunZ5P7Po3EfqZDhh/debian.png)
Image source: Willi Glenz - MyDebianDesktop
20181106 # service --status-all | less
20181106 # service apache2 start | restart | stop
20181104 # apt-get install firmware-iwlwifi
20181104 strg+s : Stop output to the screen
20181104 strg+q : Allow output to the screen
20181101 Glances - $ curl -L https://bit.ly/glances | /bin/bash
20181031 $ youtube-dl - F https://youtu.be/xyz
20181030 # mount -o loop /home/user/iso/xyz.iso /mnt/
A - alias apt-cache apt-get archivemount atop awk
B - badblocks bashrc bc bg blkid
C - cat cd chkrootkit clipit chown cp curl cut
D - dd df diff dmesg dpkg du
E - echo
F - fdisk fg file find fish free fuser
G - git glances grub-mkconfig guake
H - head htop hwinfo
I - info ifconfig iwconfig
J - java javac jobs
K - kismet
L - lastlog less ls lsb_release lsblk lshw lspci lsusb lvm
M - man mc mkdir mount mv
N - netatop netbeans nmap nl
O - open
P - perldoc pinfo printf pwd pwgen
R - R raspi-config rpi-update rsync
S - screen script sed service set sort ssh steghide stat sudo su swapon sync
T - tac tail tasksel top touch tripwire tune2fs
U - ufw uniq update-alternatives users
V - veracrypt vim vimtutor visudo vlc
W - w watch wc w3m whoami
X - xdotool xsel
Y - youtube-dl
strg-a : Go to the beginning of the line
strg-e : Go to the end of the line
strg-l : Clear the screen
strg-r : Search the history
strg-s : Stop output to the screen
strg-q : Allow output to the screen
debgen.simplylinux.ch
debian.org
debian.org/distrib/netinst#smallcd
distrowatch.com/table.php?distribution=debian
raspberrypi.org
raspberrypi.org/downloads/raspbian/
wiki.debian.org/FrontPage
# apt-get install aview backintime-qt4 debian-handbook debian-reference debian-reference-en debian-refcard espeak firmware-iwlwifi glances gkrellm guake htop hwinfo kismet libreoffice lvm2 mc powertop printer-driver-cups screen sudo taskwarrior terminator vim vym youtube-dl
file:////usr/share/doc/debian-refcard/index.html
file:///usr/share/doc/debian-handbook/html/en-US/index.html
$ clear; lsblk; lsblk -l
$ dpkg -L
$ dpkg -L debian-handbook
$ dpkg -L debian-refcard
$ dd bs=4M if=2018-10-09-raspbian-stretch.img of=/dev/sdX status=progress conv=fsync
raspberrypi.org/documentation/configuration/
~./bashrc ~.profile /etc/profile /etc/bash.bashrc
$ sudo !!
$ sudo su
# service netatop start && atop
# raspi-config
# update-alternatives --config editor
// $ vim ~/.bashrc
// HISTCONTROL=ignoreboth:erasedups
// export PATH=$HOME/scripts:$PATH
// alias c='clear; ncal -3wy'
// alias h='clear; history 25'
// alias l='ls -hog'
// alias L='clear; ls -hog'
// alias x='echo $PWD'
// alias xx='cd ..'
// $ . ~/.bashrc
// ~/.vimrc
// " GENERAL
// syntax on
// set number
// set ruler
// "set hls
// set background=dark
// set encoding=utf8
// set mouse=a
// " INDENT
// set autoindent
// " TABs
// set tabstop=3
// set softtabstop=3
// set shiftwidth=3
// set expandtab
// " MAPs
// nmap <leader>w :w!<cr>
// map <F2> :echo 'Current time is ' . strftime('%c')<CR>
atop dstat free glances htop info kill man pinfo ps pwd top tuptime uptimeusers vmstat w whoami
zabbix.com
bg fg jobs strg-z
$ apt-cache show vlc | less
# apt-get install kismet
$ cat /etc/fstab | grep -i swap
# cat /var/log/messages | awk '{print substr($0,0,12)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i<$1 ; i++) {printf("*")};}' | less
$ dstat -f 60 24
$ df -hT
$ efibootmgr
$ find ~ -maxdepth 1 -type f -mtime 3
$ find ~ -maxdepth 1 -type f -exec grep "^alias " '{}' \; -print$ lastlog | less
$ find /etc -type f -print 2> /dev/null | less
$ find /etc/*tab -type f -print
$ free -h
$ lastlog | less
$ lsblk
$ lsb_release -a
$ ps hax -o user | sort | uniq -c
$ script sessionlog_2018-10-30
$ set | less
# service cron status
# swapon -s
$ tuptime
# ufw status
$ vmstat 2 10
$ watch -n 5 free -m
$ whowatch
$ xload -update 1 -nolabel &
BASH
$ printf "The user %s is %d years old.\n" Max 28
$ set | less
JAVA
tutorialspoint.com/java/index.htm
chortle.ccsu.edu/java5/index.html
oreilly.com/openbook/javawt/book/index.html
$ java -version
# update-java-alternatives -l
# apt-get install openjdk-11-jdk
# update-java-alternatives -s java-1.11.0-openjdk-amd64
# update-alternatives --display java
# update-alternatives --configure java
$ w3m https://docs.oracle.com/javase/8/docs/api/index.html
$ screen vim ~/java/Main.java
$ ( cd ~/java/; vim Main.java )
NETBEANS IDE
docs.oracle.com/cd/E50453_01/doc.80/e50452.pdf
alt+shift+f : Format selection
strg + x : Delete line
strg + e : Delete line
strg-shift-minus | plus : Collaps Expand all
PERL
# apt-get install perldoc
$ perldoc perlintro
$ w3m http://learn.perl.org/books/beginning-perl
// #!/usr/bin/perl
// use strict;
// use warnings;
R
$ R
fdisk hwinfo ifconfig iwconfig lshw mount lvm sync
~~~
# badblocks -v /dev/sda
# blkid /dev/sda1
$ cat /sys/devices/virtual/thermal/thermal_zone0/temp
# fdisk -l
# hwinfo --short | less
# hwinfo --disk
# ifconfig eth0
# iwconfig
# lshw -short | less
$ mount | column -t
# mount -t tmpfs -o size=2048M tmpfs /media/ramdisk
# mount -o loop /home/user/iso/xyz.iso /mnt/
$ sync
# tune2fs -l /dev/sda2
LVM
# apt-get install lvm2
$ apt-cache show lvm2
$ man lvm
# fdisk -l
SOURCES
* Linux on the Road $ w3m http://www.tldp.org/LDP/Mobile-Guide/html/index.html
* Raspberry Pi $ w3m https://www.raspberrypi.org/documentation
* clipit task tripwire vim
~~~
# apt-get install clipit task tripwire vim
# apt-get install menulibre
GOOGLE SHEETS
* =SVERWEIS(max($A$12:$A); $A$12:P; SPALTE(P2); WAHR)
VIM
* strg-wv strg-wr strg-wc
$ dpkg -L vim-doc
$ EDITOR=/usr/bin/vim
$ VISUAL=$EDITOR
$ export EDITOR VISUAL
# update-alternatives --config editor
$ vimtutor
$ vim Main.java
$ Strg-x e
$ w3m https://linux.die.net/man/1/vim
$ w3m https://www.vim.org
~/.vimrc
" GENERAL
syntax on
set number
set ruler
"set hls
set background=dark
set encoding=utf8
set mouse=a
" INDENT
set autoindent
" TABs
set tabstop=3
set softtabstop=3
set shiftwidth=3
set expandtab
" MAPs
nmap <leader>w :w!<cr>
map <F2> :echo 'Current time is ' . strftime('%c')<CR>
TASKWARRIOR
Installation & Configuration
$ apt-cache search taskwarrior
$ apt-cache show taskwarrior
# apt-get install taskwarrior
$ vim ~.taskrc
$ w3m https://linux.die.net/man/1/task
Basic Task Management
$ task
$ task add Task1
$ task add Task2
$ task
$ task 1 modify priority:H
$ task 1 modify due:eow
$ task 1 start
$ task 1 stop
$ task 1 information
$ task
$ task 1 done
$ task 2 delete
$ task
$ task burndown
$ alias t='clear; task'
$ alias tt='clear; task burndown.daily'
Documentation
$ man task
$ w3m https://taskwarrior.org
$ w3m https://taskwarrior.org/docs
$ w3m https://taskwarrior.org/docs/30second.html
$ w3m https://linux.die.net/man/1/task
TRIPWIRE
# apt-get install tripwire
$ apt-cache show tripwire
$ man tripwire
$ w3m https://github.com/Tripwire/tripwire-open-source
> Creating a baseline: # tripwire --init
> Running a check: # tripwire --check --verbose
> Printing a report: # twprint -m r -t [0-4] -r /path/to/reportfile.twr
> Updating the database: # tripwire --update --accept-all
* cd chown cp df dpkg du file find for java ln ls man mkdir mv open pwd rm sort stat touch type veracrypt vim visudo watch
* /etc /var/log /bin /usr/bin /sbin
~~~
# chown userXYZ file.txt
$ df -hT
$ dpkg -L vim-doc
# du -hs / 2> /dev/null
$ du -h --max-depth=1 | sort -rh
$ du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e'
# find /home -user userxyz -size +1G
# find /home -user userxyz -mtime -3
# find / -uid 1000 -exec chown -v 1002:1002 {} \;
$ find . -name "*.jpg" -exec convert {} -scale 50% +repage {} \;
$ find ~ -maxdepth 1 -type f -mtime 3
$ find ~ -maxdepth 1 -type f -exec grep "^alias " '{}' \; -print
# find / -user userxyz -type f -exec rm -f {} \;
$ find /etc -type f -print 2> /dev/null | less
$ find /etc/*tab -type f -print
$ for x in *; do mv "$x" "${x,,}"; done
$ java -jar filename.jar
$ ls -l | xsel --clipboard
$ man hier
$ sort -t: -k1 -n /etc/passwd
$ stat /home/user
$ type date
$ type echo
# visudo
> Defaults:userxyz timestamp_timeout=30
$ watch -d -n 5 ls -l
# vim /etc/sudoers
SECURITY
* VeraCrypt $ w3m https://www.veracrypt.fr/en/Documentation.html
* passwd id groups su sudo visudo
* adduser useradd ~ deluser userdel ~ usermod chage
* addgroup groupadd ~ groupdel delgroup ~ groupmod newgrp
* ~/.bashrc ~/.profile /etc/group /etc/passwd /etc/profile /etc/shadow /etc/adduser.conf /etc/default/useradd
~~~
# vim /etc/sudoers
$ su -p
# adduser user2
# useradd -D
# usermod -c "TestUser" user2
# userdel -r user2
# find /home -uid 1000 | wc -l
# find /home -uid 1000 | tee 1000-files.txt
# find / -uid 1000 -exec chown -v 1002:1002 {} \;
$ fuser -v /media/xyz
$ getent passwd userxyz
$ ls -l /etc/skel
$ id -u user1
$ id -u root
$ id user1
# chown -R user2:user2 /home/user1
$ cut -d: -f1 < /etc/passwd | sort | xargs
PASSWORD
# passwd user1
# passwd -S user1
debian.org/News/2018 debian.org/security/#DSAS veracrypt.fr/en/Documentation.html sectools.org kernel.org
cd ls man mv cp open less strg-z bg fg jobs
/var/log
~~~
# apt-get update && apt-get upgrade && apt-get dist-upgrade
$ cat /etc/shells
# chkrootkit
# vim /etc/sudoers
# visudo
$ gnome-<tab><tab>
$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
# init 0
# ls<tab><tab>
$ pwgen -s 12
# rpi-update
# rkhunter --check --sk
# shutdown -r now
# shutdown -c
# shutdown -h 1:00
# tripwire --init
$ uname -v
$ unset HISTFILE
$ PI=$(echo "scale=10; 4*a(1)" | bc -l)
BACKUP
$ archivemount archive.tar.gz ~/mnt/
# dd if=/dev/sdABC of=/dev/sdXYZ bs=64K conv=noerror,sync
$ tar -cvzf ~/backup/backup.tar.gz ~/java
$ tar -tvf backup.tar.gz
$ rsync -avzP --delete --stats /media/abc/ /media/xyz
$ ssh [email protected] "tar -zcf - /home/user/scripte" > scripte.tar.gz
KERNEL
$ lsmod | wc -l
LOGGING
# tail -f /var/log/messages
# tail -fvn 25 /var/log/messages
# less +F /var/log/messages
# dmesg --facility=kern -H
# dmesg --level=err,warn -T
MULTIMEDIA
$ mpg123 -zvC /home/user/music/*
$ youtube-dl - F https://youtu.be/xyz
TIME
# vim /etc/crontab
$ ls -l /etc/cron* | less
TROUBLESHOOTING
# dstat
# testdisk
# grub-mkconfig -o /boot/grub/grub.cfg
# service netatop start && atop
* curl ifconfig mtr netstat python ssh
* myip.is
~~~
$ speedometer -r eth0
# arp-scan 192.168.0.0/24
# iw dev wlan0 scan | egrep "SSID|signal" | awk -F ":" '{print $2}' | sed 'N;s/\n/:/' | sort
$ curl ifconfig.me
$ mtr --curses google.com
# netstat -tulpn
$ netstat -a | less
# ifconfig -a | grep -Po '\b(?!255)(?:\d{1,3}\.){3}(?!255)\d{1,3}\b' | xargs nmap -A -p0-
$ ssh -X [email protected]
$ python -m SimpleHTTPServer
CONFIGURATION
# vim /etc/ssh/ssh_config
$ cat /etc/hosts
# vim /etc/hosts
# macchanger -r eth0
HOSTS
$ sntop
$ ip a
$ sshfs name@server:/path/to/folder /path/to/mount/point
# ifconfig eth0 down | up
$ nmap --iflist
$ nmap -A -T4 192.168.0.199
$ nmap -sP 192.168.1.0/24
ROUTING
$ nmap --iflist
$ ip -r
DOCUMENTATION
$ w3m http://www.linuxhowtos.org/Security/understandssh.htm
$ w3m https://linux.die.net/Intro-Linux/chap_10.html
# tasksel
# tasksel --list-tasks
# service ssh status
# service --status-all | less
# apt-get install printer-driver-cups
# ufw status
RASPBERRY PI
$ ssh -X [email protected]
# raspi-config
# curl -sSL https://install.pi-hole.net | bash
B
* Bash - tecmint.com/linux-commands-cheat-sheet
* Bash - tldp.org/LDP/Bash-Beginners-Guide/html/index.html
* Bash - tldp.org/LDP/abs/html/index.html
* Bash - ComandLineFu - commandlinefu.com
* Bash - Die.net - die.net
* Bash - Pure Bash Bible - github.com/dylanaraps/pure-bash-bible
* Bash - Commandlinefu.com - commandlinefu.com
* Bash - Command-Line-Tools - tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html
* Bash - CheatSheet $ curl cheat.sh
F
* Fish Tutorial - fishshell.com/docs/current/tutorial.html
G
* Gimp - https://www.gimp.org
* GIT - git-scm.com/book/en/v2
* GIT $ man gittutorial
* Grub - gnu.org/software/grub/manual/grub/grub.html
I
* Info Pages $ info info
L
* LibreOffice - libreoffice.org
* Linux - linux.com
* Linux - kernel.org
* Linux - linuxlinks.com
* Linux - tldp.org/LDP/intro-linux/html/index.html
* LinuxFromScratch - linuxfromscratch.org
N
* Netbeans - docs.oracle.com/cd/E50453_01/doc.80/e50452.pdf
O
* Open Books - O'Reilly - www.oreilly.com/openbook
* Open Books - Rheinwerk - rheinwerk-verlag.de/openbook/
P
* Perl - Beginning Perl - learn.perl.org/books/beginning-perl
R
* R - Introduction to R Programming $ w3m https://youtu.be/92zCRV3eQxw
* R - An Introduction To R: https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf
* R - An Introduction to R > help.start()
S
* Scribus - scribus.net
T
* TLDP - tldp.org
M
* MAN Pages $ man -t man | ps2pdf - man.pdf
* MAN Pages $ man -k scanner
* MAN Pages $ apropos . | shuf -n 1 | awk '{print$1}' | xargs man
* MAN Pages $ man man
WEATHER
$ curl wttr.in/~wasserkuppe?lang=de
$ curl wttr.in/bad+kissingen?lang=de
$ curl wttr.in/fulda?lang=de
$ curl wttr.in/~odenwald+reichelsheim?lang=de
$ curl wttr.in/~valletta
$ curl wttr.in/:help
BITCOIN
$ curl rate.sx