Limitation on rm command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Limitation on rm command
# 1  
Old 05-11-2012
Bug Limitation on rm command

Hi all,

does any one know ,if there is any limitation on rm command

limitation referes here as a size .

Ex:when my script try to rum rm command which have size of nearly 20-22 GB ..CPU load gets high ?

if anyone know the relation of CPU load and limitation of rm command .
# 2  
Old 05-11-2012
Are you talking about rm in combination with the -r option?
# 3  
Old 05-11-2012
i am using rm -f $FILE where $File having files which have nearly 20-22 GB size and Number of files=52603
# 4  
Old 05-11-2012
So the variable $FILE contains a wild card ( *, ? and such )? What is the content of that variable?
# 5  
Old 05-11-2012
ok here the full script part :
===============================
Code:
for file in $FILELIST;
        do
                rm -f $file && echo "Successfully deleted $file" 
                test $? -ne 0 && echo "Error while deleting files" && exit 6
        done

===============================
and
Code:
FILELIST=`find $D -type f -print`

(D= /a/b/c/*)

the count of
Code:
find $D -type f -print | wc -l

=52603

and size of D=/a/b/c/* => du -sh => 20 GB

when my script reaches this deleting part the CPU load get high
and i have to kill my script at deleting step
this is the complete scenario

Last edited by Scrutinizer; 05-11-2012 at 05:11 AM.. Reason: code tags
# 6  
Old 05-11-2012
rm -f always has return code 0 (see man rm)

for file in $FILELIST will not work for files with spaces in the name, and so the script will try to remove the part before and after a space...
It would be better to use:
Code:
find /a/b/c -type f | 
while read file
do

You could also let find execute the rm part.
This User Gave Thanks to Scrutinizer For This Post:
# 7  
Old 05-11-2012
Thanks for the information !

but in my case the file name contains no space in name.

here what i want to ask does FOR loop in script for these many files containing the size of 20GB ...affect the CPU load . if yes then how ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Limitation in addition

whats wrong with this addition? Whats the maximum number of digits can be handled? pandeeswaran@ubuntu:~/Downloads$ const=201234454654768979799999 pandeeswaran@ubuntu:~/Downloads$ let new+=const pandeeswaran@ubuntu:~/Downloads$ echo $new -2152890657037557890 pandeeswaran@ubuntu:~/Downloads$ (4 Replies)
Discussion started by: pandeesh
4 Replies

2. HP-UX

Limitation on *.ext

Is there a size limit when passing an argument using wildcards? I.E. when I pass an argument in the form (like) "ftp_auto *.txt" - is there a limitation on the size of UNIX expanding "*.txt" ? (1 Reply)
Discussion started by: vslewis
1 Replies

3. Shell Programming and Scripting

Character limitation in Join command

Hi, I'm trying to compare and join two files using join command. One of my files length is 3000. Join is not working for this file. It truncates character after 1600 lines. Anyone know a solution for this? the command i used is Comparing the 1st column of the first file and 3rd column of... (1 Reply)
Discussion started by: gpaulose
1 Replies

4. UNIX for Advanced & Expert Users

Find command -size option limitation ?

Hi All, I ran code in test environment to find the files more than 1TB given below is a snippet from code: FILE_SYSTEM=/home/arun MAX_FILE_LIMIT=1099511627776 find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"c -ls -xdev 2>/dev/null | while read fname do echo "File larger than... (3 Replies)
Discussion started by: Arunprasad
3 Replies

5. UNIX for Dummies Questions & Answers

grep limitation

Hello, I am looking for a way to get around an issue, as I am using the grep command in a very common situation: grep ^50 File.*.txt | "some awk process" My problem is that bash throws me an error on the grep command if the directory in question contains several thousands files. ... (6 Replies)
Discussion started by: Indalecio
6 Replies

6. Shell Programming and Scripting

Size limitation in Tar command

Hi to every body there, I am new this forum and this is my first post. I am a new user of Unix, is there any size limitation of files while creating tar file. Thanks in advance (4 Replies)
Discussion started by: Manvar Khan
4 Replies

7. Shell Programming and Scripting

Limitation of ls command

Hi, Iam using an alias to get the file count from one directory using normal ls command like ls file*|wc -l.If my file increases more than 35,000 ,my alias is not working.It shows that arg list too long. is that can be limitation of ls or problem in alias? I would appreciate if anyone can... (2 Replies)
Discussion started by: cskumar
2 Replies

8. Shell Programming and Scripting

File size limitation of unix sort command.

hi , iam trying to sort millions of records which is delimited and i cant able to use sort command more than 60 million..if i try to do so i got an message stating that "File size limit exceeded",Is there any file size limit for using sort command.. How can i solve this problem. thanks ... (7 Replies)
Discussion started by: cskumar
7 Replies

9. HP-UX

HP-UX 11i - File Size Limitation And Number Of Folders Limitation

Hi All, Can anyone please clarify me the following questions: 1. Is there any file size limitation in HP-UX 11i, that I can able to create upto certain size of file (say 2 GB) and not more then that???? 2. At max. how many files we can able to keep inside a folder???? 3. How many... (2 Replies)
Discussion started by: sundeep_mohanty
2 Replies

10. Shell Programming and Scripting

find limitation

Hi , i'm trying to use "find "command with "-size "option but i encounter 2gb file limitation. Can you confirm this limitation ? Is there a simple way to do the same thing ? My command is : <clazz01g-notes01>/base/base01 # find /base/base01 -name '*.nsf' -size +5242880000c -exec ls... (2 Replies)
Discussion started by: Nicol
2 Replies
Login or Register to Ask a Question