Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Listing Files and Directories

    You can view the system’s directory structure as well as individual files by issuing the file commands in operational mode.

    The user’s home directory is the default directory for most of the SRC software commands that require a filename.

    Note: You can change the default directory by using the set cli directory command.

    • To view a list of the file commands, type the following:
      user@host> file ?
      Possible completions:
        archiveArchive files from the system (local)
        checksumCalculate file checksum
        compareCompare files (local)
        copyCopy files
        deleteDelete a file (local)
        listList files (local)
        renameRename a file (local)
        showShow file contents
      user@host> file 
    • Use the list option to see the directory structure. For example, to show the files located in your home directory:
      user@host> file list
      initial.cfg
      install.log
      install.log.syslog
    • To view the contents of other file directories, specify the directory location. For example:
      user@host> file list /opt/UMC/
      acp
      agent
      cli
      editor
      idp
      jdb
      jps
      jre
      licsvr
      net-snmp
      nic
      pom
      redir
      sae
      smg
      webadm
    • You can also use the CLI context-sensitive help system to locate a directory. For example:
      user@host> file list /
      ?
      Possible completions:
        <path>Path to list
        /.autofsckSize: 0, Last changed: Sep 19, 2006 1:36 PM
        /altroot/Last changed: Sep 19, 2006 1:22 PM
        /bin/Last changed: Sep 19, 2006 1:27 PM
        /boot/Last changed: Sep 19, 2006 1:25 PM
        /dev/Last changed: Sep 19, 2006 1:36 PM
        /etc/Last changed: Sep 19, 2006 2:42 PM
        /home/Last changed: Feb 18, 2005 4:26 AM
        /initrd/Last changed: Feb 18, 2005 4:26 AM
        /lib/Last changed: Sep 19, 2006 1:26 PM
        /lib64/Last changed: Sep 19, 2006 1:26 PM
        /lost+found/Last changed: Sep 19, 2006 1:22 PM
        /media/Last changed: Sep 19, 2006 1:36 PM
        /misc/Last changed: Aug 15, 2006 8:33 PM
        /mnt/Last changed: Feb 18, 2005 4:26 AM
        /net/Last changed: Sep 19, 2006 1:36 PM
        /opt/Last changed: Sep 19, 2006 1:27 PM
        /proc/Last changed: Sep 19, 2006 1:36 PM
        /root/Last changed: Sep 19, 2006 6:44 PM
        /sbin/Last changed: Sep 19, 2006 1:26 PM
        /selinux/Last changed: Sep 19, 2006 1:36 PM
        /srv/Last changed: Feb 18, 2005 4:26 AM
        /sys/Last changed: Sep 19, 2006 1:36 PM
        /tmp/Last changed: Sep 19, 2006 6:46 PM
        /usr/Last changed: Sep 19, 2006 1:24 PM
        /var/Last changed: Sep 19, 2006 1:36 PM
      user@host> file list /var/?
      Possible completions:
        <path>Path to list
        /var/UMC/Last changed: Sep 19, 2006 1:28 PM
        /var/account/Last changed: Sep 19, 2006 1:25 PM
        /var/acp/Last changed: Sep 19, 2006 1:27 PM
        /var/cache/Last changed: Sep 19, 2006 1:26 PM
        /var/crash/Last changed: Sep 19, 2006 1:25 PM
        /var/db/Last changed: Sep 19, 2006 1:26 PM
        /var/empty/Last changed: Sep 19, 2006 1:26 PM
        /var/home/Last changed: Sep 19, 2006 6:44 PM
        /var/lib/Last changed: Sep 19, 2006 1:36 PM
        /var/local/Last changed: Feb 18, 2005 4:26 AM
        /var/lock/Last changed: Sep 19, 2006 1:36 PM
        /var/log/Last changed: Sep 19, 2006 2:41 PM
        /var/lost+found/Last changed: Sep 19, 2006 1:22 PM
        /var/mail/Last changed: Feb 18, 2005 4:26 AM
        /var/net-snmp/Last changed: Sep 19, 2006 6:44 PM
        /var/nis/Last changed: Feb 18, 2005 4:26 AM
        /var/opt/Last changed: Feb 18, 2005 4:26 AM
        /var/preserve/Last changed: Feb 18, 2005 4:26 AM
        /var/run/Last changed: Sep 19, 2006 6:44 PM
        /var/spool/Last changed: Sep 19, 2006 1:26 PM
        /var/tmp/Last changed: Sep 19, 2006 1:28 PM
        /var/yp/Last changed: Sep 19, 2006 1:26 PM
    • You can also display the contents of a file. For example:
      user@host> file show install.log
      
      Installing 309 packages
      Installing chkconfig-1.3.13.4-1.x86_64.
      Installing ethtool-1.8-4.x86_64.
      Installing hdparm-5.7-2.x86_64.
      Installing hwdata-0.146.22.EL-1.noarch.
      Installing iputils-20020927-18.EL4.3.x86_64.
      Installing libgcc-3.4.6-3.i386.
      Installing libgcc-3.4.6-3.x86_64.
      Installing mingetty-1.07-3.x86_64.
      Installing mktemp-1.5-20.x86_64.
      Installing redhat-logos-1.1.26-1.junosx.noarch.
      Installing rootfiles-8-1.noarch.
      Installing setserial-2.17-17.x86_64.
      . . . 

    Modified: 2012-11-23