Hello There, Guest! Login Register
Logo
Dismiss this notice
MaDLeeTs is not responsible for any attacks that are carried out on networks, websites or servers.
MaDLeeTs staff members cannot be held responsible.
All information on this forum is for educational purposes only.


What do we do when we have to remove many files in a dir?

  • 0 Vote(s) - 0 Average


10-03-2014, 02:33 AM #1
SickSpawn Offline You have an error in your SQL syntax; ***
TeaM MaDLeeTs
Posts:85 Threads:28 Joined:Sep 2014 Reputation: 2
Mood: Hacker
Some will say rm-rf nume_director

Maybe some know that the unix kernel, either Linux or FreeBSD there is a limit to the number of arguments that you can get an order. Thus rm-rf * rm-rf translates file1 file2 ... Very good. Until the number of files exceeds the maximum number of arguments that can be given a command.
Error which strikes us is: rm: Argument list too long. (error code: 126).

Here's the script:

Code:
#!/bin/bash
rec(){
for I in `seq 0 9 `; do
echo $1$I
rm -rf ./$1$I*
[ $? -eq 126 ] && rec $1$I
done
}
rec 1198
EOF
Source

[#] Twitter: sickspawnhy
[#] Jabber : [email protected]






Forum Jump:


Users browsing this thread:1 Guest(s)