answersLogoWhite

0

What is command cp in Linux?

Updated: 10/3/2023
User Avatar

Wiki User

13y ago

Best Answer

"cp"

The syntax is

cp foo bar

where "foo" is the file you want to copy, and "bar" is the name you want the copy to be called.

cp /home/user/music/song.mp3 /home/user

would copy song.mp3 to /home/user, but give it the same name.

You can view additional command line options here:

http://www.computerhope.com/unix/ucp.htm

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Copy. For example to copy a file named example.txt in /shared to /home/tom you would type "cp /shared/example.txt /home/tom" (without quotations). This may need to be done as root depending on the ownership of the file/directory and where it is located.

This answer is:
User Avatar

User Avatar

Wiki User

6y ago

In DOS/windows

copy source destination

In Linux/unix

cp source destination

cp -p source destination to preserve date and security information.

Destination defaults to the current directory when different from the source. The syntax varies from one operating system to another.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

cp -r olddirectory newdirectory

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#mv<space>sourcefile<space>target directory

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is command cp in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What command in Linux do you use to copy files?

cp.


Which Linux command is used to copy a file?

in terminal it is : #cp file_a file_b


What is the -i command in Linux?

It is not a command. It is an option for a command. Depending on the command it can modify the actions taken.For cp, mv and rm it makes the command interactive (are you sure). For ls it shows the inodes of files.


What utility on Linux can be used to copy a file including text and executable program binary files?

The cp command does that.


What happens when you give the command cp to do done in Linux?

Assuming to and do are valid files and the directory done exists, it will place a copy of to and do in the done directory.


What does the k command do in Linux?

k is not a standard command in Linux.


What is the command to turn on Linux?

There is no such command. Obviously, in order to enter a command into the prompt, Linux must already be on.


Which Linux command is equivalent to Windows' MD command?

In a Linux terminal, the command to create a new directory is: mkdir .


Program in shell of implementing cp command?

The 'cp' command is a primitive command; there isn't anything really in the shell to accomplish this. You could use other commands for 'cp' (such as 'cat') but those are also primitive commands.


DOS command to copy multiple files?

Depends on which operating system you are using and whether you want to copy more than one file.In DOS/Windows command prompt "c:\copy xxxx /destination_folder/"if more than one file you can use "c:\copy xxx.* /destination_folder/"Xcopy has more options (verify, copy subdirectories ..) and is used "c:\xcopy xxx* /s /destination_folder/"In Unix/Linux/OSX cp is the command for copyingas in "#darkstar$cp -R *.txt /destination_folder/"cp has a lot more option than xcopy but you will need to type either "cp --help" or "man cp" to get the best of cp's actions.


What Linux command sets a files permission?

In Linux the chmod command is used to set file permissions.


What is helo for Linux?

Nothing. Helo is not a recognized command in linux.