🡐 Retour à l'index

Do we use: 'Wayland' OR 'x11' (systemd version)

loginctl show-session $XDG_SESSION_ID -p Type

grep puis éditeur (micro, ou gedit) chaque fichier trouvé par grep

grep -irl "background.*bisque" ~/vmap/ | xargs -I {} micro {}

alias t pour tree puis fzf pour recherche dans le répertoire actuel et ses sous-répertoires

alias t='tree | fzf'

function pour find excluant les fichiers et répertoires cachés, exemple ff '*sometext*'

ff() { find . -type d -path '*/.*' -prune -o -name "$1" -print; }

Exécuter un script CRON au redémarrage de votre serveur

@reboot /path/to/script.sh

restart networkmanager

sudo systemctl restart NetworkManager

list cron jobs

crontab -l

edit cron jobs

crontab -e

Take screenshots of websites from terminal

firefox -screenshot 'https://pwnwriter.xyz'   # sauvegardé dans le dossier personnel 

Adresses IP locales

ip -br -4 addr show

Rename all *.txt to *.md

for file in *.txt; do mv -- "$file" "${file%.txt}.md"; done

quickly rename one file

mv filename.{old,new}

search file in tree view (also in hidden dirs)

tree -f --prune -P 'index*'

turn tar files to tar.gz files, keep timestamp

for f in *.tar; do gzip -9 $f; done

turn tar.gz files to tar files, keep timestamp

for f in *.tar.gz; do gunzip $f; done

ls avec hyperlink

ls -la --hyperlink

replace infile with backup

grep -Irl 'old_word' . | xargs sed -i.bak 's/old_word/new_word/g'   # I ignore binary

Print Lines Between Two Patterns, ex <style> and </style>

find . -type f -name '*.php' -exec echo {} \; -exec awk '/<style>/, /<\/style>/' {} \;

lister les services actifs

systemctl list-unit-files --state=enabled

list completions

ls -la /usr/share/bash-completion/completions/

read a file into a variable

value="$(<config.txt)"

grep print only files names containing no match (L au lieu de l)

grep -irL  "<script" .

grep print non-matching lines

grep -ir -v  "<script" .

clavier, bascule Querty / Azerty

Ctrl Fn  # Ctrl Shift si pas de touche Fn

terminal, edit actual command. Useful for multi-line commands

Ctrl-x Ctrl-e

terminal expand variables

Ctrl-Alt-e

terminal seearch history - fzf make it better

Ctrl-r

terminal - fzf select file

Ctrl-t

terminal - fzf change dir

Alt-c

terminal new tab

Shift-Ctrl-t

terminal switch tab

Ctrl-PgDn to next tab , Ctrl-PgUp to previous tab

micro new tab

Ctrl-t

micro switch tab

Alt-, Previous tab , Alt-. Next tab

list all files modified during last 24 hours

find . -type f -mtime -1 -ls

list all files modified during last 10 minutes

find . -type f -mmin -10 -ls

list all symbolic links in a directory

find . -type l -ls

replace the first occurrence of a pattern with a given string

${content/pattern/string}

replace all occurrences of a pattern with a given string

