• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How to create a shortcut inside a file.

  • Thread starter Thread starter Andrei Paraschiv
  • Start date Start date
A

Andrei Paraschiv

Guest
How do you create a shortcut that leads to another folder. I do not want to know about home screen app shortcuts. I want a shortcut in /storage/emulated/0 which opens a file located in my sd card. Is this possible, I have searched it up but all I got was home screen shortcuts which I already know about. Also if this is possible, can it be done without having to root my device?
 
It sounds like you want to create a symbolic link. You would do this using a terminal emulator and the "ln" command:

ln -s path_to_target link_name

I would expect you need busybox installed as well as a terminal emulator (you can try without, but if it says it doesn't recognise the command then you do). ln shouldn't require root (as long as you have write access to the filesystem without it) , but most busybox installers do. I did spot one in the Play Store that says it doesn't though, so you may have a chance (I an rooted so cannot test).
 
It still said the same thing:
1n not found
Is there something im missing am I using the wrong applications if so can you recommend any, or is there a problem with the way I put in the command (I used 1n this time instead of In and it did not work)
 
It still said the same thing:
1n not found
Is there something im missing am I using the wrong applications if so can you recommend any, or is there a problem with the way I put in the command (I used 1n this time instead of In and it did not work)

Hi Andrei, welcome to Android Forums :)

Try lowercase l (ell), which Hadron had written - you had used uppercase I (eye), then misread the correction by glc and used numeral 1.

Hopefully it will be 3rd time lucky ;)
 
Last edited:
If busybox is installed and it says that then it means you don't have the permissions to carry out the operation.

If you typed a valid "ln" command that might mean that you need root to create the link where you want it. But if I look at what you said you tried earlier:

> ln -s /storage/sdcard1/ "file name" /storage/emulated/0

there is an error in this command. What you are telling it to do here is create a link called /storage/emulated/0 and make it point to /storage/sdcard1/ "file name". Since /storage/emulated/0 exists, and is not owned by you, the system is quite right to tell you you can't do that (and a good job too, since if it allowed you to you would have replaced the directory tree /storage/emulated/0 with a pointer to a single file - nothing good would come from that!).

What I guess you are trying to do is create a shortcut in /storage/emulated/0 that points to this specific file. So you should be doing something like:

> ln -s /storage/sdcard1/ "file name" /storage/emulated/0/"link name"

where "link name" can be anything you like, as long as it isn't the name of an existing file or folder in /storage/emulated/0. So as long as you don't already have a file called "file name" in /storage/emulated/0" then "link name" = "file name" is the obvious choice, but if you want something different that's also fine.

Do check that the name you want to use isn't already in use before typing the command though. I've worked on Linux systems where the default is to warn you when you are going to overwrite a file and ask whether you mean to do it, but I've also worked on systems where the default is to assume you know what you are doing and just do it without asking. Unless you know what your phone will do if you make a mistake, it's best to check you aren't making one! ;)
 
I realized my mistake which you pointed out before I posted operation not permitted problem, and I made sure there was not already a file there with the same name as my link. Does this mean I have no choice but to root my phone? My command was (in caseI made another begginer mistake) was: ln -s /storage/sdcard1/DraStic /storage/emulated/0/DraStic
Does the link name have to be different from the file name?
 
No, the names don't have to differ - they are in different places so the paths differ anyway.

I just did some tests, and was able to do it without giving my terminal shell root privileges. But I had to play about with file paths a bit. If I went to /sdcard/wherever and tried to create a link there it wouldn't work. If instead I went to /data/media/0/wherever (same location, but using the actual path to it rather than the synonym /sdcard) it did let me create the link. So maybe if you address your drives that way it will work (I didn't try out other alternates, such as /storage/emulated/0, so don't know whether that works for this purpose or not).
 
Thanks for all your help but sadly according to the owner, the busybox no root is a bit limited and to do this you need to root the phone.
Now how do you close a thread?
 
Back
Top Bottom