LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-29-2005, 08:18 AM   #1
0007
LQ Newbie
 
Registered: Jan 2005
Posts: 13

Rep: Reputation: 0
red hat deleting a file


hi everyone,

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.
 
Old 01-29-2005, 08:35 AM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
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.:
Code:
alias rm='rm -i'
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Java 1.4.2 from Red Hat 8 mustang05 Linux - Software 1 05-20-2004 10:22 PM
Red hat file systems alexr186 Linux - Software 5 10-10-2003 06:29 PM
File Corruption in Red Hat 7.3 File Server dmurph2k2 Red Hat 3 10-09-2003 02:30 PM
File Corruption on Red Hat 7.3 File Server dmurph2k2 Linux - General 2 10-09-2003 12:38 PM
File Corruption on Red Hat 7.3 dmurph2k2 Linux - Networking 1 10-08-2003 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration