One liners

From Playing with linux...
Revision as of 08:04, 14 October 2016 by Pverha10 (talk | contribs) (Created page with "== sed == Replace all enters with spaces with sed. <pre> sed ':a;N;$!ba;s/\n/ /g' </pre> <br> Replace all uppercase letters with lowercase with sed. <pre> sed -e 's/\(.*\)/\L...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

sed

Replace all enters with spaces with sed.

sed ':a;N;$!ba;s/\n/ /g'


Replace all uppercase letters with lowercase with sed.

sed -e 's/\(.*\)/\L\1/'

The same with tr

tr '[:upper:]' '[:lower:]'


Powershell

One liner powershell command to uninstall the application 'Linphone'.

C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -command "& {$app = Get-WmiObject -Class Win32_Product -Filter \"Name = 'Linphone'\"; $app.Uninstall() }"