Sponsored Content
Top Forums Shell Programming and Scripting Move multiple files to different directory using a single command Post 303017806 by MadeInGermany on Wednesday 23rd of May 2018 01:50:09 AM
Old 05-23-2018
I think only mmv can do it with one command.
Code:
mmv -c "*" /other_dir/ABC_"#1"_`date +%m%d%y`

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to rename multiple files with a single command

Hi I have following list of files at a path: 01.AR.asset 01.AR.index 01.AR.asset.vf 01.AR.asset.xv I want to rename all these files as follows: 73.AR.asset.Z 73.AR.index.Z 73.AR.asset.vf.Z 73.AR.asset.xv.Z Can any body give me a single command to acheive the above results. ... (5 Replies)
Discussion started by: tayyabq8
5 Replies

2. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

3. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

4. Shell Programming and Scripting

Empty out multiple files with a single command?

I have a log directory: /logs/foo.log /logs/bar.log /logs/err.out I'm trying to find a way to > /logs/*.log > /logs/*.out to blank them out, but of course, that doesn't work. Any suggestions? (4 Replies)
Discussion started by: Validatorian
4 Replies

5. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

6. Shell Programming and Scripting

Single command to create multiple empty files(no trailing lines as well).

Hi, i need a single command to create multiple empty files(no trailing lines as well) and empty the files if already existing. please let me know or if this has been ansered, if some ocan share the link please, thanks > newfile.txt or :> newfile.txt do not work (4 Replies)
Discussion started by: Onkar Banerjee
4 Replies

7. UNIX for Dummies Questions & Answers

Sftp multiple files in single command

Hi All, I would like to sftp 2 files with a single command. I tried the below options, sftp suer@test13:"/u01/home/oracle/SetDb.sh /u01/home/oracle/.profile" ./ But what actually happens is Fetching /u01/home/oracle/SetDb.sh to /u01/home/oracle/.profile /u01/home/oracle/SetDb.sh ... (3 Replies)
Discussion started by: sid2013
3 Replies

8. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

9. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies
MMV_STATS_INIT(3)					     Library Functions Manual						 MMV_STATS_INIT(3)

NAME
mmv_stats_init - create and initialize Memory Mapped Value file C SYNOPSIS
#include <pcp/pmapi.h> #include <pcp/mmv_stats.h> void *mmv_stats_init(const char *name, int cluster, mmv_stats_flags_t flags, const mmv_metric_t *stats, int nstats, mmv_indom_t *indoms, int nindoms); cc ... -lpcp_mmv -lpcp DESCRIPTION
mmv_stats_init creates and initializes the content of the MMV(5) file, returning a handle that is used in subsequent MMV API calls. mmv_stats_stop performs an orderly shutdown of the mapping handle returned by an earlier initialization call. The file is created in the $PCP_TMP_DIR/mmv directory, name argument is expected to be a basename of the file, not the full path. The metadata content of the file does not change after the file has been created. The old file is removed unconditionally unless there was an error. cluster is the preferred MMV PMDA cluster ID to be used for the metrics originating from this call to mmv_stats_init. The flags provide additional control over the behaviour of the MMV PMDA - e.g. use of MMV_FLAG_PROCESS will ensure values are only exported when the instru- mented application is running - this is verified on each request for new values. stats is the array of mmv_metric_t elements of length nstats. Each element of the array describes one PCP metric. typedef struct { char name[MMV_NAMEMAX]; /* Name of the metric */ __uint32_t item; /* Item component of PMID */ mmv_metric_type_t type; /* Type of the metric */ mmv_metric_sem_t semantics; /* Semantics of the metric */ pmUnits dimension; /* Dimensions (TIME,SPACE,etc) */ __uint32_t indom; /* Instance domain identifier */ char *shorttext; /* Optional, one-line help */ char *helptext; /* Optional, full help text */ } mmv_metric_t; If indom is not zero and not PM_INDOM_NULL, then the metric has multiple values and there must be a corresponding indom entry in the indom list (uniquely identified by serial number). The stats array cannot contain any elements which have no name - this is considered an error and no metrics will be exported in this case. indoms is the array of mmv_indom_t elements of length nindoms. Each element of the array describes one PCP instance domain. typedef struct { __int32_t internal; char external[MMV_NAMEMAX]; } mmv_instances_t; typedef struct { __uint32_t serial; /* Unique serial number */ __uint32_t count; /* Number of instances */ mmv_instances_t *instances; /* Internal/external IDs */ char *shorttext; /* Short help text */ char *helptext; /* Long help text */ } mmv_indom_t; RETURNS
The function returns the address of the memory mapped region on success or NULL on failure. SEE ALSO
mmv_inc_value(3), mmv_lookup_value_desc(3) and mmv(5). Performance Co-Pilot MMV_STATS_INIT(3)
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy