7.2.24 touch
Create a file or modify attributes of an existing file.
Syntax
touch [ -s num | --size=num ]
[ -t file-type | --type=file-type ]
[ --bs=block-size ]
[ -r { true | false } | --read-only={ true | false }]
file-name
[{ -w | --wallet } wallet-location ]
[{ -T | --trace } trace-level ]
[{ -j | --json } [ --compact ]]
Command Options
The options for the touch
command are:
-
file-name: Specifies the file being created or modified.
-
-s
,--size
: Optionally specifies the size of the file in bytes.The file size can be also specified using suffixes
K
,KB
,M
,MB
,G
,GB
,T
,TB
. The suffix is not case-sensitive. -
-t
,--ftype
: Optionally specifies the Oracle Database file type. The valid values are:ctrl
- control filedata
- data fileolog
- on-line log filealog
- archived log filetemp
- temporary sort fileinit
- initialization parameter filepswd
- password fileflog
- flashback log filectrk
- change tracking file
-
--bs
: Optionally specifies the block size for a new file. -
-r
,--read-only
: Optionally specifies that the file is read-only. When set totrue
, the file contents and metadata cannot be modified. -
-w
,--wallet
: Optionally specifies the path to the Exascale wallet directory. -
-T
,--trace
: Optionally enables tracing, with the trace level (trace-level) set to1
(minimum tracing),2
(medium tracing), or3
(maximum tracing). If the trace level is not specified, then minimum tracing is enabled by default.The trace file is written to the first accessible location in the following list:
-
If the
$ADR_BASE
environment variable is set:$ADR_BASE/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
/var/log/oracle/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
/tmp/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
-
-
-j
,--json
: Displays the output in JSON format. -
--compact
: Displays JSON formatted output in a compact format, without white space and line breaks.
Examples
Example 7-42 Create an Exascale file
Assuming that @my-data/my-file
does not already exist, the following example creates a 1 gigabyte file at @my-data/my-file
.
$ xsh touch --size=1G @my-data/my-file
If the file (@my-data/my-file
) already existed, the command would set the size of the preexisting file to 1 gigabyte.
Related Topics
Parent topic: XSH Command Reference