copying a file from one directory to another


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers copying a file from one directory to another
# 1  
Old 11-02-2007
copying a file from one directory to another

Hi

This is my first day in Unix, and I am trying to copy a file called
holiday.txt from my D drive into the C drive folder called h

like currently i am in D drive, i want to copy my holiday.txt into
C\h (C drive, h folder)

i am able to copy the file in the same drive, but how to do the above
task?

Also, do i need to give the file extension names of the files i want to
copy or move..because if i dont mention the extensions, i am getting
error like

mv: cannot stat 'file' : No such file or directory
# 2  
Old 11-02-2007
Quote:
Originally Posted by soujanya_srk
This is my first day in Unix
Welcome.

Quote:
Originally Posted by soujanya_srk
... from my D drive into the C drive folder
UNIX does not have 'D drive' or a 'C drive', it has a unified file system with volumes mounted at different points in the tree.

What system are you using?
# 3  
Old 11-02-2007
hi

actually I am using cygwin, an open source software which gives
linux like environment in a windowsxp box...this is at work

at home, i need to install linux . I have windows xp at home, can I have
a dual operating systems at home?
# 4  
Old 11-02-2007
in cygwin you would do

cp /cygdrive/c/directory/filename /cygdrive/d/directory

the filename needs to be fully qualified and include any extension

UNIX uses forward slashes

if you want a dual boot system you need to find a way to make some free space and may require resizing a partition or reinstalling windows, but it certainly can be done.
# 5  
Old 11-02-2007
thank you !

supposing I am not using cygwin, and I am using normal linux, then
I think I need to remove /cygdrive from the above command..
# 6  
Old 11-02-2007
Quote:
Originally Posted by soujanya_srk
... I need to remove /cygdrive from the above command..
There won't be the drive letters either.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Copying driver file from cd to directory

Hello. We've had quite a lot of issues with networking with our IBM server running SCO OpenServer 5.0.7. I figured it couldn't hurt to try installing a new network card in the server and see what results I get. When I go into netconfig I can see there's a fairly long list of network adapters... (1 Reply)
Discussion started by: hometrics
1 Replies

2. Shell Programming and Scripting

Copying files to a directory, renaming it if a file with the same name already exists

Hi All, I need to copy files from one directory to another with the files to be renamed while copying if a file with the same name already exists in the target directory. THanks, Dev (2 Replies)
Discussion started by: dev.devil.1983
2 Replies

3. Shell Programming and Scripting

Perl : copying only the latest file to other directory

In linux.. In a directory there are 3 files which I want to copy only the latest file (ls -ltr myfiles*.txt|tail -1) to other directory in perl? Could anyone please help me with the code? Regards, J (1 Reply)
Discussion started by: scriptscript
1 Replies

4. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

5. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

6. UNIX for Dummies Questions & Answers

No such file or directory error while copying files

Hi, I need to copy files from one dir to another dir. The list of filesnames to be moved are in a file called files2cp.log Script: #!/bin/ksh exec 0</home/amdocs/files2cp.log while read LINE do cp -i /iccs33/attach/"$LINE" /iccs30/attach/"$LINE" done The output is "No such... (6 Replies)
Discussion started by: srinirsr
6 Replies

7. UNIX for Dummies Questions & Answers

script copying the directory (or file) from server to my pc

Hello, I'm trying to create the shell script that: copy (or transfer) the directory from the unix server to my external hard drive (or hard drive) I've been serching this kind of thread here, but no luck so far. anyone can help me? Thank you. (2 Replies)
Discussion started by: myjwjw
2 Replies

8. UNIX for Dummies Questions & Answers

Copying one file at a time from one directory to another directory.

Hi All i want to write a script which could copy one file at a time from one directory to another directory. Scenerio: Let's say i have 100 file in a dirctory,so i want to copy one file at a time to another directory with a sleep statement in between that of 30 secs. please help me... (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies

9. UNIX for Dummies Questions & Answers

Problems with Copying Directory

Hi, i'm completely new to Unix. I'm trying to copy my "Pictures" folder, and all the folders under it, to a different folder "Photos". So say "Pictures" has a sub folder "2". what happens is "2" is copied to "Photos" like i want it to, but then a sub directory "tmp2" is made which... (3 Replies)
Discussion started by: brudnerx
3 Replies

10. UNIX for Dummies Questions & Answers

Copying file names returned from a grep command into another directory

When I do the following : grep -l "string" *, I get a list of file names returned. Is there a way to copy the files returned from the list into another directory ?. Thanks. (4 Replies)
Discussion started by: Kartheg
4 Replies
Login or Register to Ask a Question