Bash: Permission Denied
Hello! 🤗
When I run the following commands (the responses termux gives are also written btw) I get an annoying error:
cd /storage/emulated/0/Coding/C/
clang HelloWorld.c -o Hi
ls
Termux: HelloWorld.c Hi
./Hi
bash: ./Hi: Permission Denied---------------------------------------- C Code in HelloWorld.c: ---------------------------------------- I have tried using: chmod +x Hi chmod u+x Hi termux-setup-storage ,but none of these work. Can someone please help me? & thanks in advance.
Solution:Jump to solution
Not a bug. Android does not allow executables on shared storage and sdcard. Use termux's home folder for such things.
10 Replies
Solution
Not a bug. Android does not allow executables on shared storage and sdcard. Use termux's home folder for such things.
Isn't it in the data folder?
/storage/emulated/0 is a shared storage.
inside a file with a name similar to com.termux or something?
oh
/data/data/com.termux/files/home is termux's home folder.
how do I move it there tho? is there a command for it? cuz I am not used much to the linux cmd yet
(still learning)
mv
.oh thx
wait lemme try
still says permission denied.
I used:
mv Hi /data/data/com.termux/files/home
cd /data/data/com.termux/files/home
ls ./Hi
Do
chmod +x Hi
...it worked! tysm