WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bulk symbolic linking - possible?  (Read 4759 times)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
bulk symbolic linking - possible?
« on: November 03, 2015, 05:08:11 AM »
To have better looking fonts i'm playing around with fontconfig. Among other i have to "ln -s" a lot of files from /etc/conf/avail to /etc.conf.d. It's a PITA to do that one by one, so my question: Is there a way to do that as a bulk?

Thanks a lot in advance!

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: bulk symbolic linking - possible?
« Reply #1 on: November 03, 2015, 05:22:41 AM »
Rarely do i symbolic link more than a couple items at a time. Just did a quick test, however, and my file manager allows me to select multiple items, drag to destination directory and create multiple symbolic links at a time. So yes it's possible but my file manager source code doesn't utilize a single command to bulk link, it just calls the  ln -s  command repeatedly for every item selected. Will be interesting to hear what the experts say, but if you type  ln  into terminal none of the command options relate to bulk linking. There may be packages that provide this feature, but as mentioned for me it's built into my file manager.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: bulk symbolic linking - possible?
« Reply #2 on: November 03, 2015, 05:34:11 AM »
So, you're working with a file manager? Which one? I'm doing all from the commandline up to now. I know Thunar (which i prefer: under slackware on a very powerful Samsung ultrabook i "stole" the crunchbang setup, but i changed openbox with fluxbox, which i largely prefer for its ease of configuration)) and pcmanfm (which is nice for lxde and as desktop creator in combo with openbox but not fluxbox), i tried them both - a bit - here in TCL. But i'm under the impression it's a bit against the philosophy. In the end, i removed them ...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: bulk symbolic linking - possible?
« Reply #3 on: November 03, 2015, 06:03:31 AM »
You can symlink multiple files at once (as long as you don't want to change their names) with emelfm.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: bulk symbolic linking - possible?
« Reply #4 on: November 03, 2015, 06:06:28 AM »
You can symlink multiple files at once (as long as you don't want to change their names) with emelfm.

Thanks. I discovered it can be done by xfe too. Btw, which one out of the fm is the best compromise btween power and weigth?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: bulk symbolic linking - possible?
« Reply #5 on: November 03, 2015, 06:08:29 AM »
Code: [Select]
for i in /some/directory/* ; do ln -s $i /some/other/directory/ ; done

I like Xfe a lot. (;
Download a copy and keep it handy: Core book ;)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11046
Re: bulk symbolic linking - possible?
« Reply #6 on: November 03, 2015, 06:13:37 AM »
ln -s file1 file2 file3 /into/directory
The only barriers that can stop you are the ones you create yourself.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: bulk symbolic linking - possible?
« Reply #7 on: November 03, 2015, 07:44:17 AM »
ln -s file1 file2 file3 /into/directory

But no placeholders ... Correct?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11046
Re: bulk symbolic linking - possible?
« Reply #8 on: November 03, 2015, 02:28:11 PM »
What do you mean by placeholders?
The only barriers that can stop you are the ones you create yourself.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: bulk symbolic linking - possible?
« Reply #9 on: November 03, 2015, 03:46:31 PM »
*

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: bulk symbolic linking - possible?
« Reply #10 on: November 03, 2015, 03:47:08 PM »
Correction, my bad. My File Manager (mfm.tcz) creates sym links like curaga's post above. Not a repeated loop, all at once listing files in a singe command. Of course, they all need to point to the same directory for each action.
Code: [Select]
      asprintf(&command, "mfmexec 'Soft linking...' '%s' 'ln -s -f -v %s %s 2>&1' &", path, file_list, dir_selected);

My File Manager (mfm.tcz) does soft linking but it's beta, just for fun.
Xfe is very nice, very configurable, almost overwhelming to me, yet still lightweight.
emelfm is extremely lightweight and does pretty much anything a basic file manager should.
Would be very surprised if Midnight Commander didn't do linking.
Just started playing around with worker (not in repo), does sym linking too.
Nice to have choices :)


Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: bulk symbolic linking - possible?
« Reply #11 on: November 04, 2015, 11:54:31 AM »
Xfe is very nice, very configurable, almost overwhelming to me, yet still lightweight.
emelfm is extremely lightweight and does pretty much anything a basic file manager should.
Would be very surprised if Midnight Commander didn't do linking.
Just started playing around with worker (not in repo), does sym linking too.
Nice to have choices :)

You're sure? I checked emelfm2 and xfe with htop, and, seems xfe consumes less ram than emelfm2

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: bulk symbolic linking - possible?
« Reply #12 on: November 04, 2015, 12:52:28 PM »
That was emelfm (gtk1) not emelfm2 (gtk2)

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: bulk symbolic linking - possible?
« Reply #13 on: November 04, 2015, 03:53:09 PM »
Total install size of emelfm (gtk1) is .88mb including dependenies, hard to beat considering it's features.
Even Fluff is 1.73mb installed and it doesn't do soft linking.