Visit Our UNIX and Linux User Community


Disable the `rm -f ` command


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Disable the `rm -f ` command
# 1  
Old 07-07-2003
Disable the `rm -f ` command

I wish to learn how to use the alias command in .cshrc
I need to change some Unix commands, like :
change "rm -f " into "rm -i "
or to write small scripts using alias.
# 2  
Old 07-07-2003
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'
# 3  
Old 07-07-2003
alias rm -f 'rm -i'

I add this line to .cshrc file

alias rm -f 'rm -i'


Then exit the user and reenter again to the user .
Then i run the command
rm -f filename in the command line.
And I get error:

-f: Command not found


I am not sure that this is the way to solve it????
# 4  
Old 07-07-2003
Well, just try alias rm 'rm -i' like mib suggested ... most of the time, the -i option overrides the -f option. So if you use that alias and then someone types "rm -f", the -f option will be ignored.
# 5  
Old 07-08-2003
Disable the `rm -f ` command

I did what you told me to do.
I put the rm 'rm -i' line into the .cshrc exit the user renter again and it didn't help.

i ru the command rm -f filenam and it has been removed without asking if i am sure.
??
so its not working.
# 6  
Old 07-08-2003
Read this for a quick tutorial on creating aliases.

Read this to see how to make the aliases stick between logins.

You need to edit the .cshrc file in your home directory and enter each alias command on a separate line. Then it'll be there when you login next time.
# 7  
Old 07-09-2003
alias rm 'rm -i'

I add this line to .cshrc file in a separate line

alias rm 'rm -i'

Save it.
Then exit the user and reenter again to the user .
Then i run the command
rm -f filename in the command line.
And the file was removed without asking ??



I already know all the aliases rules !

If you test your suggested command you will see that its not working !

10x.

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Not able to disable finger & telnet command in Solaris 8

Hi I need to disable finger & telnet command in solaris 8 I have put the # infront of finger and telnet line in /etc/inetd.conf file. Further I have run the below command kill -1 <process id of inetd > But when I am running finger command it is till giving information for remote machine... (8 Replies)
Discussion started by: amity
8 Replies

2. AIX

Disable a command

I need to disable a command. For example - disabling "ls" means that when someone type "ls" - nothing happens . Somebody help ???? :confused::confused::confused: (8 Replies)
Discussion started by: bobochacha29
8 Replies

3. OS X (Apple)

Disable / mute microphone from command line

Googling suggested "osascript -e 'set volume 0' " but that doesn't work. I know I'd found this before... some command-line utility that had something to do with audio, mixers, whatever, but I forgot to keep it somewhere I could find it. I did find references to writing an AppleScript app, but... (3 Replies)
Discussion started by: jnojr
3 Replies

4. Red Hat

SSL/TLS renegotiation DoS -how to disable? Is it advisable to disable?

Hi all Expertise, I have following issue to solve, SSL / TLS Renegotiation DoS (low) 222.225.12.13 Ease of Exploitation Moderate Port 443/tcp Family Miscellaneous Following is the problem description:------------------ Description The remote service encrypts traffic using TLS / SSL and... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

5. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

6. Shell Programming and Scripting

Need to disable options from a command

Hi, I am working on a Linux machine. I need to disable 2 options from the available 6 options of a command. For eg. in the "ls" command we have various options like "l ,r, t, a, .... " From this, I need to disable option "a" So when the users type in "ls -a", they should get an error or... (4 Replies)
Discussion started by: aster007
4 Replies

7. Shell Programming and Scripting

How to disable backslash in command line

Dear I have one problem in SCO Unix command line. I want to disable execution of commands with backslash. For example - if the user executes the following command \exec_script Here - i want the system should NOT execute this command. Can any one give me a suitable... (8 Replies)
Discussion started by: subbu62
8 Replies

8. UNIX for Dummies Questions & Answers

how to disable su command without the "-"

hello all i need to disable the su without "-" with another meaning i need to force executing of the .profile when using su command any ideas ??? (4 Replies)
Discussion started by: islam.said
4 Replies

9. Shell Programming and Scripting

How to disable Enable/Disable Tab Key

Hi All, I have bash script, so what is sintax script in bash for Enable and Disable Tab Key. Thanks for your help.:( Thanks, Rico (1 Reply)
Discussion started by: carnegiex
1 Replies

10. Solaris

OBP command to enable/disable a processor

Hello experts.. How can i enable or disable a processor from OBP(OK prompt)? Thanks in advance... (8 Replies)
Discussion started by: younus_syed
8 Replies

Featured Tech Videos