[root@fz ~]# \cp filename new/filename [root@fz ~]#
注意:這只是臨時取消cp的別名,不是永久的
[root@localhost ~]# unalias cp [root@localhost ~]# cp filename new/filename [root@localhost ~]#
輸入alias命令,看到系統內部使用的是cp、mv、rm -i 因此怎麼輸入都是提示覆蓋。html
[root@fz ~]# [root@fz ~]# alias alias cdd='cd /home/data/android/' alias cp='cp -i' alias l='ls -la' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias rm='rm -i' alias tf='tail -f ' alias vc='vim ~/.bash_profile' alias vs='source ~/.bash_profile' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
修改 ~/.bashrc ,在 「alias cp='cp -i' 」前添加`#`號註釋後便可。android
[root@fz test]# vi ~/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' #alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
重啓或者執行 source ~/.bashrc 讓命令生效
[root@fz ~]# yes | cp filename new/filename cp: overwrite `new/filename'? [root@localhost ~]#
public void copyIcon() throws IOException, InterruptedException { Runtime r = Runtime.getRuntime(); String cmd_copy = "\\cp -rf temp/AppIcon/* icon/"; //copy並覆蓋 String[] cmds = new String[]{"sh","-c",cmd_copy}; Process p = r.exec(cmds); int result = p.waitFor(); if (result == 0){ //表示正常結束 logger.error("【copy appIcon 成功】"); }else { logger.error("【copy appIcon 失敗】"+cmd_copy); } }
if ( U.read(me.Blog) ) $("#推薦").click(); if ( U.copy(me.Blog) ) $("#u Blog").console("原文連接:http://www.cnblogs.com/Grand-Jon/p/7391215.html"); else me.Fuck(U);