As I titled,
is there any API available, to determine the default download directory in the Linux?
I am using ubuntu distribution.
Quite late to the party but: There is XDG specification that covers exactly this topic. To get the download directory in shell (script) just run:
$ xdg-user-dir DOWNLOAD
/home/djasa/Downloads
For programs, the location is available in $HOME/.config/user-dirs.dirs
:
$ grep DOWNLOAD .config/user-dirs.dirs
XDG_DOWNLOAD_DIR="$HOME/Downloads"
For more information about XDG, read man pages that man -k xdg
returns to you.
There is no "default download directory" at the level of the OS, though all current distros will create a ~/Downloads
directory for this purpose and most browsers will choose it by default. What are you trying to accomplish?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With