One, Linux under the CP/RM/MV Force overwrite (a), backslash (\) temporarily de-alias
[email protected] ~]# \cp filename new/filename ~]#
(b), Unalias cancel Alias
Note: This is only a temporary cancellation of the CP alias, not Permanent
CP CP filename new/filename ~]#
(iii), modify the default configuration file
Enter the alias command to see that the system is using the CP, MV, Rm-i, so how to input are prompt overlay.
[[Email protected] ~]# [[email protected]~]# alias alias CDD='Cd/home/data/android/'aliasCP='cp-i'alias L='Ls-la'alias L.='ls-d. *--color=auto'alias LL='ls-l--color=auto'aliasls='ls--color=auto'aliasMV='mv-i'aliasRM='rm-i'alias TF='tail-f'alias VC='Vim ~/.bash_profile'alias vs='Source ~/.bash_profile'aliaswhich='alias |/usr/bin/which--tty-only--read-alias--SHOW-DOT--show-tilde'
[Email protected] test]#VI~/. BASHRC #. BASHRC # User specific aliases and functions aliasRM='rm-i'#aliasCP='cp-i'aliasMV='mv-i'# Source Global Definitionsif[-F/ETC/BASHRC]; Then . /etc/BASHRCfi
(d), yes COMMAND + pipe automatic input Yes
cp filename new/filename cp: Overwrite ' new/filename'? [Email protected] ~]#
Second, Java background call Linux command implementation
Public voidCopyicon ()throwsIOException, interruptedexception {Runtime R=Runtime.getruntime (); String cmd_copy= "\\cp-rf temp/appicon/* icon/";//Copy and Overwritestring[] Cmds =Newstring[]{"sh", "-C", cmd_copy}; Process P=r.exec (CMDS); intresult =p.waitfor (); if(result = = 0) {//indicates a normal endLogger.error ("Copy appIcon Success" "); }Else{logger.error ("Copy AppIcon failed" "+cmd_copy); } }
Linux CP/RM/MV Forced overwrite