16.5. Other Commands


This section describes tools that are simpler equivalents to using guestfish to view and edit guest virtual machine disk images.
  • virt-cat is similar to the guestfish download command. It downloads and displays a single file to the guest virtual machine. For example:
    Copy to Clipboard Toggle word wrap
    # virt-cat RHEL3 /etc/ntp.conf | grep ^server
     server	    127.127.1.0	      # local clock
    
  • virt-edit is similar to the guestfish edit command. It can be used to interactively edit a single file within a guest virtual machine. For example, you may need to edit the grub.conf file in a Linux-based guest virtual machine that will not boot:
    Copy to Clipboard Toggle word wrap
    # virt-edit LinuxGuest /boot/grub/grub.conf
    
    virt-edit has another mode where it can be used to make simple non-interactive changes to a single file. For this, the -e option is used. This command, for example, changes the root password in a Linux guest virtual machine to having no password:
    Copy to Clipboard Toggle word wrap
    # virt-edit LinuxGuest /etc/passwd -e 's/^root:.*?:/root::/'
    
  • virt-ls is similar to the guestfish ls, ll and find commands. It is used to list a directory or directories (recursively). For example, the following command would recursively list files and directories under /home in a Linux guest virtual machine:
    Copy to Clipboard Toggle word wrap
    # virt-ls -R LinuxGuest /home/ | less
    
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.