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