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
rcmgr(8)						      System Manager's Manual							  rcmgr(8)

NAME
rcmgr, rc.config - Gets, sets, or deletes runtime configuration variables stored in the files /etc/rc.config, /etc/rc.config.common, and /etc/rc.config.site SYNOPSIS
/usr/sbin/rcmgr [-c | -s] delete variable /usr/sbin/rcmgr [-c | -s] get variable [value] /usr/sbin/rcmgr [-c | -s] mget variable [value] /usr/sbin/rcmgr [-c | -s] set variable value /usr/sbin/rcmgr [-h | -n] [member_number] get variable [value] /usr/sbin/rcmgr [-h | -n] [member_number] mget variable [value] /usr/sbin/rcmgr [-h | -n] [member_number] set variable value /usr/sbin/rcmgr [-h | -n] [member_number] delete variable OPTIONS
The rcmgr command is used with at most one of the options -c, -s, -h, or -n. The options -c and -s are called file options and -h is called the host option. Operations are performed on /etc/rc.config.common, the clusterwide configuration file. Operations are performed on /etc/rc.config.site, the sitewide configuration file. Operations are performed on the /etc/rc.config file for the cluster member whose member ID corresponds to member_number. Operations are performed only on the node-specific file. DESCRIPTION
The rcmgr command retrieves, sets, or deletes runtime configuration variables stored in the hierarchy of configuration files: /etc/rc.con- fig, /etc/rc.config.common, and /etc/rc.config.site. These three files are together referred to as /etc/rc.config*. The runtime variables are used to configure various subsystems (for example, NFS or NTP) via scripts in the /sbin/init.d directory. Caution You should always use rcmgr to make changes to the files. This will preserve the correct syntax in the files. A lock file, /etc/rcmgr.lock prevents multiple access to the data files. These files are used as follows: On a standalone system, configuration variables in both /etc/rc.config and /etc/rc.config.common are used to configure the system. In a cluster, configuration variables defined in the /etc/rc.config.common file are shared by all cluster mem- bers. Because the /etc/rc.config file is defined as a context-dependent symbolic link (and must be maintained as such), there is a distinct /etc/rc.config file for each member in a cluster. The configuration variable settings in any given member's /etc/rc.config file apply only to that member. You can also create a sitewide configuration file named /etc/rc.config.site and distribute it among systems in a local area network or at a particular site. Note that Tru64 UNIX does not ship with such a file. If you decide to use a sitewide configuration file, you must create it, copy it to /etc/rc.config.site on each participating system, and edit each participating system's /etc/rc.config file to include the following command just before the similar line that executes # Read in the cluster sitewide attributes before overriding them # with the clusterwide and member-specific values. # . /etc/rc.config.site # The hierarchy of the /etc/rc.config* files allows an administrator to define configuration variables consistently over all nodes within a local area network and within a cluster. Variables that are the same for all machines on a LAN can be defined in a sitewide file. Variables that are not specific to a given machine and are (or could be) shared by all members of a cluster should be defined in the clusterwide file. Finally, variables specific to a given machine's hardware configuration should be defined in the machine-specific file (or each machine-specific file in a cluster). Command options either search the file hierarchy or operate directly on the the appropriate file as follows: ------------------------------------------------------------------ Option get mget set delete ------------------------------------------------------------------ -s direct direct direct direct -c direct direct direct direct -n direct direct direct direct -h hierarchy hierarchy direct direct Null (no option hierarchy hierarchy hierarchy direct specified) ------------------------------------------------------------------ For example, the -h and -n options do exactly the same thing for set and delete operations. For get and mget operations, the -n option operates only on the the rc.config file. Consider the following command: # rcmgr -h 2 get NUM_TCPD If the variable NUM_TCPD is not defined in the rc.config file, the rcmgr command searches the rc.config.common file next. If the value is found in the rc.config.common file, it is returned. If not, the rcmgr command searches the rc.config.site file. In contrast, you can specify the -n option as follows: # rcmgr -n 2 get NUM_TCPD In this case, if NUM_TCPD is not defined in the rc.config file, then no value is returned and no other files in the hierarchy are searched. The operations are defined in the following section. OPERATIONS
The get operation returns one of the following: the value of variable defined in one of the /etc/rc.config* files, value, or null. If the -coption is specified, the command looks only in the /etc/rc.config.common file. If the -s option is specified, the command looks only in the /etc/rc.config.site file. If the -h member_number option is specified, the command returns the value as defined for the cluster member whose member ID corresponds to member_number. If the -n member_number option is specified, the command looks only in the /etc/rc.config file. The get operation uses a standard search order: it first looks in /etc/rc.config; it then looks in /etc/rc.config.common; finally it looks in /etc/rc.config.site. If no file or host option is specified, the command finds the first definition of variable, using the standard search order. If the variable is not found in any of the files, the command returns value, if specified; otherwise it returns null. If the value of a variable is set to "" (null), then an rcmgr get operation on that variable will return an empty string. With no option specified, the mget operation returns all the variables defined in any of the /etc/rc.config* files, using the standard search order. If a variable is defined in more than one of the files, the first value encountered is returned. If -h member_number is specified, the operation functions identically, except it returns the values as defined for the cluster member whose member ID corresponds to member_number, using the standard search order. If the -n member_number option is specified, the command looks only in the /etc/rc.config file. The values are output one per line in the form variable=value. If no option is specified, the set operation uses the standard search order to set variable to value in the first /etc/rc.config* file in which it finds a definition of variable. If no definition is found, the set is done in the local /etc/rc.config file. If -c or -s is specified, the set is done in /etc/rc.config.common or /etc/rc.config.site, respectively. If -h member_number is specified, the set is done in the /etc/rc.config file for the cluster member whose member ID corresponds to member_number. If no option is specified, the delete operation removes variable from the /etc/rc.config file. The standard search order is not used. If -c or -s is specified, the delete is done in the /etc/rc.config.common or /etc/rc.config.site file, respectively. If -h member_num- ber or -n member_number is specified, the delete is done in the /etc/rc.config file for the cluster member whose member ID corre- sponds to member_number. ERRORS
If there is an error in an argument passed to rcmgr, or if a file option was specified but the file does not exist, rcmgr returns an error message and aborts execution with the exit value 1. EXAMPLES
This example sets the variable HOSTNAME to yukio in the /etc/rc.config file. rcmgr set HOSTNAME yukio This example sets the variable IFCONFIG_0 to 111.111.1.11 netmask 255.255.252.0 in the /etc/rc.config file. rcmgr set IFCONFIG_0 111.111.1.11 netmask 255.255.252.0 This example displays the value of the variable NIS_ARGS in the first definition of NIS_ARGS it finds using the standard search order. If no value is found in any of the /etc/rc.config* files, the command returns null. rcmgr get NIS_ARGS Startup scripts can use the get operation to provide values to variables as in the following examples. This example sets the value of net- devs to the value of MAX_NETDEVS in the /etc/rc.config file on node barney. If no value is defined, it sets netdevs to 24. netdevs=`rcmgr -h barney get MAX_NETDEVS 24` This example sets num_nfsd to 4 if NUM_NFSD is not defined in any of the /etc/rc.config* files. Otherwise, it sets num_nfsd to the value specified in the first definition of NUM_NFSD it finds using the standard search order. num_nfsd=`rcmgr get NUM_NFSD 4` This example deletes the definition of the variable NETDEV_1 from the clusterwide file /etc/rc.config.common. rcmgr -c delete NETDEV_1 FILES
Prevents applications from accessing the data files concurrently, which could cause data corruption. SEE ALSO
System Administration rcmgr(8)