Chapter 6. Command Line Tool

Table of Contents

6.1. Overview
6.2. TASCMD Execution
6.3. TASCMD Commands
6.3.1. cd
6.3.2. du
6.3.3. exit
6.3.4. help
6.3.5. ls
6.3.6. lsds
6.3.7. pwd
6.3.8. rm
6.3.9. cp, cpfromlocal, cptolocal

This chapter describes how to use TASCMD, a command line tool, to query and manage files stored in a disk space.

6.1. Overview

TASCMD commands can be used to query disk spaces and query and manage files stored in a disk space. It can also be used to save a file from a local directory to a disk space and vice versa.

When a TASCMD command is executed, TASCMD accesses the TAS instance and requests necessary data or jobs.

6.2. TASCMD Execution

When executing TASCMD, specify connection information for the target TAS instance as follows:

[Example 6.1] TASCMD Execution Parameters

tbascmd {port}

$ tbascmd 52000
ASCMD 6

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

ASCMD>


TASCMD connects to the local TAS instance through an entered port number. The port number must be entered, and the TAS instance must booted before executing TAS and its command.

6.3. TASCMD Commands

The following describes each TASCMD command.

CommandDescription
cdChanges the current path.
duDisplays the total disk space occupied by the files and directories in the specified path, or the total capacity of the diskspaces.
exitTerminates TASCMD.
helpDisplays help about TASCMD commands.
lsDisplays the list of files and directories in the specified path, or disk spaces.
lsdsDisplays the detailed list of disk spaces.
pwdDisplays the current path.
rmRemoves TAS files.
cpCreates a new TAS file by copying a TAS file.
cpfromlocalCreates a new TAS file by copying a local file.
cptolocalCreates a local file by copying a TAS file.

A file name or path option can be specified as absolute or relative path.

  • Absolute path

    Starts with the '+' symbol followed by the disk space name and path in the disk space.

    [Example 6.2] Absolute Path Example

    current path = +DS0
    ASCMD> cd +DS0/d1/sample
    current path = +DS0/d1/sample

  • Relative path

    Path relative to the current path. It is combined with the current path for use in a command.

    [Example 6.3] Relative Path Example

    current path = +DS0
    ASCMD> cd d1/sample
    current path = +DS0/d1/sample

    The following symbols can be used in a relative path.

    SymbolDescription
    "."Current path.
    ".."Parent path. If the last '/' in a path or the current path is a disk space, this indicates the top-level path ('+').

    Additional path can be appended after a "." or "..".

    [Example 6.4] Relative Path Symbol Example

    current path = +DS0/d1
    ASCMD> cd ./sample
    current path = +DS0/d1/sample
    ASCMD> cd ../example
    current path = +DS0/d1/example


6.3.1. cd

Changes the current path.

  • Usage

    cd {path}
    OptionDescription
    pathPath to which the current path is changed, if it exists.

6.3.2. du

Displays the total disk space occupied by the files and directories in the specified path, or the total capacity of the diskspaces. If the top-level path (+) is specified, the total and free sizes of disk spaces are displayed.

  • Usage

    ls [-a] [path]
    OptionDescription
    -aDisplays the disk space occupied by all files of the subdirectories in the specified path.
    pathPath (optional). If not specified, the current path is used.
  • Example

    The following example displays the size of files and their size adjusted for mirroring.

    current path = +DS0/d0
    ASCMD> du
                File_name              Used_mb      Mirror used mb
                   f5.txt                   12                  24
                   f6.txt                    2                   4
                   f8.txt                    9                  18
    
                 Total mb                   23                  46

    The following example displays the total and free sizes of disk spaces.

    current path = +
    ASCMD> du
    diskspace name                              Total_mb   Free_mb
    DS0                                             3069       286
    diskspace name                              Total_mb   Free_mb
    DS1                                             3069      2782
    diskspace name                              Total_mb   Free_mb
    DS2                                             3069      2720

6.3.3. exit

Terminates TASCMD.

ASCMD> exit

6.3.4. help

Displays help about TASCMD commands. If a command is not specified, help is displayed for all commands.

ASCMD> help

6.3.5. ls

Displays the list of files and directories in the specified path, or disk spaces. If the top-level path (+) is specified, a disk space list is displayed.

  • Usage

    ls [-a] [path]

    OptionDescription
    -aDisplays the list of all files of the subdirectories in the specified path.
    pathPath (optional). If not specified, the current path is used.
  • Example

    The following example displays a list of files.

    current path = +DS0/d0
    ASCMD> ls
    File_name
    f5.txt
    f6.txt
    f8.txt  

    The following example displays a list of disk spaces.

    current path = +
    ASCMD> ls
    DS0
    DS1
    DS2     

6.3.6. lsds

Displays the detailed list of disk spaces. The information includes the disk space number, name, and status, redundancy level, sector size, meta block size, size allocated on disk, total size, and free size.

  • Usage

    lsds
  • Example

    ASCMD> lsds
    ===============================================================
    Diskspace no.  Diskspace name
    0              DS0
    Status         Redun_type
    MOUNT          NORMAL
    Sector_size    Meta_blksize   au_size
    512            8192           1048576
    Total_mb       Free_mb
    3069           286
    ===============================================================
    Diskspace no.  Diskspace name
    1              DS1
    Status         Redun_type
    MOUNT          NORMAL
    Sector_size    Meta_blksize   au_size
    512            8192           1048576
    Total_mb       Free_mb
    3069           2782
    ===============================================================
    ...     

6.3.7. pwd

Displays the current path.

  • Usage

    pwd
  • Example

    ASCMD> pwd
    current path: +DS0/d0

6.3.8. rm

Removes TAS files.

  • Usage

    rm {files}

    OptionDescription
    filesPath and name of file(s) to remove. One or more files can be specified.
  • Example

    current path = +DS0/d0
    ASCMD> ls
    File_name
    f5.txt
    f6.txt
    f8.txt
    ASCMD> rm f5.txt
    rm complete: +DS0/d0/f5.txt
    ASCMD> ls
    File_name
    f6.txt
    f8.txt  

6.3.9. cp, cpfromlocal, cptolocal

cp creates a new TAS file by copying an existing TAS file, pfromlocal creates a new TAS file by copying a local file, and cptolocal creates a local file by copying an existing TAS file. Each command also displays the copied file size, time taken to copy the file, and speed. If the specified new file name already exists, an error message is displayed without copying the file.

  • Usage

    cp {infile} {outfile}
    cpfromlocal {infile} {outfile}
    cptolocal {infile} {outfile}

    OptionDescription
    infileSource file name.
    outfileNew file name.

  • Example

    current path = +DS0/d0
    ASCMD> du
    File_name              Used_mb      Mirror used mb
       f6.txt                    2                   4
       f8.txt                    9                  18
    
     Total mb                   11                  22
    ASCMD> cp f6.txt f5.txt
    2097152 bytes (2.00 MB) copied, 0.079874 s, 26.255753 MB/s
    ASCMD> du
    File_name              Used_mb      Mirror used mb
       f5.txt                    2                   4
       f6.txt                    2                   4
       f8.txt                    9                  18
    
     Total mb                   13                  26