50 Most Frequently Used UNIX / Linux Commands (With Examples)

Several pearl in 50 Most Frequently Used UNIX / Linux Commands (With Examples)

  • Add line number for all non-empty-lines in a file
    $ sed '/./=' thegeekstuff.txt | sed 'N; s/\n/ /'
  • Remove duplicate lines using awk
    $ awk '!($0 in array) { array[$0]; print }' temp
    

     

  • Print all lines from /etc/passwd that has the same uid and gid
    $awk -F ':' '$3==$4' passwd.txt
    
  • Go to the 143rd line of file
    $ vim +143 filename.txt
    

     

  • Go to the first match of the specified
    $ vim +/search-term filename.txt
    

Delighted

I recently switched my Internet provider choosing Tim.it as I plan to switch to a Fiber To The Cabinet networking. I also moved my mobile subscription under the same bill with a comfy 500 minutes 2gb every 4 weeks. Then after a few days they billed me almost 20€ for a few megabytes of mobile data, less than 20,if I recall correctly. 

I notified one of their “Twitter customer care” men and in less than 2 days they gave me back the undue credit, adding this sweet gift :

Gentile cliente, per scusarci ancora dell’errato addebito nei giorni scorsi, riceverai in regalo 3 GIGA di internet per 3 mesi. Nelle prossime ore un SMS ti confermerĂ  l’attivazione. Info al 409161 o nella sezione MyTIM di TIM.it

Well done! 

Cert for both www and plain domain

Just a note for myself: renew Let’s Encrypt certificate to make it valid for both www and plain domain

You should be able to do that using the command you originally used to obtain the certificate. Add --force-renewal to force the client to get a new certificate even if the current one isn’t close to expiring. Based on your earlier post, this would be something like:

./letsencrypt-auto --apache -d example.me -d www.example.me -d mysql.example.me --force-renewal

Revocation isn’t needed – that’s something you only need to bother with if your private key is compromised.