Command Line Interface
Tachyon’s command line interface gives users access to basic file system operations. Invoke the command line utility with the script:
./bin/tachyon tfs
All “path” variables in tfs commands should start with
tachyon://<master node address>:<master node port>/<path>
Or, if no header is provided, the default hostname and port (set in the env file) will be used.
/<path>
List of Operations
Operation | Syntax | Description |
---|---|---|
cat | cat "path" | Print the content of the file to the console. |
count | count "path" | Display the number of folders and files matching the specified prefix in "path". |
ls | ls "path" | List all the files and directories directly under the given path with information such as size. |
lsr | lsr "path" | Recursively list all the files and directories directly under the given path with information such as size. |
mkdir | mkdir "path" | Create a directory under the given path, along with any necessary parent directories. Will fail if the path already exists. |
rm | rm "path" | Remove a file. Will fail if the path is a directory. |
rmr | rmr "path" | Remove a file or directory and all folders and files under that directory. |
tail | tail "path" | Print the last 1KB of the specified file to the console. |
touch | touch "path" | Create a 0 byte file at the specified location. |
mv | mv "source" "destination" | Move a file or directory specified by "source" to a new path "destination". Will fail if "destination" already exists. |
copyFromLocal | copyFromLocal "source path" "remote path" | Copy the specified file to the path specified by "remote path". Will fail if "remote path" already exists. |
copyToLocal | copyToLocal "remote path" "local path" | Copy the specified file from the path specified by "remote source" to a local destination. |
fileinfo | fileinfo "path" | Print the information of the blocks of a specified file. |
location | location "path" | Displays a list of hosts that have the file data. |
report | report "path" | Report to master that a file is lost. |
request | request "path" "dependency ID" | Request the file for a given dependency ID. |
pin | pin "path" | Pins the given file, such that Tachyon will never evict it from memory. If called on a folder, it recursively pins all contained files and any new files created within this folder. |
unpin | unpin "path" | Unpins the given file to allow Tachyon to start evicting it again. If called on a folder, it recursively unpins all contained files and any new files created within this folder. |
free | free "path" | Frees a file or all files under a folder from memory. File/Folder will still be available in underfs |