[-] skaarl@feddit.nl 2 points 1 week ago

Yea, I just came back to say this. Since cp overwrites by default (I tried copying first before trying moving) and each folder has files named index001 index002 etc then then folder where they all go has only ONE of index001.html, ONE of index002.html etc. So I think what I need to do is find each html file, rename it with a unique integer in front of the name, move it to the common folder.

[-] skaarl@feddit.nl 2 points 1 week ago

Ok, thanks for the tip. I'm still getting used to Lemmy.

I ended up using

for f in *; do find ./"$f" -type f | sort | tail -n 2 | xargs -n 1 rm; done

and it worked perfectly. For the bonus question, I'm moving the html files from 127 subfolders. They are the only content of the subfolders. I want to prepend an integer to each and copy them to a different folder, so instead of

  • folder1/file1
  • folder1/file2
  • folder2/file1
  • folder2/file2
  • folder2/file3

I'll have

  • 001file1
  • 002file2
  • 003file1
  • 004file2
  • 005file3
[-] skaarl@feddit.nl 1 points 1 week ago* (last edited 1 week ago)

๐Ÿ˜๐Ÿ˜๐Ÿ˜๐Ÿ˜ thanks harsh!! I'll study this and report back. I really appreciate your time and effort. There is a lot to learn here, and actually the padding is on my list of things to learn, so thank you sensei! As to your question about the integers, the files need to be in alphabetical order before getting the integer prepended to them, so like

  • folder1/file1
  • folder1/file2
  • folder2/file1
  • folder2/file2
  • folder2/file3

turns to

  • folder1/001file1
  • folder1/002file2
  • folder2/003file1
  • folder2/004file2
  • folder2/005file3

that way in the folder when it's all said and done I'll have

  • 001file1
  • 002file2
  • 003file1
  • 004file2
  • 005file3

I'll check if your method works out of the box for that or if I have to use the sort function like you showed me last time. Thanks again!

[-] skaarl@feddit.nl 1 points 1 week ago

Thanks so much harsh!!! I will study this and hit Enter after I understand it.

Thanks again, that's epic.

[-] skaarl@feddit.nl 1 points 1 week ago* (last edited 1 week ago)

Yea that must be it! It's spitting out just the file name and not the whole path. There is only 1 level of depth, so I want to remove

  • ./folder1/file 3
  • ./folder1/file4
  • ./folder2/file11
  • ./folder2/file12

so how do I get the whole path into xargs? I tried xargs "$f"/ but fortunately that didn't work because it was trying to delete all the directories lmao XD

[-] skaarl@feddit.nl 1 points 1 week ago

Oh I see, lol. Now I'm getting "Cannot remove: No such file or directory" all the way down! The files are there, I see them, they come up in the terminal, but for some reason xargs rm does not want to delete them. When I put the -f flag, rm doesn't give an error but the files are still there! wtf

[-] skaarl@feddit.nl 1 points 1 week ago

Thank you for the tips, but now I'm getting "Cannot remove: No such file or directory" all the way down! The files are there, I see them, they come up in the terminal, but for some reason xargs rm does not want to delete them. When I put the -f flag, rm doesn't give an error but the files are still there! wtf

[-] skaarl@feddit.nl 1 points 2 weeks ago

Isn't PLO the government of Palestina?

[-] skaarl@feddit.nl 1 points 2 weeks ago

Hey thanks for the info. Are you saying that just standard LineageOS without gapps or MicroG will be unable to have a functioning OsmAnd (for example)? I remember a few years ago you had to install Mozilla location services seperately from F-Droid to get OsmAnd to work without Google stuff, but I've personally been out of the loop for a while.

[-] skaarl@feddit.nl 1 points 2 weeks ago

Looks like you're right about that, thanks.

[-] skaarl@feddit.nl 1 points 2 weeks ago

Thanks, and is there one DNS provider that is better than the others in terms of privacy and degoogling?

view more: โ€น prev next โ€บ

skaarl

joined 3 weeks ago