How to delete a directory in /tmp directory
Hi Everyone,
Im creating a directory in /tmp location for temporary storage of files. then i move them to actual folder. Im not able to delete the directory. Server Version: AIX dseax203 3 5 00CF1AEC4C00 shell : Bash Quote:
Thanks in Advance. |
You missed the -r (recursion) option of rm, necessary to remove directories. If the directory is empty the rmdir command is enough, otherwise rm -r is mandatory.
|
Hi colucix,
Thankyou very much for the reply. I tried with rm -r, rm -rf. But the result was same, im not able to delete the directory. Since im moving all the files and the directory will be empty, even then rmdir is not able to deleted teh directory. when i manually use th ecommand in comand prompt, the directory gets deleted. But when the same command included in shell script, it ll not be able to delete. Thanks in Advance |
Any error message from the script? What if you change #!/usr/bin/ksh with #!/usr/bin/bash or the exact path to the bash shell, if different?
|
Hi colucix,
This is the error message. Quote:
does /tmp has any special permissions that doesnot allow deleting a directory in it ?? |
I didn't notice it before, but most likely you have to go out of the directory before removing it.
|
You can't delete the directory when it is your current working directory. Insert a
Code:
cd - |
Thanks you so much Hi colucix.
Quote:
Thanks |
All times are GMT -5. The time now is 03:37 PM. |