User Tools

Site Tools


linux:shellcommands

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
linux:shellcommands [2018/05/05 12:44] – [sed] adminlinux:shellcommands [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 371: Line 371:
 </code>  => output:<code> </code>  => output:<code>
 The UNIX operating system. Unix system</code> The UNIX operating system. Unix system</code>
-  * <code bash>+  * Substitute Unix with UNIX in file intro: <code bash>
 sed --in-place 's/Unix/UNIX/g' intro sed --in-place 's/Unix/UNIX/g' intro
-</code> =>  Substitute Unix with UNIX in file intro +</code> 
-  * <code bash>+  Substitute Unix with UNIX<code bash>
 sed 's/Unix/UNIX/g' intro sed 's/Unix/UNIX/g' intro
-</code>  =>  Substitute Unix with UNIX+</code>
   * example with -n option<code bash>   * example with -n option<code bash>
 sed -n '1,2p' intro</code>=> Just print the first 2 lines sed -n '1,2p' intro</code>=> Just print the first 2 lines
-  * <code bash>sed -n '/UNIX/p' intro</code>=> Just print lines containing UNIX+  * Just print lines containing UNIX: <code bash> 
 +sed -n '/UNIX/p' intro 
 +</code>
   * example Deleting Lines<code bash>   * example Deleting Lines<code bash>
 sed '1,2d' intro sed '1,2d' intro
 </code>=> Delete lines 1 and 2 </code>=> Delete lines 1 and 2
-  * <code bash>sed '/UNIX/d' intro</code>=> Delete all lines containing UNIX+  * Delete all lines containing UNIX:<code bash> 
 +sed '/UNIX/d' intro 
 +</code> 
 +  * Delete all characters before string<code bash> 
 +sed 's/.*No Warranty/No Warranty/g' 
 +</code>
 ==== awk ==== ==== awk ====
   # cat server   # cat server
linux/shellcommands.1525524296.txt.gz · Last modified: 2022/10/29 16:15 (external edit)