The Memory Bank

...for memory blanks

Site Tools


bash_one-liners

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
bash_one-liners [2025/09/02 01:04] – created kenbash_one-liners [2026/01/16 03:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== bash one-liners ====== ====== bash one-liners ======
 +
 +To remove everything after and including the final '.' use: ''${var%.*}''\\
 +To remove the last 4 characters from 'string', use: ''new_string=${string::-4}''\\
 +\\
 +===== sed =====
 +\\
 +Substitute any of listed characters with one command
 +<code>
 +sed s'/[":=]/ /g'
 +</code>
 +Brackets mean "any one of".
  
bash_one-liners.1756775058.txt.gz · Last modified: (external edit)