Mostrando postagens com marcador regex. Mostrar todas as postagens
Mostrando postagens com marcador regex. Mostrar todas as postagens

Show only repeated entries

show only repeated entries

echo -e 'a\nb\nc\na' | sort | uniq -D

Get last field using cut

get last field using cut

echo 'www.google.com' | rev | cut -d'.' -f1 | rev

Filter last occurrence on file


filter last occurrence containing the DHCP string
tac /var/log/syslog | grep -m 1 'DHCP'

filter 3 lines between the last occurrence containing the err or warn string
tac /var/log/syslog | egrep -m 1 -C 3 'err|warn'

Regex to math with range numbers


regex to match 10 to 15 like: 17:[10-15]
echo '17:11' | egrep '17:(10|11|12|13|14|15)'

Apt only upgrade selected packages

 apt list --upgradable | cut -d"/" -f1 > /tmp/apt pico /tmp/apt cat /tmp/apt | tr "\n" " " apt install --on...

Mais vistos