databricks-cli
databricks-cli copied to clipboard
dbfs ls doesn't have enough options - like the timestamp
➜ ~ dbfs ls -h
Usage: dbfs ls [OPTIONS] [DBFS_PATH]...
List files in DBFS.
Options:
--absolute Displays absolute paths.
-l Displays full information including size and file type.
--debug Debug Mode. Shows full stack trace on error.
--profile TEXT CLI connection profile to use. The default profile is "DEFAULT"
-h, --help Show this message and exit.
-l is the only additional option which gives the size and file type
but there is no option to know the time at which the file was created/updated
would be good to have a flag like -t
dbfs ls -t
which will give the timestamp details of the files
No response yet, it looks like. Were you able to find any "workarounds"?
nope, nothing yet
If we have that option, it will be good to get the recent files to identify.
As a workaround, the -l
option gives an epoch time.
I get something like this in return for dbfs fs ls dbfs:/user/filepath -l
:
dir 0 my_file_name 1667744151000
And then you can use date -d @1667744151
to get Sun 06 Nov 2022 02:15:51 PM UTC
But it is very clunky, if we can have -lt that ranks the created/modified datetime would be great.