Sponsored Content
Top Forums Shell Programming and Scripting how to delete/remove directory in fastest way Post 101339 by vino on Tuesday 7th of March 2006 09:37:44 AM
Old 03-07-2006
Quote:
Originally Posted by matrixmadhan
aliasing could have been done, for some purpose
i dont think unaliasing and using the command as a valid one.

instead use,
/bin/rm -rf /dir/to/delete
or
/usr/bin/rm -rf /dir/to/delete

aliasing would be preserved.
Very true. Deleting over a million files, wouldnt be a novice's job. You would be very aware of what you are doing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

smitty, remove user, remove directory as well..

hi, i am on aix. i used smitty to remove a user.. but then found that its directory still exists.... so i have to remove the directory manually... am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies

2. Shell Programming and Scripting

fastest way to remove duplicates.

I have searched the FAQ - by using sort, duplicates, etc.... but I didn't get any articles or results on it. Currently, I am using: sort -u file1 > file2 to remove duplicates. For a file size of 1giga byte approx. time taken to remove duplicates is 1hr 21 mins. Is there any other faster way... (15 Replies)
Discussion started by: radhika
15 Replies

3. Shell Programming and Scripting

delete two patterns and remove one pattern

Friends, I have .txt file with following format. START ABC|Prashant1|Patel1 ABC|Prashant2|Patel2 ABC|Prashant1|Patel1 ABC|Prashant2|Patel2 END I would like to do: 1) Delete line with START 2) Delete line with END 3) Remove ABC| 4) Delete duplicate records The following command... (7 Replies)
Discussion started by: ppat7046
7 Replies

4. Shell Programming and Scripting

Remove contents of directory, but not directory

What's the best way to delete everything in a directory, but not the directory itself, without using shell wildcards? (9 Replies)
Discussion started by: pdc
9 Replies

5. Shell Programming and Scripting

Fastest way to delete line

I have a 5 GB text file(log/debug) I want to delete all lines containing 'TRACE' Command used sed -i '/TRACE/d' mylog.txt Is there any other fastest way to do this? (1 Reply)
Discussion started by: johnbach
1 Replies

6. AIX

Fastest way to count big amount of files in sub directory

Hi, what happened is we want to count all the files in a directory and inside this directory got many folders and so take long time to count it. Already run for about few minutes but still not done. The command we use to count is find . -type f | wc -l Just wondering if there is any other... (9 Replies)
Discussion started by: ngaisteve1
9 Replies

7. Shell Programming and Scripting

Fastest way to delete duplicates from a large filelist.....

OK I have two filelists...... The first is formatted like this.... /path/to/the/actual/file/location/filename.jpg and has up to a million records The second list shows filename.jpg where there is more then on instance. and has maybe up to 65,000 records I want to copy files... (4 Replies)
Discussion started by: Bashingaway
4 Replies

8. Shell Programming and Scripting

delete from line and remove duplicates

My Input.....file1 ABCDE4435 Connected to 107.71.136.122 (SubNetwork=ONRM_RootMo_R SubNetwork=XYVLTN29CRBR99 MeContext=ABCDE4435 ManagedElement=1) ABCDE4478 Connected to 166.208.30.57 (SubNetwork=ONRM_RootMo_R SubNetwork=KLFMTN29CR0R04 MeContext=ABCDE4478 ManagedElement=1) ABCDE4478... (5 Replies)
Discussion started by: pareshkp
5 Replies

9. Shell Programming and Scripting

Fastest way calculating directory

Hi expert, Is there any fastest way to calculate recursive directory, and I have total 600 directories have 100000 files and 10 directory approximately 9000000 - 10000000 each files per directory. currently using this command "du -k --max-depth=0" to get the size but very slow it take 24 hours... (9 Replies)
Discussion started by: rufino
9 Replies

10. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
Padre::Task::File(3pm)					User Contributed Perl Documentation				    Padre::Task::File(3pm)

NAME
Padre::Task::File - File operations in the background SYNOPSIS
# Recursively delete Padre::Task::File->new( remove => 'C:fooaraz', )->schedule; DESCRIPTION
The File::Remove CPAN module is a specialised package for deleting files or recursively deleting directories. As well as providing the basic support for recursive deletion, it adds several other important features such as removing readonly limits on the fly, taking ownership of files if permitted, and moving the current working directory out of the deletion path so that directory cursors won't block the deletion (a particular problem on Windows). The task takes the name of a single file or directory to delete (for now), and proceeds to attempt a recursive deletion of the file or directory via the File::Remove "remove" method. In the future, this module will also support more types of file operations and support the execution of a list of operations. METHODS
new my $task = Padre::Task::File->new( remove => '/foo/bar/baz', ); Creates a new deletion task. Takes a single parameter "remove" which must be an absolute path to the file to delete (as the "current directory" may change between the time the removal task is created and when it is executed). remove The "remove" accessor returns the absolute path of the file or directory the task will try to delete (or tried to delete in the case of completed tasks). SEE ALSO
Padre, Padre::Task, File::Remove COPYRIGHT
Copyright 2008-2012 The Padre development team as listed in Padre.pm. This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-27 Padre::Task::File(3pm)
All times are GMT -4. The time now is 12:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy