Results 1 to 3 of 3
Hello im new in Programming and i have question to users of this forum.
is there anyway to delete all files in folder via shell_exec(); or bash
if yes can ...
- 03-22-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 2
[help]Delete All Files from folder. & adding user via php
Hello im new in Programming and i have question to users of this forum.
is there anyway to delete all files in folder via shell_exec(); or bash
if yes can anyone write example for me.
adding user via php i made code like
<? shell_exec('useradd -q -h $haslossh -n $loginssh -s /bin/none -d /home/$loginssh -m');
?>
if its wrong please correct me. thanks
- 03-23-2008 #2
Well, for deleting all of the files in a directory, I assume you mean just the files ( no directories ), and only in the current directory ( no sub-dirs ).
With bash try this on the command line:
I don't really see anything wrong with the user addition script, but some of those programs prompt for the password automatically, so that could have unexpected results on the script. I don't often manage a lot of users so I don't know specifically, but there's probably an option to not prompt for a password ( so it would need to be set later ).Code:find ./ -type f -maxdepth 1 | while read var; do rm $var; done
- 03-23-2008 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 2
But when i want only to delete files from USER folder.
$loginssh - is the user from database $loginssh = ['loginssh']; ...


Reply With Quote