# cp -r /etc/ Folder/ cp: overwrite `Folder/etc/rc5.d'? y cp: overwrite `Folder/etc/ggz.modules.d/kdegames'? y cp: overwrite `Folder/etc/idmapd.conf'? y cp: overwrite `Folder/etc/bonobo-activation/bonobo-activation-config.xml'? y cp: overwrite `Folder/etc/csh.cshrc'? y cp: overwrite `Folder/etc/group-'?So you see every time I have to press y to accept.
# cp -rvf /etc/ Folder/ cp: overwrite `Folder/etc/rc5.d'? y removed `Folder/etc/rc5.d' `/etc/rc5.d' -> `Folder/etc/rc5.d' cp: overwrite `Folder/etc/ggz.modules.d/kdegames'? y `/etc/ggz.modules.d/kdegames' -> `Folder/etc/ggz.modules.d/kdegames' cp: overwrite `Folder/etc/idmapd.conf'? y `/etc/idmapd.conf' -> `Folder/etc/idmapd.conf' `/etc/bonobo-activation-config.xml' -> `Folder/etc/bonobo-activation- config.xml' cp: overwrite `Folder/etc/csh.cshrc'? yNow as you see above it is still prompting me for overwrite
# alias alias cp='cp -i' 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 which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
Now as you can see there is an alias entry for cp command as 'cp -i' and if you look out for
# cp --help -i, --interactive prompt before overwrite (overrides a previous -n option)
So as you can see and understand why it was asking for overwrite each time. So the only thing you need to do is unalias the entry
# unalias cp
Now let us try to copy
# cp -rvf /etc /Folder `/etc/sfcb/file.pem' -> `Folder/etc/sfcb/file.pem' `/etc/sfcb/sfcb.cfg' -> `Folder/etc/sfcb/sfcb.cfg' `/etc/sfcb/server.pem' -> `Folder/etc/sfcb/server.pem' `/etc/sfcb/client.pem' -> `Folder/etc/sfcb/client.pem' `/etc/mke2fs.conf' -> `Folder/etc/mke2fs.conf' `/etc/sysctl.conf' -> `Folder/etc/sysctl.conf'So the files are getting copied without any prompt.
# 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 fiRemove the entry for cp command and save the file. This will permanently remove the alias entry for cp.
Follow the below links for more tutorials:
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
How to register Red Hat Linux with RHN (Red Hat Network )
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?