Archive for the tag 'Renaming'

SBDavid

Renaming a Volume Group

Renaming a Volume Group

Use the vgrename command to rename an existing volume group.

Either of the following commands renames the existing volume group vg02 to my_volume_group

# vgrename /dev/vg02 /dev/my_volume_group

or

# vgrename vg02 my_volume_group
SBDavid

Renaming Files

Renaming Files

To rename all files in a directory and add a new extension the xargs command can be used:

ls | xargs -t -i mv {} {}.renamed

xargs reads each item from the ls ouput and executes the mv command. The ‘-i’ option tells xargs to replace ‘{}’ with the name of each item. The ‘-t’ option instructs xargs to print the command before executing it.