Command Line Utilities: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
* --no-p: this will disable permissions synchronization.
* --no-p: this will disable permissions synchronization.
* --no-o: this will disable owner synchronization.
* --no-o: this will disable owner synchronization.
== cpio ==
* This seems to be something similar to tar.
* Allows you to do nice stuff like
find . -name '*.txt' print0 | cpio -o -0 | ssh elvanor@otherbox 'cd dirB && cpio -iduv -0'
This would copy the *.txt files to another box, preserving the directory hierarchy.


== Tricks and tips ==
== Tricks and tips ==

Revision as of 15:51, 10 January 2008

This is a collection of random useful command line tools.

  • To obtain the space available on a HD: df -h

rsync

  • --no-p: this will disable permissions synchronization.
  • --no-o: this will disable owner synchronization.

cpio

  • This seems to be something similar to tar.
  • Allows you to do nice stuff like
find . -name '*.txt' print0 | cpio -o -0 | ssh elvanor@otherbox 'cd dirB && cpio -iduv -0'

This would copy the *.txt files to another box, preserving the directory hierarchy.

Tricks and tips

  • Redirecting all outputs to a file:
foo &> bar

To redirect only stderr:

foo 2> bar