diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-04-05 17:44:41 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-04-11 11:09:10 +0100 |
commit | ee993d1a4d63136ccbadb6f90068fd499bf80dc5 (patch) | |
tree | 39b10f1c5ddaed3936070a8733816242aed27741 | |
parent | 7ef60bb65dbed22be567166fc97dffdd0d0e97e6 (diff) | |
download | libguestfs-ee993d1a4d63136ccbadb6f90068fd499bf80dc5.tar.gz libguestfs-ee993d1a4d63136ccbadb6f90068fd499bf80dc5.tar.xz libguestfs-ee993d1a4d63136ccbadb6f90068fd499bf80dc5.zip |
cat, edit: Reference guestfish equivalent commands in the manual pages.
(cherry picked from commit 4de124debf181ff6af38617b80c2355627e38d35)
-rwxr-xr-x | cat/virt-cat.pod | 28 | ||||
-rwxr-xr-x | tools/virt-edit | 50 |
2 files changed, 72 insertions, 6 deletions
diff --git a/cat/virt-cat.pod b/cat/virt-cat.pod index bb3af2b3..68402463 100755 --- a/cat/virt-cat.pod +++ b/cat/virt-cat.pod @@ -27,7 +27,7 @@ directory (starting with '/'). C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-edit>. For more complex cases you should look at the -L<guestfish(1)> tool. +L<guestfish(1)> tool (see L</USING GUESTFISH> below). =head1 EXAMPLES @@ -164,6 +164,30 @@ name as a guest. For compatibility the old style is still supported. +=head1 USING GUESTFISH + +L<guestfish(1)> is a more powerful, lower level tool which you can use +when C<virt-cat> doesn't work. + +Using C<virt-cat> is approximately equivalent to doing: + + guestfish --ro -i -d domname download file - + +where C<domname> is the name of the libvirt guest, and C<file> is the +full path to the file. Note the final C<-> (meaning "output to +stdout"). + +The command above uses libguestfs's guest inspection feature and so +does not work on guests that libguestfs cannot inspect, or on things +like arbitrary disk images that don't contain guests. To display a +file from a disk image directly, use: + + guestfish --ro -a disk.img -m /dev/sda1 download file - + +where C<disk.img> is the disk image, C</dev/sda1> is the filesystem +within the disk image to edit, and C<file> is the full path to the +file. + =head1 SHELL QUOTING Libvirt guest names can contain arbitrary characters, some of which @@ -184,7 +208,7 @@ Richard W.M. Jones L<http://people.redhat.com/~rjones/> =head1 COPYRIGHT -Copyright (C) 2010 Red Hat Inc. +Copyright (C) 2010-2011 Red Hat Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tools/virt-edit b/tools/virt-edit index ad45582f..393028fc 100755 --- a/tools/virt-edit +++ b/tools/virt-edit @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # virt-edit -# Copyright (C) 2009-2010 Red Hat Inc. +# Copyright (C) 2009-2011 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,8 +52,13 @@ you from doing this, but doesn't catch all cases. C<virt-edit> is a command line tool to edit C<file> where C<file> exists in the named virtual machine (or disk image). -If you want to just view a file, use L<virt-cat(1)>. For more complex -cases you should look at the L<guestfish(1)> tool. +If you want to just view a file, use L<virt-cat(1)>. + +For more complex cases you should look at the L<guestfish(1)> tool +(see L</USING GUESTFISH> below). + +C<virt-edit> cannot be used to create a new file, nor to edit +multiple files. L<guestfish(1)> can do that and much more. =head1 EXAMPLES @@ -327,6 +332,43 @@ file): my $m = $_; chomp $m; $m =~ /some text$/ +=head1 USING GUESTFISH + +L<guestfish(1)> is a more powerful, lower level tool which you can use +when C<virt-edit> doesn't work. + +Using C<virt-edit> is approximately equivalent to doing: + + guestfish --rw -i -d domname edit /file + +where C<domname> is the name of the libvirt guest, and C</file> is the +full path to the file. + +The command above uses libguestfs's guest inspection feature and so +does not work on guests that libguestfs cannot inspect, or on things +like arbitrary disk images that don't contain guests. To edit a file +on a disk image directly, use: + + guestfish --rw -a disk.img -m /dev/sda1 edit /file + +where C<disk.img> is the disk image, C</dev/sda1> is the filesystem +within the disk image to edit, and C</file> is the full path to the +file. + +C<virt-edit> cannot create new files. Use the guestfish commands +C<touch>, C<write> or C<upload> instead: + + guestfish --rw -i -d domname touch /newfile + + guestfish --rw -i -d domname write /newfile "new content" + + guestfish --rw -i -d domname upload localfile /newfile + +C<virt-edit> cannot edit multiple files, but guestfish can +do it like this: + + guestfish --rw -i -d domname edit /file1 : edit /file2 + =head1 ENVIRONMENT VARIABLES =over 4 @@ -365,7 +407,7 @@ Richard W.M. Jones L<http://people.redhat.com/~rjones/> =head1 COPYRIGHT -Copyright (C) 2009-2010 Red Hat Inc. +Copyright (C) 2009-2011 Red Hat Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by |