Fedora Linux Support Community & Resources Center
  #1  
Old 29th November 2008, 12:11 AM
DK-11 Offline
Registered User
 
Join Date: Nov 2008
Posts: 4
why doesn't cp work properly?

there are various options which have no effect, for example:

cp -ax * /adifferentplace

will not stay on current file system, it will copy everything. Moving the -x to anywhere on the commandline or using the --one-file-system does nothing.

cp -af * /anotherplacewithsamefiles

This won't force copy, it will prompt for every file. Again moving the option around does nothing.

cp -f file1 file2

This is as simple as I can get it, still doesn't force, it prompts, when the file exists.

There's other options that are broken as well. What gives? Am I doing this wrong?
Reply With Quote
  #2  
Old 29th November 2008, 01:40 AM
gthill Offline
Registered User
 
Join Date: May 2005
Location: g-land, east java
Age: 50
Posts: 387
Most likely you are doing these commands as root and if you look at your .bashrc file you will notice that there are some aliases set up. You can put your own aliases in here or delete the default ones if your not happy with them.

[root@tc2 ~]# cat .bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ndb='nautilus --no-desktop --browser&'
.
.
.
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
[root@tc2 ~]#

or you can enter the command

[root@tc2 ~]# alias cp
alias cp='cp -i'

to see if the command has an alias set

using cp -f should over-ride the -i (interactive) option though!
Reply With Quote
  #3  
Old 29th November 2008, 02:10 AM
scottro Offline
Retired Community Manager -- Banned from Texas by popular demand.
 
Join Date: Sep 2007
Location: NYC
Posts: 8,142
Yes, that's a bit weird. This is F10?
Quick way to temporarily unset an alias is to escape it with a backslash, e.g. \cp -f file1 otherfile, which will work for that one command or
unalias cp
which will unset it for that session.
(Does quick test)
I just tested cp -f, though it's an install that started as rawhide and was upgraded.

You're right. What the dickens????
Sigh, a bug report should probably be filed, but frankly, I'm so sick of RH's buggy bugzilla that I don't have the energy. Testing as regular user..
Hrrm, as regular user, even if I don't use test it doesn't ask, just overwrites. This might be because I have my own .bashrc and my .bash_profile says to source it. Hrrm, actually, I have my own custom .bash_profile too.

Anyway, it's not just you.

I would consider it a bug, but no doubt, it's considered a feature.
Reply With Quote
Reply

Tags
properly, work

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mplayer doesn't work properly! mediator Using Fedora 6 25th January 2008 07:53 AM
anyone got CSS to work properly? Fittersman Gamers' Lounge 8 11th September 2007 06:02 AM
pop-up doesn't work properly jchoi28 Using Fedora 2 5th February 2007 09:10 AM
cannot get grub to work properly nigel_c Installation, Upgrades and Live Media 1 1st January 2007 05:28 AM
Mounts don't work properly. dfgrbac Using Fedora 3 6th September 2005 06:30 PM


Current GMT-time: 07:49 (Friday, 19-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat