![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question regarding permision and seguid bit (sticky bit) | arunkumar_mca | UNIX for Dummies Questions & Answers | 2 | 01-09-2008 07:18 AM |
| Delete database table based on months using script. | Maverick79 | UNIX for Advanced & Expert Users | 0 | 08-30-2007 03:27 AM |
| Need to delete the files based on the time stamp of the file | samudha | UNIX for Dummies Questions & Answers | 2 | 06-20-2007 08:02 AM |
| File Permision | sommyp | UNIX for Dummies Questions & Answers | 6 | 05-17-2007 03:46 PM |
| i want to delete a file based on existing file in a directory | srivsn | Shell Programming and Scripting | 3 | 04-11-2006 05:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Based on the permision in the dir can i delete the file
All,
I am having a directory as drwxrwsr-x 3 intermec intermec 10240 Jan 8 09:07 intermec inside the directory . the files are like cd -rw-r----- 1 intrmc01 intermec 5226 Dec 2 15:03 AST07356.txt -rw-r----- 1 intrmc01 intermec 5025 Dec 2 12:51 AST07363.txt -rw-r----- 1 intrmc01 intermec 1607 Jan 2 16:17 AST08003.txt -rw-r----- 1 intrmc01 intermec 7772 Jan 3 15:09 AST08004.txt -rw-r----- 1 intrmc01 intermec 25125 Jan 4 14:57 AST08005.txt -rw-r----- 1 intrmc01 intermec 20636 Jan 7 15:19 AST08008.txt When i run the below command find /intermec/ -name "*" -mtime +12 -exec rm -f -r 2> /dev/null "{}" ";" The files are not deleted . it is showing as permision denied even though i have full permision on the directory . Why it is not removed . Is that because files not having full permsion ???.. if yes can i over come that and remove the file by any other way ?.. but to note that i was also having a file inside the directory as -rwxrwxrwx 1 intermec intermec 15209 Aug 1 16:27 AST07214.txt i was not able to delete the is one also. What should i do in such a way that the files under the dirctory can be deleted i know root will be able to remove . Apart from root can anyother can remove if so how can i found that. Thanks, Arun. Last edited by arunkumar_mca; 01-08-2008 at 12:39 PM.. |
|
||||
|
Assuming you can do this manually, try modifying your find statement to this
find /intermec/ -type f -mtime +12 -exec rm -f {} 2> /dev/null \; the * was unnecessary because you want all files anyway the -type limits you to files. And while quoting the simicolon may work, I am in the habit of using the escape to signify characters. |
|
||||
|
Based on the directory information:
drwxrwsr-x 3 intermec intermec 10240 Jan 8 09:07 intermec you must be either intermec, or part of the intermec group, to have permission to delete files. You can check your group priveledges by typing: groups I am not absolutely sure why the sticky bit in the directrory structure is set. - sorry. The directory is open to the public - where they have read and search (able to change into the directory) but unable to create or delete files. |
|
||||
|
thanks ..
Can u please confirm that if we change the directory permision like drwxrwsrwx 3 intermec intermec 10240 Jan 8 09:07 intermec will i be able to delete the files under the directory ??.. inside the directory the files has permsion like -rw-r----- 1 intrmc01 intermec 5226 Dec 2 15:03 AST07356.txt -rw-r----- 1 intrmc01 intermec 5025 Dec 2 12:51 AST07363.txt -rw-r----- 1 intrmc01 intermec 1607 Jan 2 16:17 AST08003.txt -rw-r----- 1 intrmc01 intermec 7772 Jan 3 15:09 AST08004.txt -rw-r----- 1 intrmc01 intermec 25125 Jan 4 14:57 AST08005.txt -rw-r----- 1 intrmc01 intermec 20636 Jan 7 15:19 AST08008.txt also please help me know if i cahngethe permsion like i mentioned , will the delete operation can be performed by any user in any group ??.. will there file with above permision will be deleted . |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|