${content//pattern/string}

find all files with full permissions to everyone (777) in the current directory and change them to 755

find . -perm 777 | xargs chmod 755

open a file manager of the current directory in the terminal

xdg-open .

ls sorted by filetime

ls -lrt

ls sorted by filesize

ls -laS

Find duplicate filenames (recursively) in a given directory (need no space or tab in filenames) (gestionsite)

find ~/vmap ~/vip -type f -printf '%p/ %f\n' | sort -k2 | uniq -f1 --all-repeated=separate

replace spaces in all file names of dir, no recurse but easy expand to each level (gestionsite)

for f in *\ *; do mv "$f" "${f// /_}"; done
for f in */*\ *; do mv "$f" "${f// /_}"; done
for f in */*/*\ *; do mv "$f" "${f// /_}"; done

Find filenames with space (gestionsite)

find . -type f -name "* *"

Tuer le terminal sans enregistrer .bash_history

kill -9 $$

find all index.php files and print md5sum filename on one line (gestionsite)

find ~/vmap ~/vip -name 'index.php' -exec md5sum {} \; | sort

find all filtre.js files and print filestamp filesize filename on one line (gestionsite)

find ~/vmap ~/vip -name 'filtre.js' -exec bash -c 't=$(date -r {} +%s); t="$t $(wc -c {})";echo $t' \;

find all filtre.js files and print filestamp

find ~/vmap ~/vip -name 'filtre.js' -exec date -r {} +%s \; -exec echo {} \;

find all files starting by caddy and redirect unauthorised

find / -iname 'caddy*' 2>/dev/null

copy image from file to clipboard

xclip -selection clipboard in.png

copy image from file to clipboard (shorter)

xclip -se c in.png

paste image from clipboard to file

xclip -selection clipboard -target image/png -out > /tmp/clipboard.png

paste image from clipboard to file (shorter)

xclip -se c -t image/png -o > out.png

encrypt a file like fileEncryptDecryptAESCGM.html

openssl enc -aes-256-cbc -salt -pbkdf2 -a -in file.txt -out file.txt.enc -k PASS     # chiffrer, retirer -K et le PASS si pas intercatif

decrypt a file like fileEncryptDecryptAESCGM.html

openssl enc -aes-256-cbc -salt -pbkdf2 -a -d -in file.txt.enc -out file.txt -k PASS  # déchiffrer, retirer -K et le PASS si pas intercatif

encrypt a file like pager

openssl aes-256-cbc -e -salt -pbkdf2 -iter 10000 -in plaintextfilename -out encryptedfilename -pass pass:$ENCRYPTION_PASSWORD

decrypt a file like pager

openssl aes-256-cbc -d -salt -pbkdf2 -iter 10000 -in encryptedfilename -out plaintextfilename -pass pass:$ENCRYPTION_PASSWORD

debian fix any missing dependencies

sudo apt install -f

debian fix any missing dependencies

sudo apt --fix-broken install

Modifier l'échelle d'affichage

gsettings set org.gnome.desktop.interface text-scaling-factor 0.8

lister tous les crons

ls -la /etc/cron.*

ISO file to bootable USB drive

sudo dd bs=4M if=/path/to/file.iso of=/dev/sdX status=progress oflag=sync

les messages du noyau voir aussi dans https://manpages.debian.org/bookworm/util-linux/dmesg.1.en.html

sudo dmesg

faire un fichier inmodifia ble et ineffaçable

chattr +i file  # -i pour retirer l'attribut

nslookup to get DNS resolver and ip

nslookup  ilu.be

run your code using su as the www-data user

sudo su -s /bin/bash www-data

run your code using sudo as the www-data user

sudo -u www-data /bin/bash

lien symbolique symlink dans ~/.local/bin

cd ~/bin; ln -s ~/vip/py/favmenu.py favmenu

lien symbolique symlink dans /usr/local/bin

cd /usr/local/bin; sudo ln -s /home/jean/vip/scripting/updatehosts.sh updatehosts

caddy: voir mes logs php en temps réel

tail -f -n 20 /var/log/caddy/php_error.log

delete last line before actual line in history

history -d -2

delete 5 last lines including actual line in history

history -d -5--1

Scan LAN and get host names

nmap -sn --system-dns 192.168.1.1-253

taille (size) des dossiers

ncdu

Download a working local copy of a webpage

wget -p -k http://www.example.com/  # -p  download ressources , -k convert links

check free space on disk

df -h

Watch the disks fill up

watch -n 1 df -h

Supprimer des doublons dans .bash_history, en conservant l'ordre

TEMPFILE=$(mktemp) && tac ~/.bash_history | awk '!x[$0]++' > "$TEMPFILE"  && tac "$TEMPFILE" > ~/.bash_history && kill -9 $$

Supprimer dans .bash_history toutes les lignes contenant "mystring"

sed -i '/mystring/d' ~/.bash_history && kill -9 $$

Resize a Terminal Window

printf "\e[8;70;180;t"

Get the full path to a file

realpath examplefile.txt

remove empty lines

sed '/^$/d'

"predicate" that adds $(fzf) at the end of the command lines

alias f='_dofzf() { local sel; sel=$(fzf) && "$@" "$sel"; }; _dofzf'

Find all md files in directory then preview

find . -name "*.md" | fzf --preview 'less {}'

Find all md files in directory then preview then edit with micro

find . -name "*.md" | micro $(fzf --preview 'less {}')

Edit file that has been just listed

micro !*

micro editor, start / stop recording macro

CTRL u

micro editor, run latest macro

CTRL j

Add a Clock to Your CLI

export PS1="${PS1%\\\$*}"' \t \$ '

print an horizontal line

hr () { printf "\e[1;9m%*s\e[0m\n" "$(tput cols)" ; }

Terminal Keyboard Shortcut list

echo -e "Terminal shortcut keys\n" && sed -e 's/\^/Ctrl+/g;s/M-/Shift+/g' <(stty -a 2>&1| sed -e 's/;/\n/g' | grep "\^" | tr -d ' ')

Restart GNOME

Alt + F2 then type r

mount / unmount an iso (in any dir, like /mnt/myiso or /media/mydisc or other)

sudo mkdir /mnt/myiso ; sudo mount -o loop -t iso9660 pathtoiso.iso /mnt/myiso
sudo umount /mnt/myiso

Remove all files except list

rm -rf !(@(file1|file2|...))

shutdown pc in 4 hours

sudo shutdown -h +240

easily find megabyte eating files or directories

du -hs *|grep M|sort -n

Recursively search for large files. Show size and location.

find . -size +100000k -exec du -h {} \;

Calculate md5 sums for every file in a directory tree, sorted

find . -type f -exec md5sum {} \; |sort -k 2 > sum.md5

Compare 2 .md5 files

icdiff vmap.md5 vmap1.md5

Compare 2 .md5 files, numbered, just 1 line

icdiff -U 1 -N vmap.md5 vmap1.md5

Check DNS

dig +short domain

Check reverse DNS

dig +short -x ip

ping a range of IP addresses

nmap -sP 192.168.1.1-90

find all active IP addresses in a network

nmap -sP 192.168.1.0/24; arp -n  | grep "192.168.1.[0-9]* *ether"

list all opened ports on host

nmap -p 1-65535 --open localhost

check specific port such as 22

sudo lsof -i:22

list all opened ports on host

sudo lsof -i -P -n | grep LISTEN

Look for IPv4 address in files.

alias ip4grep="grep -E '([0-9]{1,3}\.){3}[0-9]{1,3}'"

awk pour montrer certaines colonnes

ls -l | awk '{print $5, $9}'

Find default gateway

ip route | awk '/default/{print $3}'

Port scan a range of hosts with Netcat.

for i in {1..99}; do nc -v -n -z -w 1 192.168.1.$i 443; done

Testing php configuration

php -i

Check syntax for all PHP files in the current directory and all subdirectories

find . -name \*.php -exec php -l "{}" \;

run php code inline from the command line

php -r 'echo strtotime("2009/02/13 15:31:30")."\n";'
php -r 'echo str_rot13 ("Hello World")."\n";'

find syntax

find [path] [arguments]
find [path] [arguments] -exec [command] {} \;
find [path] [arguments] -exec [command] {} +

find all pdf in current directory

find . -name "*.pdf"

find all files in ~/vmap/www.ilu.be

find ~/vmap/www.ilu.be -type f -name "*"

ls sorted by files size

ls -l | sort -nk5

find files recursive (like ls recursif)

find {,./*} -type f

prevent accidents and test your command with echo

echo rm *.txt

command line calculator

calc(){ awk "BEGIN{ print $* }" ;}

Quick command line math

expr 512 \* 7

a function to create a box of '=' characters around a given string.

box() { t="$1xxxx";c=${2:-=}; echo ${t//?/$c}; echo "$c $1 $c"; echo ${t//?/$c}; }

Calculate N!

seq -s* 10 |bc

Run the last command as root:

sudo !!

Join lines

tr "\n" " " < file

Compare directories via diff

diff -rq dirA dirB

Serve current directory tree at http://$HOSTNAME:9000/

python3 -m http.server 9000

Serve mydir at http://$HOSTNAME:8080/

python3 -m http.server -d mydir 8080

change to the previous working directory

cd -

Runs previous command but replacing first time

^foo^bar

Runs previous command replacing foo by bar every time that foo appears

!!:gs/foo/bar

quickly backup or copy a file with bash

cp filename{,.bak}
cp filename{,.`date +%Y%m%d`}

Edit the last or previous command line in an editor then execute

fc [history-number]

Press Any Key to Continue

read -sn 1 -p 'Press any key to continue...';echo

Copy ssh keys to user@host to enable password-less ssh logins.

ssh-copy-id user@host

Copy your ssh public key to a server from a machine that doesn't have ssh-copy-id

cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

Empty a file

> file.txt

Execute a command without saving it in the history

[space]command

Salvage a borked terminal

reset

start a tunnel from some machine's port 80 to your local post 2001

ssh -N -L2001:localhost:80 somemachine

Create a persistent remote Proxy server through an SSH channel

ssh -fND localhost:PORT USER@SERVER

Mount a temporary ram partition

mount -t tmpfs tmpfs /mnt -o size=1024m

Mount folder/filesystem through SSH

sshfs name@server:/path/to/folder /path/to/mount/point

List the size (in human readable form) of all sub folders from the current location

du -h --max-depth=1

List 10 largest directories in current directory

du -hs */ | sort -hr | head

A very simple and useful stopwatch

time read (ctrl-d to stop)

Clear the terminal screen

ctrl-l

Simplest way to get size (in bytes) of a file

du -b filename

Jump to a directory, execute a command and jump back to current dir

(cd /tmp && ls)

Single command through SSH and get the output (command is the last argument)

ssh -t root@167.172.24.25 "date -R"

ssh: change directory while connecting

ssh -t server 'cd /etc && $SHELL'

SSH connection through host in the middle

ssh -t reachable_host ssh unreachable_host

Display the top ten running processes - sorted by memory usage

ps aux | sort -nk +4 | tail

Reboot machine when everything is hanging

<i>[alt]</i> + <i>[print screen/sysrq]</i> + <i>[R]</i> - <i>[S]</i> - <i>[E]</i> - <i>[I]</i> - <i>[U]</i> - <i>[B]</i>

remove empty lines in place with backup

sed -e '/^$/d' -i .bak filewithempty.lines

Close shell keeping all subprocess running

disown -a && exit

check open ports (both ipv4 and ipv6)

sudo netstat -plnt

List programs with open ports and connections

sudo netstat -ntauple

List open IPv4 connections

lsof -Pnl +M -i4

Show established network connections

lsof -i | grep -i estab

List programs with open ports and connections

lsof -i

Show apps that use internet connection at the moment. (Multi-Language)

lsof -P -i -n

Create a script of the last executed command

echo "!!" > foo.sh

Show a curses based menu selector

whiptail --checklist "Simple checkbox menu" 11 35 5 tag item status repeat tags 1

32 bits or 64 bits?

getconf LONG_BIT

Kills a process that is locking a file.

fuser -k filename

Display which distro is installed

cat /etc/issue

Put a console clock in top right corner

while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &

Reuse all parameter of the previous command line

!*

Optimal way of deleting huge numbers of files

find /path/to/dir -type f -delete

Delete all files in a folder that don't match a certain file extension

rm !(*.foo|*.bar|*.baz)

Inserts the results of an autocompletion in the command line

<i>[esc]</i>*

Remove duplicate entries in a file without sorting.

awk '!x[$0]++' «file»

Copy your SSH public key on a remote machine for passwordless login - the easy way

ssh-copy-id username@hostname

Easy and fast access to often executed commands that are very long and complex.

some_very_long_and_complex_command # label

Graphical tree of sub-directories

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'

Graph # of connections for each hosts.

netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'

escape any command aliases

\«command»

Remove all but one specific file

rm -f !(survivior.txt)

Convert seconds to human-readable format

date -d@1234567890

Generate a random password 30 characters long

strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo

Print all the lines between 10 and 20 of a file

sed -n '10,20p' «filename»

Show apps that use internet connection at the moment. (Multi-Language)

ss -p

Processor / memory bandwidthd? in GB/s

dd if=/dev/zero of=/dev/null bs=1M count=32768

Make directory including intermediate directories

mkdir -p a/long/directory/path

Makes the permissions of file2 the same as file1

chmod --reference file1 file2

Remove all files previously extracted from a tar(.gz) file.

tar -tf «file.tar.gz» | xargs rm -r

guillements français ouvrant « et fermants »

SHIFT-CTRL u ab et SHIFT-CTRL u bb

which program is this port belongs to ?

lsof -i tcp:443

Delete the specified line. Useful to fix "ssh host key change" warnings

sed -i 8d ~/.ssh/known_hosts

List only the directories

ls -d */

exit without saving history

alias nh='kill -9 $$'

Show apps that use internet connection at the moment.

lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2

mkdir & cd into it as single command

mkdir /home/foo/doc/bar && cd $_

Bind a key with a command

bind -x '"\C-l":ls -l'

run a bash script in debugging mode

bash -x ./command.sh

A child process which survives the parent's death (for sure)

( command & )

List bash functions defined in .bash_profile or .bashrc

set | fgrep " ()"

find PID of all php processes for user per name, usefull for local server

pstree -p jean | grep php

Kill any process with one command using program name

pkill <name>

kill all php processes for user per name, usefull for local server

pkill -9 -u username php

Kill any process with one command using program name

killall [name]

cat large file to clipboard

cat large.xml | xclip

Create a directory and change into it at the same time

md () { mkdir -p "$@" && cd "$@"; }

Show current working directory of a process

pwdx pid

easily find megabyte eating files or directories

alias dush="du -sm *|sort -n|tail"

Schedule a script or command in x num hours, silently run in the background even if logged out

( ( sleep 2h; your-command your-args ) & )

List all files opened by a particular command

lsof -c mycommand

ROT13 using the tr command

alias rot13="tr a-zA-Z n-za-mN-ZA-M"

Insert the last argument of the previous command

<i>[ESC]</i>.

check open ports

lsof -Pni4 | grep LISTEN

a more compact ls -l

ls -hog

Advanced LS Output using Find for Formatted/Sortable File Stat info

find $PWD -maxdepth 1 -printf '%.5m %10M %#9u:%-9g %#5U:%-5G  [%AD | %TD | %CD]  [%Y] %p\n'

List of commands you use most often

history | awk '{print $2}' | sort | uniq -c | sort -rn | head

All IP connected to my host

netstat -lantp | grep ESTABLISHED |awk '{print $5}' | awk -F: '{print $1}' | sort -u

List your interfaces and MAC addresses

for f in /sys/class/net/*; do echo -e "$(basename $f)\t$(cat $f/address)"; done

Print interface that is up and running

ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'

Search for a package (search by regex)

apt-cache search myregex

show detailed information on a package

apt show package_name

How to know the total number of packages available

apt-cache stats

Purge configuration files of removed packages on debian based systems

sudo aptitude purge `dpkg --get-selections | grep deinstall | awk '{print $1}'`

Copy specific files to another machine, keeping the file hierarchy

tar cpfP - $(find [somedir] -type f -name *.png) | ssh user@host | tar xpfP -

copy from host1 to host2, through your host

ssh root@host1 "cd /somedir/tocopy/ && tar -cf - ." | ssh root@host2 "cd /samedir/tocopyto/ && tar -xf -"

Find broken symlinks

find . -type l ! -exec test -e {} \; -print

Find broken symlinks and delete them

find -L /path/to/check -type l -delete

Find if the command has an alias

type -all mycommand

Rename .JPG to .jpg recursively

find /path/to/images -name '*.JPG' -exec bash -c 'mv "$1" "${1/%.JPG/.jpg}"' -- {} \;

Show a config file without comments

function rcm(){grep -vE '^\s*(#|$)' $1}

create dir tree

mkdir -p doc/{text/,img/{wallpaper/,photos/}}

monitor memory usage

watch vmstat -sSM

Figure out what shell you're running

echo $0

Reuse last parameter

!$

find files containing text

grep -lir "some text" *

List your sudo rights

sudo -l

Infos tables de partition et disques

sudo parted -l

Backup your hard drive with dd

sudo dd if=/dev/sda of=/media/disk/backup/sda.backup

Quick glance at who's been using your system recently

last  | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -c

Find the most recently changed files (recursively)

find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort

Find last reboot time

who -b

Monitor TCP opened connections

watch -n 1 "netstat -tpanl | grep ESTABLISHED"

Ctrl+S Ctrl+Q terminal output lock and unlock

Ctrl+S Ctrl+Q

Number of open connections per ip.

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Add your public SSH key to a server in one command

cat .ssh/id_rsa.pub | ssh hostname 'cat >> .ssh/authorized_keys'

Discovering all open files/dirs underneath a directory

lsof +D mydirname

Ask user to confirm

Confirm() { read -sn 1 -p "$1 [Y/N]? "; [[ $REPLY = [Yy] ]]; }

Show directories in the PATH, one per line

echo $PATH | tr \: \\n

find the process that is using a certain port e.g. port 3000

lsof -P | grep ':3000'

Discovering all open files/dirs underneath a directory

lsof +D mydirname

show debian release info

cat /etc/os-release

view log of debian installed packages

cat /var/log/dpkg.log

Remove today's Debian installed packages

grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq | xargs apt-get -y remove

debian install .deb package

sudo dpkg -i [path/to/.deb file]

debian show all installed packages

dpkg -l

debian show exact name of an installed packages

dpkg –l | grep keyword

debian remove installed package

sudo dpkg --remove [package file]

Make a file not writable / immutable by root

sudo chattr +i myfile

Protect directory from modification and from an overzealous rm -rf *

sudo chattr -R +i dirname

View ~/.ssh/known_hosts key information

ssh-keygen -l -f ~/.ssh/known_hosts

Count files beneath current directory (including subfolders)

find . -type f | wc -l

Use xdg-open to avoid hard coding browser commands

xdg-open http://gmail.com

Quick HTML image gallery from folder contents

find . -iname '*.jpg' -exec echo '<img src="{}">' \; > gallery.html

kill process by name

pkill -x firefox

disable history for current shell session

unset HISTFILE

When was your OS installed?

ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'

Show which programs are listening on TCP and UDP ports

netstat -plunt

Show pid of program

pidof php

Check availability of Websites based on HTTP_CODE

urls=('www.ubuntu.com' 'google.com'); for i in ${urls[@]}; do http_code=$(curl -I -s $i -w %{http_code}); echo $i status: ${http_code:9:3}; done

Get the 10 biggest files/folders for the current direcotry

du -sk * |sort -rn |head

awk using multiple field separators

awk -F "=| "

Execute most recent command containing search string.

!?mystring?

Move items from subdirectories to current directory

find -type f -exec mv {} . \;

Find all dot files and directories

echo .*

currently mounted filesystems in nice layout

column -t /proc/mounts

cat a file backwards

tac myfile.txt

Get a quick list of all user and group owners of files and dirs under the cwd.

find -printf '%u %g\n' | sort | uniq

Remove lines that contain a specific pattern($1) from file($2).

sed -i '/myexpression/d' /path/to/file.txt

Go (cd) directly into a new temp folder

cd "$(mktemp -d)"

Copy a folder tree through ssh using compression (no temporary files)

ssh myhost 'tar -cz /myfolder/mysubfolder' | tar -xvz

Chmod all directories (excluding files)

find public_html/ -type d -exec chmod 755 {} +

Apply permissions only to files, recursif

chmod 644 $(find . -type f)

Create cheap and easy index.html file

for i in *; do echo "<li><a href='$i'>$i</a></li>";  done > index.html

Show 'Hardware path'-style tree of all devices in Linux

sudo lshw -short

print indepth hardware info

sudo dmidecode

See your current RAM frequency

sudo dmidecode | grep -i "current speed"

exit if another instance is running

pidof -x -o $$ ${0##*/} && exit

which process has a port open

watch lsof -i :443

Print sensors data for your hardware

paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'