LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2015, 01:25 PM   #31
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled

Isn't bleachbit "fun"?
 
Old 08-25-2015, 01:49 PM   #32
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
[QUOTE=ramsforums;5410897]
Quote:
Originally Posted by goumba View Post
In addition, sudo doesn't work too well with redirecting and pipes. You need to run that command by using su or sudo bash.

Code:
su -c "nohup /usr/bin/rm -rf <directorypath> >/tmp/nohup.out 2>&1 </dev/null"
Thanks.

If I run on entire directory it may take several hours.
I tried as follows

.. snip... Then executed command as per your suggestion. But the directory is not getting removed.
I copied and pasted a previous poster's response without checking. The command as posted silently fails. D'oh! Try it again, removing /usr (rm is in /bin on my system). Or, even still,

Code:
su -c "nohup $(which rm) -rf <directorypath> >/tmp/nohup.out 2>&1 </dev/null"
$(which rm) will substitute the correct location on your system
 
Old 08-25-2015, 02:07 PM   #33
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,804

Rep: Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224
Quote:
Originally Posted by jpollard View Post
There are a few. XFS can have "billions"... (it dynamically adds inodes as needed).

In this case, I think it is referring to "more than I can count".

There is a limit to how many links to a file can exist (I don't remember if it is a 16 bit field or a 32 bit field).
For ext4 there is a 65000 link limit, but I don't know whether that's due to the filesystem or a kernel limit for all filesystems.

The top level directory size is about 1 gigabyte, so there can't be "billions" of entries there, but there's been no indication of how deep the tree goes.

Last edited by rknichols; 08-25-2015 at 02:09 PM.
 
Old 08-25-2015, 02:21 PM   #34
ramsforums
Member
 
Registered: Jun 2007
Posts: 66

Original Poster
Rep: Reputation: 0
I am not exactly sure billions or millions of directory.

I got the following message for selectively removing folders.

Quote:
rama@develop ~/T6o1L9lGg- $
rama@develop ~/T6o1L9lGg- $ su -c "rm -vfR a*"
Password:
bash: /bin/rm: Argument list too long
 
Old 08-25-2015, 02:25 PM   #35
ramsforums
Member
 
Registered: Jun 2007
Posts: 66

Original Poster
Rep: Reputation: 0
[QUOTE=goumba;5410978]
Quote:
Originally Posted by ramsforums View Post

I copied and pasted a previous poster's response without checking. The command as posted silently fails. D'oh! Try it again, removing /usr (rm is in /bin on my system). Or, even still,

Code:
su -c "nohup $(which rm) -rf <directorypath> >/tmp/nohup.out 2>&1 </dev/null"
$(which rm) will substitute the correct location on your system

Thanks. I have tried as per your suggestion. This too silently failed

Quote:
rama@develop ~ $ su -c "nohup $(which rm) -rvf ~/T6o1L9lGg-/ >/tmp/nohup.out 2>&1 </dev/null"
Password:
rama@develop ~ $ ls
apps Desktop md.log mydelexe.c T6o1L9lGg- Videos
backup Documents Music ocd tempdir xCopy
Copy Downloads mydel.c Pictures Templates
delempty empty mydelexe Public test1
rama@develop ~ $
 
Old 08-25-2015, 02:37 PM   #36
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by ramsforums View Post
Thanks. I have tried as per your suggestion. This too silently failed
Odd, it worked for me, tested it on several directories.

Code:
which -a rm
If that gives you nothing, there's the problem. Try /bin/rm in it's place.

Last edited by goumba; 08-25-2015 at 02:41 PM. Reason: Fixed broken markup
 
Old 08-25-2015, 02:44 PM   #37
ramsforums
Member
 
Registered: Jun 2007
Posts: 66

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by goumba View Post
Odd, it worked for me, tested it on several directories.

Code:
which -a rm
If that gives you nothing, there's the problem. Try /bin/rm in it's place.
Thanks. I got as follows

Quote:
rama@develop ~ $ which -a rm
/bin/rm
Now I am executing the following command with su -c option. will update this thread when command completes. in progress now..

Quote:
rama@develop ~ $ su -c "rsync -av --delete ./emptydir/ ./T6o1L9lGg-/"
Password:
sending incremental file list

Last edited by ramsforums; 08-25-2015 at 02:47 PM.
 
Old 08-26-2015, 12:02 AM   #38
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,804

Rep: Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224Reputation: 2224
FWIW, I loaded a directory with ~5,600,000 entries (@ 10,000 links per inode). It took much of the day to fill it, and "rm -r" took 50 minutes to clean it out. This was on an ext4 filesystem on a not terribly fast 320GB disk and with a 1.6GHz AMD CPU.
 
Old 08-26-2015, 06:02 PM   #39
Lsatenstein
Member
 
Registered: Jul 2005
Location: Montreal Canada
Distribution: Fedora 31and Tumbleweed) Gnome versions
Posts: 311
Blog Entries: 1

Rep: Reputation: 59
What about xfs and btrfs and zfs. Are the directory entries in these file systems indexed?
 
Old 08-26-2015, 06:24 PM   #40
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Lsatenstein View Post
What about xfs and btrfs and zfs. Are the directory entries in these file systems indexed?
btrfs uses two methods: btree (good for directory manipulations), and hash (for fast lookups).

I believe xfs uses b+tree.

I don't know about zfs - but I did find reports of poor directory performance with 4000+ files.
 
Old 08-26-2015, 06:45 PM   #41
Lsatenstein
Member
 
Registered: Jul 2005
Location: Montreal Canada
Distribution: Fedora 31and Tumbleweed) Gnome versions
Posts: 311
Blog Entries: 1

Rep: Reputation: 59
Hi JP

Are there any filesystems that use a b+ tree. For a while I thought that btrfs was based on the b+, but I guess I am wrong.

In my old IBM days we used VSAM. (Very successful access method). We joked that it was a ("very special access method).

VSAM was essentially a b+ tree organization, used with spinning disks that provided rotational positional sensing. One dedicated track told the disk controller the realtime angle of the disk. The theory and practice at that time being that the driver would choose the buffer for the sector that was just ahead of the disk head. The software did not have to wait for the disk index marker to be detected before beginning to search to write a buffer.

VSAM brought back memories of control areas, control invervals, free space within each, and also small sized data blocks stored along with the index.
 
Old 08-26-2015, 07:34 PM   #42
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
All of that location handling is done in the disk now. The drive itself has the buffer for the given address.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two directories and deleting files dadams982 Linux - General 4 05-09-2013 09:50 AM
deleting files recursively, but not directories tantan Linux - General 2 03-07-2007 07:01 AM
777 directories and deleting files? emme0032 Linux - Security 4 10-31-2006 12:27 PM
deleting millions of files at once Red Squirrel Linux - Software 6 05-15-2005 04:59 PM
Deleting directories with files in them AMDPwred Linux - General 7 02-16-2003 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration