Sponsored Content
Top Forums UNIX for Advanced & Expert Users FTP failed to copy mulitple files from multiple directory Post 302571803 by Corona688 on Tuesday 8th of November 2011 09:32:10 AM
Old 11-08-2011
You don't have to reopen the same file 50 times to add 50 lines. You may not even need a file at all.

That 'bye' doesn't even end up in the file at all.

"*.*" is a DOS-ism, if you want all files in UNIX use *

Code:
ftp <<EOF
open $HOST
user $USER "${PASSWD}"
binary
prompt off
cd /home/mylogin/Test
mget *
cd "/home/mylogin/Test2/Important Doc/"
mget *
bye
EOF

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

failed to access directory thru ftp

Hi all, I am a beginner to unix and ftp too.So i request your valuable comments. Requirement: I want to put a specific file into a server(linux) and under a particular directory path in that server as /caps/details/data/ Problem : I login to that server through the command `ftp... (1 Reply)
Discussion started by: DILEEP410
1 Replies

2. UNIX for Dummies Questions & Answers

Copy files from a directory by ftp

Hi all, I have to enable users to access a folder by ftp. Could you tell me which configurations files I must modify or create? Thanks (3 Replies)
Discussion started by: hippa77
3 Replies

3. Shell Programming and Scripting

ftp multiple files from same directory

Hi there Gurus, I have the following ftp script: $ more ftp_dump_arch4.sh #! /usr/bin/ksh # Constant variables HOST='xx.xx.xx.xx' USER='user' PASSWD='password' dir='/export/file' ftp_log='/tmp' ftp -n $HOST > $ftp_log/ftp.log << END user $USER $PASSWD verbose lcd $dir bin (3 Replies)
Discussion started by: lweegp
3 Replies

4. UNIX for Dummies Questions & Answers

Can I copy files on remote server with ftp ?

I just realize the only way is to download and upload again.. is not possible to copy them remotely with the ftp protocol ? thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

5. UNIX for Dummies Questions & Answers

How to copy all files into the same directory

Dear All, Again I have another simple question. :confused: I want to write a csh which can copy all files of a current directory with a new name in the same directory, I mean: If I have tree bird apple as files in a directory I want to give ,say number 007 as argument to my csh and it copies... (3 Replies)
Discussion started by: dreamer0085
3 Replies

6. Shell Programming and Scripting

Copy files from multiple directories into one directory without overwriting them

I have several directories and all those directories have .dat files in them. I want to copy all those .dat files to one directory say "collected_directory" The problem is I don't want to overwrite files. So, if two file names match, I don't want the old file to be overwritten with a new one. ... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

7. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

8. Red Hat

Unable to copy files due to many files in directory

I have directory that has some billion file inside , i tried copy some files for specific date but it's always did not respond for long time and did not give any result.. i tried everything with find command and also with xargs.. even this command find . -mtime -2 -print | xargs ls -d did not... (2 Replies)
Discussion started by: before4
2 Replies

9. Shell Programming and Scripting

Copy the files in directory and sub folders as it is to another directory.

How to copy files from one directory to another directory with the subfolders copied. If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*. I do not want to create sub folders in folder2. Can copy command create them automatically? I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies

10. UNIX for Beginners Questions & Answers

How to copy particular files from a multiple directories and paste in a new directory?

Dear all I have a multiple directories, say for example org1, org2, org3 ..... org100 and each directory having a file namely dnaG.fasta. I need to copy all the dnaG.fasta file from each directory and paste in another directory fastconcatg. Therefore, my script has to copy dnaG.fasta file from... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies
FLIP(1) 						     Linux Programmer's Manual							   FLIP(1)

NAME
flip, toms, toix - do newline conversions between **IX and MS-DOS SYNOPSIS
flip -h flip [ -umvtsbz] file ... flip [ -umvtsbz] - toix [ -vtsbz] file ... toms [ -vtsbz] file ... DESCRIPTION
flip is a file interchange program that converts text file formats between **ix and MS-DOS. It converts lines ending with carriage-return (CR) and linefeed (LF) to lines ending with just linefeed, or vice versa. If the special argument "-" is given, input is read from stdin and written to stdout. flip has the following features: flip will normally refuse to convert binary files. You can override this. When asked to convert a file to the same format that it already has, flip causes no change to the file. Thus to convert all files to **IX format you can type flip -u * and all files will end up right, regardless of whether they were in MS-DOS or in **IX format to begin with. This also works in the opposite direction. If a file contains isolated CR characters for underlining or overprinting, flip does not change them. flip preserves file timestamps. You can override this. flip preserves file permissions. flip is written in C and will compile and run under MS-DOS/Turbo C, 4.3BSD, and System V. flip accepts wildcards and multiple filenames on the command line. If a user interrupt aborts flip, it does not leave behind any garbage files or cause corruption of the files being converted. When converting from MS-DOS to **IX format, flip removes any trailing control Z (the last character in the file), but leaves embed- ded control Z characters unchanged. This minimizes the possibility of accidentally converting a binary file that contains a control Z near the beginning. You can override this and ask flip to recognize the first control Z found as end-of-file. flip can be asked to strip the high (parity) bit as it converts a file. flip is normally invoked as: flip -umhvtb file ... One of -u, -m, or -h is required. Switches may be given separately or combined together after a dash. For example, the three command lines given below are equivalent: flip -uvt *.c flip -u -v -t *.c flip -u -vt *.c On systems that allow a program to know its own name, flip may be renamed (or linked) to a file called toix for conversion to **IX format, or to a file called toms for conversion to MS-DOS format. When invoked with the name toix or toms, flip will act as if it were invoked with the -u or -m option respectively. OPTIONS
-u Convert to **IX format (CR LF => LF, lone CR or LF unchanged, trailing control Z removed, embedded control Z unchanged). -m Convert to MS-DOS format (lone LF => CR LF, lone CR unchanged). -h Give a help message. -v Be verbose, print filenames as they are processed. -t Touch files (don't preserve timestamps). -s Strip high bit. -b Convert binary files too (else binary files are left unchanged). -z Truncate file at first control Z encountered. AUTHOR
Rahul Dhesi <dhesi@bsu-cs.bsu.edu>. SEE ALSO
unix2dos(1), dos2unix(1). Linux 2.0 July 20, 2002 FLIP(1)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy