mget * (obtein files from current directory but not the files form sub-directories)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting mget * (obtein files from current directory but not the files form sub-directories)
# 1  
Old 03-12-2009
mget * (obtein files from current directory but not the files form sub-directories)

Hello,

Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories.

The files names don't follow any defined rule, so they can be just letters without (.) period

Directory structure example:
$ find DirAA -name "*"
DirAA
DirAA/FILE_AA_01
DirAA/FILE_AA_02
DirAA/DirBB
DirAA/DirBB/FILE_BB_01

ftp> mget *
local: DirBB/FILE_BB_01 remote: DirBB/FILE_BB_01
DirBB/FILE_BB_01: No such file or directory


With the instruction "mget *" the (* asterisk) is expanded also for the files on the sub-directories. The files from the sub-directories are not copied, but will originate errors on the log.

So anyone knows if with “mget *” there is a way to get only the files on the current directory, not the files on the sub-directories?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

List all files and directories in the current directory separated by commas and sorted by crtime

What I know so far: ls -A will list all files except those starting with a dot ls -d will list all directories ls -m will separate contents by commas For getting crtimes use: stat filename will give me the inode number or ls -i filename will give... (13 Replies)
Discussion started by: chstewar
13 Replies

2. AIX

How to backup a directory (sub-directories/files) files from one server on to other ?

Hello, Server A: /directory1/ Server B: /Backups/ i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour. If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run. I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

4. Shell Programming and Scripting

Find specific files only in current directory...not sub directories AIX

Hi, I have to find specific files only in the current directory...not in the sub directories. But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help.. I am using the below command. And i am... (2 Replies)
Discussion started by: aakishore
2 Replies

5. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

6. Shell Programming and Scripting

compare files in two directories and output changed files to third directory

I have searched about 30 threads, a load of Google pages and cannot find what I am looking for. I have some of the parts but not the whole. I cannot seem to get the puzzle fit together. I have three folders, two of which contain different versions of multiple files, dist/file1.php dist/file2.php... (4 Replies)
Discussion started by: bkeep
4 Replies

7. Shell Programming and Scripting

How to strip ^M at end of each files for all files found in current directory

I am trying to use a loop to strip of the funny character ^M at the end of all lines in each file found in current directory and I have used the following in a script: find . -type f -name '*.txt' | while read file do echo "stripping ^M from ..." ex - "$file" > $tempfile %s/^M//g wq! # mv... (4 Replies)
Discussion started by: bisip99
4 Replies

8. Shell Programming and Scripting

Finding files in current directory when 100,000's files in current directory

Hi All I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age. I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies

9. UNIX for Dummies Questions & Answers

List files that are not directories from current directory

I can't manage to list all files that are not directories from current directory. (2 Replies)
Discussion started by: beni22sof
2 Replies

10. Shell Programming and Scripting

searching content of files in the current and sub directories

Hi I was wondering why command 2 doesn't work like command 1 below. 1. find . -exec grep "test" '{}' \; -print 2. ls -R | grep "test" I am trying to search "test" from all the files in the current and sub directories. What's wrong with my command 2? Thanks in advance for your help (4 Replies)
Discussion started by: tiger99
4 Replies
Login or Register to Ask a Question
cp(1)							      General Commands Manual							     cp(1)

Name
       cp - copy file data

Syntax
       cp [ -f ] [ -i ] [ -p ] file1 file2

       cp [ -f ] [ -i ] [ -p ] [ -r ] file... directory

       cp [ -f ] [ -i ] [ -p ] [ -r ] directory... directory

Description
       The command copies file1 onto file2.  The mode and owner of file2 are preserved if it already existed; the mode of file1 is used otherwise.
       Note that the command will not copy a file onto itself.

       In the second form, one or more files are copied into the directory with their original file names.

       In the third form, one or more source directories are copied into the destination directory with their original file names.

Options
       -f   Forces existing destination pathnames to be removed before copying, without prompting for confirmation.  The -i option is  ignored	if
	    the -f option is specified.

       -i   Prompts  user  with  the name of file whenever the copy will cause an old file to be overwritten. A yes answer will cause to continue.
	    Any other answer will prevent it from overwriting the file.

       -p   Preserves (duplicates) in the copies the modification time, access time, file mode, user ID, and group ID as allowed  by  the  permis-
	    sions of the source files, ignoring the present umask.

       -r   Copies  directories.  Entire directory trees, including their subtrees and the individual files they contain, are copied to the speci-
	    fied destination directory. The directory, its subtrees, and the individual files retain their original names. For	example,  to  copy
	    the directory including all of its subtrees and files, into the directory enter the following command:
	    cp -r reports news

See Also
       cat(1), pr(1), mv(1)

																	     cp(1)