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
    

windows-subsystem-for-linuxWindows Subsystem for Linux

Windows Subsystem for Linux (WSL) is a compatibility layer for running Linuxbinary executables (in ELF format) natively on Windows 10. Microsoft and Canonical partnered together to enable a genuine UbuntuTrusty Tahr image to be downloaded and extracted to the user’s local machine, and for the tools and utilities contained within that image to run natively on top of the WSL.

Some people may say that we’re at step four:

  1. First they ignore you,
  2. Then they laugh at you,
  3. Then they fight you,
  4. Then you win.

I’m not that sure. The once-dark-knight doesn’t look that dangerous these days. The evil overlord is now another.

Continue reading