Activities

May 2010
M T W T F S S
« Apr   Jun »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Linux : how to overwrite files/folder without prompting

Many times when we try to overwrite a folder/files will ask conformation for each files/folders which sometimes disturbing us. Most of us are simply rename or delete the folder before make the over write and sometimes we can’t do that folder fully.

[root@rc-170 ~]# cp -r imagick-2.3.0 imagick-2.3.0new
cp: overwrite `imagick-2.3.0new/imagick-2.3.0/imagickdraw_class.c’?

[root@rc-170 ~]# alias
alias cp=’cp -i’
alias l.=’ls -d .* –color=tty’
alias ll=’ls -l –color=tty’
alias ls=’ls –color=tty’
alias mv=’mv -i’
alias rm=’rm -i’
alias which=’alias | /usr/bin/which –tty-only –read-alias –show-dot –show-tilde’
Removing alias because ‘cp’ command is alias with ‘cp -i’ which prompt evey overwrite happened.

[root@rc-170 ~]# unalias cp
[root@rc-170 ~]# alias
alias l.=’ls -d .* –color=tty’
alias ll=’ls -l –color=tty’
alias ls=’ls –color=tty’
alias mv=’mv -i’
alias rm=’rm -i’
alias which=’alias | /usr/bin/which –tty-only –read-alias –show-dot –show-tilde’

[root@rc-170 ~]# cp -rf imagick-2.3.0/ imagick-2.3.0new/

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>