8a6ce29c519ead22799d136be5608d1526bea83b
[libguestfs.git] / guestfish-actions.pod
1 =head2 cat
2
3  cat path
4
5 Return the contents of the file named C<path>.
6
7 Note that this function cannot correctly handle binary files
8 (specifically, files containing C<\0> character which is treated
9 as end of string).  For those you need to use the C<guestfs_read_file>
10 function which has a more complex interface.
11
12 =head2 list-devices
13
14  list-devices
15
16 List all the block devices.
17
18 The full block device names are returned, eg. C</dev/sda>
19
20
21 =head2 list-partitions
22
23  list-partitions
24
25 List all the partitions detected on all block devices.
26
27 The full partition device names are returned, eg. C</dev/sda1>
28
29 This does not return logical volumes.  For that you will need to
30 call C<guestfs_lvs>.
31
32 =head2 ll
33
34  ll directory
35
36 List the files in C<directory> (relative to the root directory,
37 there is no cwd) in the format of 'ls -la'.
38
39 This command is mostly useful for interactive sessions.  It
40 is I<not> intended that you try to parse the output string.
41
42 =head2 ls
43
44  ls directory
45
46 List the files in C<directory> (relative to the root directory,
47 there is no cwd).  The '.' and '..' entries are not returned, but
48 hidden files are shown.
49
50 This command is mostly useful for interactive sessions.  Programs
51 should probably use C<guestfs_readdir> instead.
52
53 =head2 lvs
54
55  lvs
56
57 List all the logical volumes detected.  This is the equivalent
58 of the L<lvs(8)> command.
59
60 This returns a list of the logical volume device names
61 (eg. C</dev/VolGroup00/LogVol00>).
62
63 See also C<guestfs_lvs_full>.
64
65 =head2 lvs-full
66
67  lvs-full
68
69 List all the logical volumes detected.  This is the equivalent
70 of the L<lvs(8)> command.  The "full" version includes all fields.
71
72 =head2 mount
73
74  mount device mountpoint
75
76 Mount a guest disk at a position in the filesystem.  Block devices
77 are named C</dev/sda>, C</dev/sdb> and so on, as they were added to
78 the guest.  If those block devices contain partitions, they will have
79 the usual names (eg. C</dev/sda1>).  Also LVM C</dev/VG/LV>-style
80 names can be used.
81
82 The rules are the same as for L<mount(2)>:  A filesystem must
83 first be mounted on C</> before others can be mounted.  Other
84 filesystems can only be mounted on directories which already
85 exist.
86
87 The mounted filesystem is writable, if we have sufficient permissions
88 on the underlying device.
89
90 The filesystem options C<sync> and C<noatime> are set with this
91 call, in order to improve reliability.
92
93 =head2 pvs
94
95  pvs
96
97 List all the physical volumes detected.  This is the equivalent
98 of the L<pvs(8)> command.
99
100 This returns a list of just the device names that contain
101 PVs (eg. C</dev/sda2>).
102
103 See also C<guestfs_pvs_full>.
104
105 =head2 pvs-full
106
107  pvs-full
108
109 List all the physical volumes detected.  This is the equivalent
110 of the L<pvs(8)> command.  The "full" version includes all fields.
111
112 =head2 sync
113
114  sync
115
116 This syncs the disk, so that any writes are flushed through to the
117 underlying disk image.
118
119 You should always call this if you have modified a disk image, before
120 calling C<guestfs_close>.
121
122 =head2 touch
123
124  touch path
125
126 Touch acts like the L<touch(1)> command.  It can be used to
127 update the timestamps on a file, or, if the file does not exist,
128 to create a new zero-length file.
129
130 =head2 vgs
131
132  vgs
133
134 List all the volumes groups detected.  This is the equivalent
135 of the L<vgs(8)> command.
136
137 This returns a list of just the volume group names that were
138 detected (eg. C<VolGroup00>).
139
140 See also C<guestfs_vgs_full>.
141
142 =head2 vgs-full
143
144  vgs-full
145
146 List all the volumes groups detected.  This is the equivalent
147 of the L<vgs(8)> command.  The "full" version includes all fields.
148