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

Both sides previous revisionPrevious revision
Next revision
Previous revision
bash_one-liners [2025/09/02 04:42] 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 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.1756788146.txt.gz · Last modified: (external edit)