linux:shellcommands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:shellcommands [2017/01/12 02:12] – external edit 127.0.0.1 | linux:shellcommands [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 29: | Line 29: | ||
* convert unixtime< | * convert unixtime< | ||
date -d @1098181096 | date -d @1098181096 | ||
- | </ | + | </ |
+ | * sync time:< | ||
+ | ntpdate | ||
+ | </ | ||
===== file and directory commands ===== | ===== file and directory commands ===== | ||
==== dirname ==== | ==== dirname ==== | ||
Line 358: | Line 361: | ||
* original = a regular expression describing the word to replace (or just the word itself) | * original = a regular expression describing the word to replace (or just the word itself) | ||
* new = the text to replace it with | * new = the text to replace it with | ||
- | *g = global (i.e. replace all and not just the first occurrence) | + | * g = global (i.e. replace all and not just the first occurrence) |
- | Below are some basic examples: | + | Below are some basic examples |
- | * Example search | + | |
cat intro | cat intro | ||
+ | </ | ||
The Unix operating system. Unix system | The Unix operating system. Unix system | ||
- | + | </ | |
- | sed ' | + | * Substitute Unix with UNIX: <code bash> |
- | The UNIX operating system. Unix system | + | sed ' |
- | + | </ | |
- | sed --in-place ' | + | The UNIX operating system. Unix system</ |
- | + | * Substitute Unix with UNIX in file intro: <code bash> | |
- | sed ' | + | sed --in-place ' |
+ | </code> | ||
+ | * Substitute Unix with UNIX<code bash> | ||
+ | sed ' | ||
</ | </ | ||
* example with -n option< | * example with -n option< | ||
- | sed -n ' | + | sed -n ' |
- | => Just print the first 2 lines | + | * Just print lines containing UNIX: <code bash> |
sed -n '/ | sed -n '/ | ||
- | => Just print lines containing UNIX | + | </code> |
* example Deleting Lines< | * example Deleting Lines< | ||
sed ' | sed ' | ||
- | => Delete lines 1 and 2 | + | </ |
+ | * Delete all lines containing UNIX:< | ||
sed '/ | sed '/ | ||
- | => Delete all lines containing UNIX | + | </code> |
+ | * Delete all characters before string< | ||
+ | sed ' | ||
</ | </ | ||
==== awk ==== | ==== awk ==== | ||
Line 548: | Line 555: | ||
==== rsync ==== | ==== rsync ==== | ||
( rsync is a program that behaves in much the same way that rcp does, but has many more options and uses the rsync | ( rsync is a program that behaves in much the same way that rcp does, but has many more options and uses the rsync | ||
- | The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network connection, using an efficient checksum-search algorithm described in the technical report that accompanies | + | The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network connection, using an efficient checksum-search algorithm described in the technical report that accompanies |
+ | * rsync in local<code bash> | ||
rsync -avz | rsync -avz | ||
+ | </ | ||
+ | * rsync to remote host< | ||
+ | rsync -avz --exclude=" | ||
</ | </ | ||
==== rsync on windows ==== | ==== rsync on windows ==== |
linux/shellcommands.1484187177.txt.gz · Last modified: 2025/03/16 21:11 (external edit)