I just installed Wget using Termux on my Android. But, when I download a file, I cannot find it's location. Can anyone please tell me where it's located? And how can I change that location to my desired directory?
2 Answers
To quote Izzy,
wget
usually downloads to where you called it from – unless told otherwise using the-O
parameter. So you either firstcd
to the desired directory – or try something likewget -O /sdcard/downloads/foo.zip http://example.com/foo.zip
.
In your case, this directory is /data/data/com.termux/files/home and, as it's inside /data, only root and the files' owner can alter things here.
Since Termux is the owner, though, you can move, copy and delete files and folders inside the abovementioned directory.
Before moving or copying to the internal storage
If you run Android Marshmallow (6.x) or above, run termux-setup-storage
and grant the requested permission to be able to interact with anything inside /storage/emulated/0.
To move files
To move files to e.g. the standard download directory, use the command mv source destination
, replacing source
with the file you wish to move, and destination
with /storage/emulated/0/Download
, which is the default download directory located in your internal storage.
To copy files
To copy files to e.g. the standard download directory, use the command cp source destination
, replacing source
with the file you wish to move, and destination
with /storage/emulated/0/Download
.
To delete files
To delete any file, use rm file
, replacing file
with the file you wish to delete.
To delete directories
To delete an empty directory, use rmdir directory
.
To delete a non-empty directory, use rm -r directory
. This method will delete anything inside the chosen directory.
In both cases, replace directory
with the directory you wish to delete.
Type echo $HOME
in Termux. That is the current wget location.
-
2The HOME variable does not reflect the current location. If OP
cd
ed somewhere else,echo $HOME
would've shown/data/data/com.termux/files/home
nonetheless, thus giving a correct result to a wrong question. To know the current directory, use eitherpwd
orecho $PWD
.– GrimoireJan 26, 2017 at 19:41 -
Yap wget works at working directory. However the screenshot is valid :D– amigoJan 27, 2017 at 4:46
wget
usually downloads to where you called it from – unless told otherwise using the-O
parameter. So you either firstcd
to the desired directory – or try something likewget -O /sdcard/downloads/foo.zip http://example.com/foo.zip
.