databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

dbfs ls doesn't have enough options - like the timestamp

Open meetchandan opened this issue 6 years ago • 4 comments

➜ ~ 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

meetchandan avatar Feb 11 '19 05:02 meetchandan

No response yet, it looks like. Were you able to find any "workarounds"?

CharlesAydin avatar Jan 19 '22 20:01 CharlesAydin

nope, nothing yet

meetchandan avatar Jan 19 '22 20:01 meetchandan

If we have that option, it will be good to get the recent files to identify.

itsmenandess avatar Oct 11 '22 19:10 itsmenandess

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.

mereldawu avatar Nov 24 '22 21:11 mereldawu