Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
help:general_linux:linux_advanced [2016/05/18 14:03] jebailie |
help:general_linux:linux_advanced [2016/05/18 14:13] jebailie |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Linux Commands : advanced | + | ===== Linux Commands : file - search / replace |
For the following cmds, the // | For the following cmds, the // | ||
< | < | ||
Line 9: | Line 9: | ||
==== grep ==== | ==== grep ==== | ||
- | : | + | " |
+ | |||
+ | * Good for searching a file for a certain pattern | ||
< | < | ||
user@tim:~$ grep --help | user@tim:~$ grep --help | ||
Line 26: | Line 28: | ||
==== awk ==== | ==== awk ==== | ||
- | : | + | " |
- | : | + | * good for printing columnar data, note that the field separator (between the columns) can be anything (space, tab, colon, etc) |
< | < | ||
user@tim:~$ cat test.file |awk ' | user@tim:~$ cat test.file |awk ' | ||
Line 38: | Line 40: | ||
==== sed ==== | ==== sed ==== | ||
- | : | + | " |
< | < | ||
user@tim:~$ sed s/cat/lion/ test.file | user@tim:~$ sed s/cat/lion/ test.file |