Quote:
i have redhat 9 and when i delete a file , it gets deleted automatically, i mean without asking. does any1 knw how i can prompt a message saying do u want to delete the file yes or no.
|
do you mean from the console when you delete an file with rm?
If yes rm has an option -i for interactive mode
Code:
skalkoto@darkstar:~$ touch nothing
skalkoto@darkstar:~$ ls -l nothing
-rw-r--r-- 1 skalkoto users 0 2005-01-29 16:30 nothing
skalkoto@darkstar:~$ rm nothing
skalkoto@darkstar:~$ touch nothing
skalkoto@darkstar:~$ ls -l nothing
-rw-r--r-- 1 skalkoto users 0 2005-01-29 16:30 nothing
skalkoto@darkstar:~$ rm -i nothing
rm: remove regular empty file `nothing'? y
skalkoto@darkstar:~$
You may do an alias to use rm -i instead of using rm, when you type rm.:
To make it permanent put this in one of your configuration files like .bash_rc (I think this is the file in RH) in your users home directory