Author Topic: Delete Locked Files  (Read 5253 times)

Offline D76

  • Super Duper Poster
  • ****
  • Posts: 438
    • View Profile
    • http://
Delete Locked Files
« Reply #15 on: July 15, 2006, 01:07:01 PM »
Thanks everyone for your replies.

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Delete Locked Files
« Reply #16 on: July 15, 2006, 05:25:45 PM »
QUOTE(kps @ Jul 15 2006, 09:44 AM) <{POST_SNAPBACK}>
rm -rf can fail with locked files. Some locked files need to be unlocked first.

Unlocking the files command:

chflags -R nouchg,noschg *

to find locked files in a folder use:

ls -lo

then:

sudo chflags -R nouchg,noschg folder_name

to trash:

sudo rm -Rf folder_name

Good idea to read up on the use of chflags in the man pages before using the command.
And then there is the slightly less conveninet method of using command-i and un-clicking the "Locked" check box...of course, this is not nearly as 'thrilling' as using Terminal. harhar.gif
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

Offline D76

  • Super Duper Poster
  • ****
  • Posts: 438
    • View Profile
    • http://
Delete Locked Files
« Reply #17 on: July 15, 2006, 05:39:54 PM »
Terminal is nothing, if not thrilling. Anything beyond sudo periodic daily weekly monthly has me on the edge of my chair. sweatingbullets.gif

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Delete Locked Files
« Reply #18 on: July 15, 2006, 06:52:36 PM »
QUOTE(airbusdriver @ Jul 15 2006, 06:25 PM) <{POST_SNAPBACK}>
And then there is the slightly less conveninet method of using command-i and un-clicking the "Locked" check box...of course, this is not nearly as 'thrilling' as using Terminal. harhar.gif


Thrilling, schmilling...

Have fun doing that on each file in a folder with hundreds of locked files...or good luck with any system locked file. Root your way out of that one... tongue.gif

The big R is for recursive, the noschg is for system bits.

There is a reason I post these things...

Remember Jim ...the Terminal is your friend!  laugh.gif salute.gif

Offline Dreambird

  • TS Addict
  • *****
  • Posts: 5191
  • Meet The New Boss
    • View Profile
Delete Locked Files
« Reply #19 on: July 15, 2006, 07:12:09 PM »
rofl.gif

Thanks kps... you have NO idea how much I needed a good laugh!

No offense ABD... it just tickled the right funny bone... wink.gif
******
On permanent walk-about... ;)
MacBook Pro Retina, mid-2012, SSD 500GB, 16GB RAM, High Sierra 10.13.6, iPad Air 2, iOS 11.4.1

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Delete Locked Files
« Reply #20 on: July 15, 2006, 09:01:47 PM »
QUOTE
the Terminal is your friend!
You obviously weren't travelling with me or my wife the last few weeks! Neither of us wants to see another Terminal for several months! And who says you should be deleting System Locked files?! eek2.gif
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

Offline krissel

  • Administrator
  • TS Addict
  • *****
  • Posts: 14735
    • View Profile
Delete Locked Files
« Reply #21 on: July 16, 2006, 01:14:26 AM »
Reminds me of the packet of sugar I got at a restaurant many years ago labeled "Terminal Food Service".

 eek2.gif


A Techsurvivors founder

Offline kps

  • TS Addict
  • *****
  • Posts: 1693
    • View Profile
    • http://
Delete Locked Files
« Reply #22 on: July 16, 2006, 04:27:26 PM »
QUOTE(airbusdriver @ Jul 15 2006, 10:01 PM) <{POST_SNAPBACK}>
You obviously weren't travelling with me or my wife the last few weeks! Neither of us wants to see another Terminal for several months! And who says you should be deleting System Locked files?! eek2.gif


I had an instance where an old folder with hundreds of clipart got locked and nothing...and I mean nothing would work to unlock and delete the items.

My (and your) friend the Terminal made short work of it.

There are also instances where trashed items on external drives get locked or the trash folder gets corrupted and the shell is the only way to deal with it.

Tiger might have resolved some trash issues from previous versions, but you never know. Pretty soon, Jim, you may not be able to boot into OS 9 and delete files in X. laugh.gif

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
Delete Locked Files
« Reply #23 on: July 17, 2006, 02:29:01 PM »
What's OS 9?! harhar.gif

And here's another reason to use Terminal, if you've upgraded to 10.4.7, anyway.
<Widgets Calling Home!> Might be good to know about this 'feature' with strange processes going on behind your back!
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes: