Linux Help

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Linux Help

Post by mike »

Hey, I need help with Linux. Recently had a format issue and lost all my files so now I'm sifting through the OVER 1 MILLION pictures recovered by foremost. The system crashes whenever I try to look in the folder holding all the files so I just move over 10000 at a time to a temp folder so that I can browse them (looking at the thumbnail is enough to see if it's junk or something I want). What I need is a command for doing this.. what I currently do is just start moving stuff and then kill the command after some time; not an exact science. Can anyone help me out?

PS: I'm posting this here because other Linux help places are too fucking slow... even on IRC I get no replies.
Now posting IN STEREO (where available)
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Linux Help

Post by Kaze »

Use a loop..

Code: Select all

mkdir tmp
N=0
for file in `ls`
do
    if [ $N -gt 10000 ]; then
        break
    fi
    mv $file tmp
    
    N=`expr $N + 1`
done
Untested
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Linux Help

Post by mike »

It's a lot slower, but it does mean that I can be unattentive and not end up with 90000+ files in an unusable folder. Thanks! ^^
Now posting IN STEREO (where available)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests