Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7715723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:27:33+00:00 2026-06-01T02:27:33+00:00

I cannot delete folder created by php mkdir for I in `echo $*` do

  • 0

I cannot delete folder created by php mkdir

for I in `echo $*`
do
    find $I -type f -name "sess_*" -exec rm -f {} \;
    find $I -type f -name "*.bak" -exec rm -f {} \;
    find $I -type f -name "Thumbs.db" -exec rm -f {} \;
    find $I -type f -name "error.log" -exec sh -c 'echo -n > "{}"' -f {} \;
    find $I -type f -path "*/cache/*" -name "*.*" -exec rm -f {} \;
    find $I -path "*/uploads/*" -exec rm -rdf {} \;
done

I want to delete under /uploads/ all files and folders please help me thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:27:35+00:00Added an answer on June 1, 2026 at 2:27 am

    I think this is most likely because php is running in apache or another http server under a different user than you are invoking the bash script. Or perhaps the files uploaded in uploads/ are owned by the http server’s user and not the user invoking it.

    Make sure that you run the bash script under the same user as your http server.

    To find out which user owns which file do:

    ls -l
    

    If you run you bash script as root, you should be able to delete it anyway, but that is not recommended.

    Update

    To run it as root for nautilus script use the following as your nautilus script:

    gksudo runmydeletescript
    

    Then put all the other code into another file with the same path as whatever you have put for runmydeletescript and run chmod +x on it. This is extremely dangerous!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that you cannot delete a cookie set by another server in javascript.
In my application users cannot truly delete records. Rather, the record's Deleted field gets
i know how to delete records for jqgrid, but i realise i cannot select
Cannot find any example on Google.
I'm trying to delete files created by current user when he/she clicks logout button
I've looked at a few related questions and cannot seem to find a solution
I have created a folder and 770 it; when I try to mount a
// (1) create test file and delete it again File.Create(Path.Combine(folder, testfile.empty)); File.Delete(Path.Combine(folder, testfile.empty)); The
My folder Structure /UNIX /Find /Grep /Find-Grep I made a symlink to the UNIX
I am trying to remove a directory from my repository. I delete the folder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.