[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1731959404297770.gif (1.49 MB, 300x224)
1.49 MB
1.49 MB GIF
Just run this command and lost all my pictures

find . -maxdepth 1 -type f -name "*.jpg" -exec mv {} $(date +%s).jpg \;
>>
File: 1ff.jpg (5 KB, 190x265)
5 KB
5 KB JPG
>>103250150
restore from backup
oh you don't have one...?
AAAAHAHAHAHAHAHAHAHA
>>
File: perl-pepe2.png (549 KB, 800x800)
549 KB
549 KB PNG
>>103250150
>dude you don't need a general purpose PL, bash will do
>>
It copied them all to one file overwriting each other?
>>
File: file.png (5 KB, 167x129)
5 KB
5 KB PNG
>>103250150
always test how it runs beforehand
>>103250287
yeah it moved all images that was found withing same second into same place
>>
>>103250287
Yes. No warning at all.
>>
photorec
>>
>>103250353
I'm using termux, no root.
>>
>using jpg in the year 2024
>>
>>103250150
KWAB
>>
>>103250150
[sad news]
i just told my computer to do something and it did it
upon noticing the result i realised i made a mistake
i would still like to blame my computer though
>>
>>103250150
i used something similar a while ago to replace text inside some files, maybe it can give you some ideas
find . -type f -name \*.txt -exec sed -i.bak 's|http://|rtmp://|g' {} +
>>
>>103250370
tough luck
>>
>>103250465
I'm not blaming anyone, though?
>>
>>103250319
Right yeah I've done that when my code logic fucks up because it doesn't retrieve a filename and just writes to blank plus extension. I list like 2500 json files as they all got renamed to just ".json"
>>
>>103250150
just needed a -i behind the mv.
>>
>>103250150
you're a bit of a retard, anon
>>
>>103250382
jxl>>avif
>>
File: 1731563503091591.jpg (37 KB, 596x506)
37 KB
37 KB JPG
>>103250150
have one jpg, bro. save it, it's all yours.
>>
File: 1592198705497.jpg (65 KB, 629x540)
65 KB
65 KB JPG
apparently there are 124,446 jpgs on my computer. so, which one do you want?
>>
>>103251022
You don't have the ones I want, I hope.
>>
>>103251095
give me some hints. no pizza, though.
>>
File: 1673329758646337.png (906 KB, 781x685)
906 KB
906 KB PNG
>>
File: Cobson.png (16 KB, 721x720)
16 KB
16 KB PNG
>>103251095
heres a good one
>>
>>103250150
Sorry for your loss. Generally speaking, I wouldn't recommend using mv without the --no-clobber (-n) flag, like ever, unless you actively desire overwriting.
>>
>>103251201
coal
>>
>>103250652
false. this is shifting the blame to the developers: >>103250321
>>
>>103251383
You have a point.
>>
>>103251383
it is justified
one of the biggest linux problems is that it is too easy to delete your user files and even critical system files
the safetyrailing is too small and too easy to step over
>>
>>103251521
that's a problem for you
stick to your safety-railed os and don't change linux
>>
>>103251729
by that pace, me and other 85% of PC users will have to stick to win/mac for some more years
>>
File: N6Fxv0a.gif (2.61 MB, 387x292)
2.61 MB
2.61 MB GIF
linux needs undo command
>>
>>103251755
This but unironically.
>>
>>103251753
good, bye
>>
Just restore from your zfs snapshot.
You are using zfs, right?
>>
File: 1.png (124 KB, 374x240)
124 KB
124 KB PNG
>>103250150
you always test critical operations in a mock environment,
hope you learned your lesson :-)
>>
>>103251983
i use ReiserFS
>>
>>103252007
It was a sign from God to me forget about my past.
>>
>>103251753
I want less attention on stuff I used. More attention means more corporate and government involvement. No thanks
>>
>>103250465
It doesn't sound like he's blaming anyone but himself. And he's right, he is the only one to blame. He made a dumb mistake and hopefully he'll learn from it.
>>
File: 142582946.png (257 KB, 516x526)
257 KB
257 KB PNG
Here is a picture! You can save it if you'd like!
>>
>>103250851
>>103252380
Thanks, lads.
>>
>>103250150
btw is the \; necessary or just ; ?
>>
>>103252407
Aparently yes, \ is used to escape the ;
>>
>>103252380
This is very funny, may I save this image?
>>
>>103252502
Save it, it's all yours my friend!
>>
>>103252540
Thank you, I was just concerned you may have been upset if I were to save it without my asking permission, so I was sure to ask before saving it.
>>
>>103250150
I did the same with the subtitles for a series I've been working on. Damn, losing all photos must be fucking tough...
>>
>>103250150
and now you know why you never run a destructive script (mv is destructive) without testing and/or backing up first. you won't make this mistake again in the future.
>>103252407
it's how you terminate the command to -exec in find.
>>
>>103250150
always. ALWAYS do a dry run of commands like this. like, instead of running mv, prepend "echo", like this:
find . -maxdepth 1 -type f -name "*.jpg" -exec echo mv {} $(date +%s).jpg \;


also, my suggestion right now is to shutdown your computer ASAP, grab a livecd/liveusb, install the testdisk package and run photorec to try to recover those files
>>
>>103250150
You should've used parallels for this.
>>
>>103252407
Yes, ; is interpeted by most shells as a special character with context, you want to pass it down to find.
>>
>>103250150
oh no, all those pepes and jaks, how are you going to spam-troll blue boards now?
>>
>>103250150
>testing in production
you get what you fucking deserve
>>
>>103252798
>shutdown your computer ASAP, grab a livecd/liveusb, install the testdisk package and run photorec to try to recover those files
this
I once recovered 80% of my film archive like this
>>
>>103251201
gem
>>
File: 73150842_p7.jpg (199 KB, 1100x1503)
199 KB
199 KB JPG
>>103251095
Here's a woomy for you anon, keep her safe and warm and she'll bring you good luck.
>>
>>103251265
kys
>>
you have automatic btrfs snapshots, right?
>>
File: 1722219431178716.jpg (85 KB, 815x1024)
85 KB
85 KB JPG
>>103255293
>automatic snapshots
anything thats automatic is bloated. except rifles.
>>
>>103250150
Windows doesn't have this problem
>>
>>103250150
You can use mv -i to make it prompt before taking action.
>>
>>103255942
I can assure you that findutils behaves in exactly the same way when ran from Windows.

Don't blame the tool, blame the retard using it.
>>
>>103250150
Brutal.
Buy an external drive and back your shit up regularly.
Let this be a lesson, place your amazon order today.
>>103251201
c' 'n 'g



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.