Create public and private keys using ssh-key-gen
on local-host
ssh-keygen -b 8192 -C "oliver@ripley"
Automatically installs your public key to the remote host (this is included in the openssh package)
ssh-copy-id 'user@remotehost'
Login to remote-host without entering the password
ssh remote-host
Remove remote-host from known_hosts
file
ssh-keygen -R hostname
ssh -t user@host1 "ssh user@host2" verschachtelt ssh hintereinander
ssh -l <username> -L <zu tunnelnder Port>:<IP des Server auf den ich nur über Umwege komme>:<zu tunnelnder Port> <IP des Rechners, zu dem ich Zugang habe>
ssh -l oliver -L 2323:192.168.1.2:4312 192.168.1.1
ssh -t redbrain@ara.uberspace.de "ssh root@172.23.30.70"
ssh -L localhost:22:redbrain@ara.uberspace.de:22 root@172.16.42.41
sudo -E ssh graute@graute-think -l graute -L 127.0.0.2:80:192.168.4.101:80 -L 127.0.0.2:22:192.168.4.101:22 -L 127.0.0.2:8081:192.168.4.101:8081 -L 127.0.0.2:9418:192.168.4.101:9418
This will get you a shell on machineb. Leave this alone; minimize the terminal window. Now, whenever you make an ssh connection to localhost, you will actually be connected to machinec through machineb.
ssh -L localhost:22:machinec:22 machineb
sudo ssh -L localhost:22:root@10.10.1.100:22 root@172.23.24.175
sudo ssh -L localhost:4711:root@10.10.1.100:4811 root@172.23.24.175
Tunnel von Support PC über ZwischenStation zum Ziel
supportpc$ ssh -L 54321:localhost:54321 root@172.16.42.41
zwischen$ ssh -L 54321:localhost:8080 redbrain@ara.uberspace.de
supportpc$ ssh -L 54322:ara.uberspace.de:22 root@172.16.42.41
supportpc$ ssh redbrain@localhost -p 54322
Source:
git pull ssh://redbrain@localhost:54322/home/redbrain/Projekt_Git_Repos/Scripte.git/
git push ssh://redbrain@localhost:54322/home/redbrain/Projekt_Git_Repos/Scripte.git/
sshpass enables non-interactive ssh password authentication. It allows you to establish an SSH connection by specifying a password as part of the command
sshpass -p password ssh -o stricthostkeychecking=no user@host command_to_run
Specifying the password as part of a command is not good security practice. A better approach is to export the password as the SSHPASS environment variable, and then use sshpass with the -e parameter:
export SSHPASS="password"
sshpass -e ssh -X -o stricthostkeychecking=no user@remotehost "command_to_run"
ssh -X user@remotehost
SSH X Forwarding über Tunnel von Support PC (Laptop) über ZwischenStation (RasperryPI) zum Zielhost (DesktopPC)
Erste Passwort ist das von der Zwischenstation, das zweite ist das vom Zielhost
supportpc$ export SSHPASS="PASSWORD"
supportpc$ sshpass -e ssh -X -o stricthostkeychecking=no pi@zwischenStation "export SSHPASS="PASSWORD" && sshpass -e ssh -X -o stricthostkeychecking=no username@zielhost "xclock""
Unter windows den Xserver Xming installieren In putty unter SSH->X11 Enable X11 Forwarding einstellen. Unter Linux /etc/ssh/sshd_config
auf “X11Forwarding yes” überpüfen. mit ssh auf Linux PC einloggen.
Dann Programm starten das X11 benutzt:
xclock &
netstat -ntapu | grep ":54321"
netstat -ntapu | grep "LISTEN"
vi /etc/ssh/sshd_config
create in your .bashrc a function:
myssh () { ssh $1 2>&1 | tee -a ~myusername/logdir/$1.log; }
alias is with
alias ssh=myssh
ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
ssh -D 1337 -q -C -N user@host
tell your browser to use that SOCKS5 proxy
for p in {6000..6015} ; do ssh -f -L $(($p + 1)):localhost:$p -p $p localhost sleep 1h ; printf "%s <== %s [%s]\n" $p $(($p + 1 )) "$(date)" ; done
check the Network load
ssh -D 2000 -p 6002 localhost
ifconfig lo| grep "RX"
supportpc$ ssh -L 54321:localhost:54321 root@172.23.24.175
zwischen$ ssh -L 54321:localhost:8080 root@10.10.1.111
supportpc$ ssh -L 54322:10.10.1.111:22 root@172.23.24.175
supportpc$ ssh root@localhost -p 54322
ssh -t you@homeaddr 'ssh you@192.168.1.5'
ssh -R *:8080:localhost:80 remoteserver
socat -v UDP-LISTEN:8161,fork TCP:localhost:8161
screen - Prozesse im Hintergrund starten
screen
create a new screen with the name foo
screen -S foo
return to screen with name foo
screen -r 'foo'
laufende screens anzeigen
screen -ls
zum nächsen screen springen
Ctrl-A” and “n“.
zum vorherigen screen springen
Ctrl-A” and “p“.
Creating Logfile
“Ctrl-A” and “H“
Screen Password Lock
“Ctrl-A” and “x”
screen Prozesse in den Vordergrund holen
screen -r
screen Prozesse Logging
screen -L
connecting directly to a screen remotly via ssh
ssh -t pi@raspberry screen -ls
ssh -t pi@raspberry screen -r 2684.pts-1.raspberrypi
reptyr can be used to reattach a program on another tty to the current tty so you can transfer it into screen/tmux.
reptyr <pid>
watch -n 10 process
do-release-upgrade
lsb_release --all
mkdir newdir
cd newdir
git init
git add .
git commit
clonen eines vorhandenen sauberen repos
git clone --bare /home/oliver/workspace/hacking/ hacking.git
Initialized empty Git repository in /tmp/hacking.git/
aus sauberen repo Arbeitsverzeichnis erstellen
git clone /tmp/hacking.git/ /tmp/hacking
Pushen
git push ssh://git@192.168.4.1/hacking.git
Tags Pushen
git push ssh://git@192.168.4.1/hacking.git Portbindender_Shellcode
Pullen
git pull ssh://git@192.168.4.1/hacking.git
git pull ssh://oliver@192.168.3.5/home/git/repositories/Scripte.git/
Tags Pullen
git pull ssh://git@192.168.4.1/hacking.git Portbindender_Shellcode
Eine neue remote quelle angeben und daraus aktualisieren
git remote add -f hacking.git ssh://git@192.168.4.1/hacking.git
git remote add origin https://github.com/user/repo.git
git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
git diff --word-diff
Anzahl Dateien
find . -type f -not -regex '\./\.git/.*' | wc -l
Zeilen Quelltext
find . -type f -not -regex '\./\.git.*' | xargs cat | wc -l (find . -name *.[hcS] -not -regex '\./\.git.*' | xargs cat | wc -l)
Anzahl Commits
git-log --no-merges --pretty=oneline v2.6.(x-1)..v2.6.(x) | wc -l
Diffstat
git diff --shortstat v2.6.(x-1)..v2.6.(x)
colordiff is a wrapper for diff and produces the same output as diff but with coloured syntax
apt-get install colordiff
colordiff file1 file2
diff -u file1 file2 | colordiff
gpg --export-secret-key KEY_ID | paperkey --output-type raw | dmtxwrite -e 8 -f PDF > secret-key.pdf
gpg --export-secret-key KEY_ID | paperkey --output-type raw | split -b 1500 - key-
for K in key-*; do
dmtxwrite -e 8 $K > $K.png
done
dmtxread
cat my-scanned-keys | paperkey --pubring ~/.gnupg/pubring.gpg > secret-key.gpg
$ echo -n 123456 | dmtxwrite > image.png
$ echo -n 123456 | dmtxwrite -o image.png
$ echo -n 123456 > message.txt; dmtxwrite message.txt > image.png
$ dmtxwrite <(echo -n 123456) -o image.png
$ dmtxread -n image.png
$ cat image.png | dmtxread -n
$ dmtxread -n -N1 image1.png image2.png image3.png
$ dmtxread -n -N1 -m500 image.png
$ echo 'Hello, world!' | dmtxwrite | dmtxread
Hello, world!
$ dmtxread image1.png | dmtxwrite -o image2.png
qrencode -s 7 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Network name (SSID)" --title="Create WiFi QR");T:WPA;P:$(zenity --password --title="Wifi Password");;"
qrencode -o qrcode.png 'Hello World!'
qrencode -o lpm.png http://www.linuxpromagazine.com
sudo mount -o loop -t iso9660 Desktop/Ubuntu\ 11.04/Ubuntu\ DVD/natty-dvd-i386.iso /media/cdrom
dd if=/dev/cdrom of=image.iso ; mkdir CDroot ; mount -o loop image.iso CDroot ; cd CDroot
sudo dd if=/dev/sde1 bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG
using rsync in a screen session is always helpfull
rsync -av <quelle> <ziel>
rsync -av --delete -e ssh root@server.example.com:/home/ /mnt/server-mirror/home/
Adjust all rsync processes on the system to lower IO priority
pgrep rsync | xargs ionice -c3 -p
copy files to a ssh server with gzip compression
rsync -az /home/user/test user@sshServer:/tmp/
rsync -avze ssh /home/benutzer benutzer@example.com:/backups
rsync cmd as substitute for scp
rsync -r -P -e ssh --stats <quelle> <ziel>
wobei die einzelnen Parameter diese Bedeutungen haben:
-r = copy files recursive
-P = progressbar and contunie after a abort
-e ssh = using ssh as transport protocol
--stats = statistic after the sync is finished
rsync -avzhu --progress <quelle> <ziel>
Useful to move many files (thousands or millions files) over ssh. Faster than scp because this way you save a lot of tcp connection establishments (syn/ack packets).
tar -cf - /home/user/test | gzip -c | ssh user@sshServer 'cd /tmp; tar xfz -'
rsync --progress file1 file2
rsync -avP /dir1 /dir2
Do an rsync and limit the bandwidth used to about 200 KBytes/sec. Useful on shared or slow links.
rsync --bwlimit=200 src dest
rsync -a -delete empty/ foo/
cryptsetup luksHeaderBackup --header-backup-file <file> <device>
luksHeaderRestore
mount //172.23.1.25/Technik /media/Technik/ -t cifs -o username=ogr,workgroup=Neuhaus
mkvmerge Tron\ Legacy\ 2010\ 1080p\ 143.mkv --split 4096M -o Tron Legacy 2010 1080p 143_1.mkv
md5sum durch Verzeichnisse rekursiv nutzen
find . -type f -print0 | xargs -0 md5sum >> checksummen.md5
ext2 Dateisystem vergrößern
resize2fs - ext2/ext3 file system resizer
sudo pppd nodetach 10.0.3.1:10.0.3.2 pty "pppd notty"
cat /dev/pts/2
echo Test > /dev/pts/4
start with an empty set of ppp options
mv /etc/ppp/options /etc/ppp/options.bak
touch /etc/ppp/options
run this first at one command prompt
pppd /dev/ptyp0 nodetach local 10.0.3.1:10.0.3.2
run this at another command prompt
pppd /dev/ttyp0 nodetach local
tail -f /var/log/messages
tcpdump -i lo -n "imcp"
tcpdump -i ppp0 -n "icmp"
tcpdump -i ppp1 -n "icmp"
ping 10.0.3.1
Connecting two pppd commands together, on different hosts, over an existing network, by embedding an ssh command to start the remote one inside the pty argument of the one started on the local host. This creates an encrypted network tunnel through the existing network, aka, a VPN.
start with an empty set of ppp options
mv /etc/ppp/options /etc/ppp/options.bak
touch /etc/ppp/options
Can setting up an encrypted VPN really be this simple?
pppd nodetach 10.0.3.1:10.0.3.2 pty "ssh -l root remotehost pppd notty"
tar -czvf - home/ | split -b 700m -
cat xa* > home.tar.gz
tar -xzvf home.tar.gz
sshfs USERNAME@192.168.1.1:/home/USERNAME ~/srv/
sshfs -h
fusermount -u ~/srv/
fuser displays the PIDs of processes using the specified files
fuser myfile
Send SIGTERM to every process that has myfile opened
fuser -k myfile
Ordner größe anzeigen
du -a -c -h directory/
du -sh * | sort -h -r
du -h|sort -hr|less
du -sh */ | sort -h
du -ma | sort -nr | head -n 20
du -cms .[^.]*/ */ | sort -rn | head
ls -lahS $(find / -type f -size +100M)
du -sh */
du -h --max-depth=1
du -sh */ #space usage of directories only
du -h . | grep "^[0-9\.]\+G"
du -x --max-depth=1|sort -rn|awk -F / -v c=$COLUMNS 'NR==1{t=$1} NR>1{r=int($1/t*c+.5); b="\033[1;31m"; for (i=0; i<r; i++) b=b"#"; printf " %5.2f%% %s\033[0m %s\n", $1/t*100, b, $2}'|tac
df -Pl -t ext3 -t ext4 | tail -n+2 | awk '{ sum+=$3 } END { print sum/2**20 }'
df -lP |awk '{sum += $3} END {printf "%d GiB\n", sum/2**20}'
df -text{2..4} -hP |column -t |tail -n+2 |sort -k5nr -k4n
größte Ordner und Dateien im Verzeichnis sortiert anzeigen
du -sh * | sort -h -r
Speicherverbrauch von Prozess Chrome anzeigen
ps aux | awk '/chrome/ {sum += $6} END { printf "%dMB\n", sum/1024 }'
pidstat 2 5
ps aux |tail -n+2 |sort -nrk4 |head -$(($(tput lines)-1)) |cut -c 1-$(tput cols)
ps aux | awk '{if ($8=="Z") { print $2 }}'
ps ax -o state -o ppid | awk '$1=="Z"{print $2}' | xargs kill -9
ps wu -U someuser
<ctrl-z> bg ; wait %1 ; echo "done" | mail -s "done" you@example.com
head foo.sh | hexdump -c
Canonical hex+ASCII display.
hexdump -C hexdump.dmp
Outputs the hex value of each letter.
echo hello | hexdump -v -e '/1 "%02X\n"'
( xsel -b || pbpaste ) | hexdump -c
tail -f logfile | perl -ne 'print localtime . " $_";'
while true; do [ $(sleep 1m && users | wc -w) -gt 1 ] && echo warning ; done
for i in {1..997};do printf "%0${i}d"|grep -P "^0?$|^(00+?)\1+$" >/dev/null ||echo $i;done
for u in example/bc{3,8}449{0,8,9}2-ab7a-1{3,8}03; do curl -sI $u|grep -q 404||echo $u; done
mkdir frames && cd frames && mplayer -ao null -vo png ../video.flv
rtmpdump -r rtmp://videoserv.url:1935/app/somevideo.mp4 --flv video.flv
is nice if you want to manage the video window better than what an embeded browser video window will allow.
rtmpdump -v --live -r rtmp://streamhost/live/ |tee streamcopy.flv |mplayer -xy 2 - # stream directly at 2x size and save a copy.
sudo tcpdump -s1514 -A -w - | strings | egrep -A5 "(rtmp://|Playing)"
for i in {1..50};do echo "$i: $(($RANDOM%30))"; done |gnuplot -e "set terminal dumb $COLUMNS $LINES; plot '-' with lines"
lsb_release -a || cat /etc/redhat-release
ps auxw | grep "[h]ttpd" | wc -l
shasum *.jpg | awk {'print $1'} | sort | uniq -c | grep -v " 1 "
for i in IMG_3[0-4]*.JPG ; do convert -quality 60 -geometry 300 $i thumbs/$i ; done
split -b 1G verylargefile split
cat split-xaa split-xab split-xac > rejoinedlargefile
pv bigdump.sql.gz | gunzip | mysql
date -d @$(( $(date +%s) - $(cut -f1 -d. /proc/uptime) ))
date -d @$(cat /proc/stat | grep btime | awk '{ print $2 }')
date -u -d @1234567890
Fr 13. Feb 23:31:30 UTC 2009
echo 'man $(ls /usr/bin | shuf -n 1)| sed -n "/^NAME/ { n;p;q }"' >> ~/.bashrc
exiftool -v '-Directory<DateTimeOriginal' -d %Y .
time cat
zcat access_log*.gz |cat - access_log |awk '{print $7}' |sed 's/\?.*//' |sort|uniq -c|sort -nr
cat longdomainlist.txt | rev | sort | rev
watch -n1 cat /proc/net/wireless
qpdf --decrypt protectpdf.pdf output.pdf
ionice -c 3 cp vm1.img vm1-clone.img
fdupes -r dir > dupes.txt
date -d @728737200
fgrep --binary-files=text -C 2000 "string in file" /dev/sda > recovereddata.out
egrep -o "(Donnie|Frank|Roberta|Grandma)" story.txt |sort|uniq -c|sort -r
for dir in */ ; do echo "${dir%/}" ; done
grep -P -o '(?<=href=")http:\S+(?=")' *.html
strings /dev/urandom | tr -c -d '0-9' | dd of=randomnumbers.txt bs=1 count=1M
md5sum -c /dev/urandom
sudo apt-get install rig
factor
This makes 30 passes by overwriting the entire hard disk with -z zeros:
sudo shred -vfz -n 30 /dev/sdx
cat /dev/urandom| tr -dc 'a-zA-Z0-9' | fold -w 10| head -n 4
strings /dev/urandom | tr -cd '[:alnum:]' | fold -w 30 | head -n 1
apg
pwgen
mount /mnt /dev/sda2
sed /^root/s/.*:root:/root::0:0:root:/ /mnt/etc/passwd
reboot
grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" filename.txt
grep -E -o -h "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/*
grep -E -o -h "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/* |sort|uniq -c|sort -nr
grep -E -o -h "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/* |sort|uniq -c|sort -nr | head -n 20
grep -E -o -h "@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/oliver/*
grep -E -o -h "@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/* |sort|uniq -c|sort -nr
grep -E -o -h "@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" -R /home/* |sort|uniq -c|sort -nr | head -n 20
egrep -o "(mailto|ftp|http(s)?://){1}[^'\"]+" *
pandoc -s -S README -o example29.docx
Syntax highlighting of delimited code blocks:
pandoc code.text -s --highlight-style pygments -o example18a.html
$ (openssl x509 -noout -modulus -in server.pem | openssl md5 ;\
openssl rsa -noout -modulus -in server.key | openssl md5) | uniq
This will get the sunrise and sunset times of a specific location. To be able to determine $l you need to first go to http://weather.yahoo.com/ and look up your location. The last numbers in the URL will be the $l
$ l=656958;curl -s http://weather.yahooapis.com/forecastrss?w=$l&u=c|grep astronomy| awk -F\" '{print $2 "\n" $4;}'
l=656958;curl -s curl http://weather.yahooapis.com/forecastrss?w=656958\&u=c | grep "condition" | awk -F\" '{print $5 $6;}'
find . -name '*.sh' -exec bash -n {} \;
You’re running a script, command, whatever.. You don’t expect it to take long, now 5pm has rolled around and you’re ready to go home… Wait, it’s still running… You forgot to nohup it before running it… Suspend it, send it to the background, then disown it… The ouput wont go anywhere, but at least the command will still run..
^Z $bg $disown
longcmd <ctrl-z> bg; disown; screen; reptyr $(pid longcmd)
This command runs your shell script in the background with no output of any kind, and it will remain running even after you logout.
nohup /bin/sh myscript.sh 1>&2 &>/dev/null 1>&2 &>/dev/null&
Makes a partition in ram which is useful if you need a temporary working space as read/write access is fast. Be aware that anything saved in this partition will be gone after your computer is turned off.
mount -t tmpfs tmpfs /mnt -o size=1024m
last reboot
Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
Rapidly invoke an editor to write a long, complex, or tricky command
ctrl-x e
upower --monitor-detail
a function to create a box of ‘=’ characters around a given string. Call it with box test
box() { t="$1xxxx";c=${2:-=}; echo ${t//?/$c}; echo "$c $1 $c"; echo ${t//?/$c}; }
box test
box test X
code2html code.cpp > code.html
show printers
lpstat -p -d
print code in a pdf file
code2html code.cpp | lpr -P printer
lpr -P printer filename
stat -c "%a %n" *
Files:
644 - The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.
664 - The owner and the group may read and write a file, while all others only read the file
755 - The file's owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users.
Directorys:
777 - No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
755 - The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
700 - The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.
To change all the directories to 755 (-rwxr-xr-x):
find /media/data -type d -exec chmod 755 {} \;
To change all the files to 644 (-rw-r–r–):
find /media/data/ -type f -exec chmod 644 {} \;
cat input.log | sed -e "s/^/$(date -R) /" >> output.log
pipe the script’s output through a loop that prefixes the current date and time:
./script.sh | while IFS= read -r line; do echo "$(date) $line"; done >>/var/log/logfile
SIZE=1; dd if=/dev/zero bs=1M count=$((SIZE*1024)) | pv -pters $((SIZE*1024*1024*1024)) | openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt > randomfile
strace -T -f -p <PID>
strace -tt -T -f <COMMAND>
strace -c -p mypid
ltrace ./example
LD_LIBRARY_PATH=$LD_LIBRARY_PATH: ./myprog
export LD_LIBRARY_PATH=/path/to/lib1:/path/to/lib2
./myprog
FILE=file_name; CHUNK=$((64*1024*1024)); SIZE=$(stat -c "%s" $FILE); for ((i=0; i < $SIZE; i+=$CHUNK)); do losetup --find --show --offset=$i --sizelimit=$CHUNK $FILE; done
/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
youtube-dl -tci --write-info-json "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
sudo smartctl -a /dev/sda
xdg-open file.ps
setxkbmap -option caps:backspace
Get HTTP status code with curl AND print response on new line
curl -s -o /dev/null -w "%{http_code}\n" localhost
Get HTTP Header of a Website
curl -I http://www.example.com
Watch who requests what page from lighttpd logs
tail -f access.log | awk '{print $1 , $11}'
count all the lines of code in a directory recursively
find . -name '*.cpp' | xargs wc -l
Clean apt-get and gpg cache and keys
sudo gpg --refresh-keys; sudo apt-key update; sudo rm -rf /var/lib/apt/{lists,lists.old}; sudo mkdir -p /var/lib/apt/lists/partial; sudo apt-get clean all; sudo apt-get update
ssh hostname nc -l 9876
sysctl --system
lstopo -p -v --whole-system --whole-io output.svg
ip -o -4 a s | awk -F'[ /]+' '$2!~/lo/{print $4}'
sudo apt-get install smartmontools
sudo smartctl -a /dev/sda
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
Datenbank für Festplattenmodelle updaten
sudo update-smart-drivedb
Abfrage des SSD Status
sudo smartctl -a /dev/sda
sudo smartctl -H /dev/sda
ls | sort | more
curl ifconfig.me/ip
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
man stat
man 2 stat
stat filename
stat /dev/ttyS0
stat -f /dev/sda1
rename -v 's/DSC/birthday-party/' *.jpg
DSC_001.jpg renamed as birthday-party-001.jpg
DSC_002.jpg renamed as birthday-party-002.jpg
DSC_003.jpg renamed as birthday-party-003.jpg
replace all spaces in the file names
rename -v 's/ //g' *
screenkey
This commands looks for ASCII strings embedded in binary files
strings -f /usr/lib/lib*
tput colors
ls whateveryouwant | xargs -n 1 basename
ls -Art * | tail -n 1
ls -XR | vim -
echo "bash /path/to/yourscript" | at 16:30
sudo usermod -a -G dialout $USER
watch "cat /proc/cpuinfo | grep \"cpu MHz\""
tail -f file.txt | ts
inxi -Fxz
faketime 'today 23:15' date
iperf3 -c speedtest.wtnet.de -p 5200 -P 10 -4
Server sendet Client empfängt:
iperf3 -c speedtest.wtnet.de -p 5200 -P 10 -4 -R
Links: