1. Title-old boy Education daily-May 7, 2017-snack-linux below how to implement, execute the RM command, display does not the use RM command2. Required Results
[[Email protected] ~]# RM do not use RM command
3. Answer
This requires the use of aliases in Linux alias rm= ' echo do not use RM command ' NOTE: The above command will also be put into/etc/profile for permanent entry
4. Detailed process first milestone-How to display this line of text
[[email protected] data]# echo do not use RM commanddo not use RM command
Second milestone-Configuring aliases
• Aliases for imitation systems · [[email protected] data]# alias Cpalias cp= ' cp-i ' [[email protected] data]# alias rm= ' echo do not use RM command '
A third milestone-testing
[[Email protected] data]# RM do not use RM command[[email protected] data]# Rm/datado not use RM command/data[[email PR Otected] data]# Rm-rf/datado not use RM command-rf/data
Fourth milestone-Make an alias permanent-/etc/profile
[[email protected] data]# vim/etc/profile[[email protected] data]# #vim/etc/profile[[email protected] data]# #vim/etc/p Rofile G to the last line of the file [[email protected] data]# # O (Small letter O) Insert a row below the current line and enter edit mode [[email protected] data]# [[email protected] data] # tail-1/etc/profilealias rm= ' echo do not use RM command ' [[email protected] data]# [[email protected] data]#
Fifth Milestone-Allow alias configuration to take effect
Use source or re-login [[email protected] data]# Source/etc/profile
Sixth milestone-Drainage pits
Re-login you, should be surprised to find that the RM alias does not take effect, in fact, if you configure the RM,CP,MV alias, there will be non-effective issues.
[Email protected] ~]# CAT/ROOT/.BASHRC # bashrc# User specific aliases and Functions#alias rm= ' rm-i ' # # #注释掉rm的这一行, plus The two lines of CP and MV can retain alias cp= ' cp-i ' Alias mv= ' mv-i ' # Source global definitionsif [-F/ETC/BASHRC]; Then. /etc/bashrcfi
5. Statistical information
Today is the 44th Day of the day to accompany you and look forward to your progress .
For questions and answers, please leave a comment in the blog comments section .
Index of the topic of the previous period
http://lidao.blog.51cto.com/3388056/1914205
This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1922923
Old boy Education Daily-May 7, 2017-snack-linux below how to implement, execute the RM command, display does not the use RM commands