Sponsored Content
Top Forums Shell Programming and Scripting Deal with a range of file names Post 302818597 by omega3 on Saturday 8th of June 2013 02:10:12 AM
Old 06-08-2013
Deal with a range of file names

Red Hat enterprise Lines 5.8

I have files like below. All the below files are created in the same minute.

Using mv command, I want to move 33 files starting from

HTML Code:
pg424_fcds_1_718519105_34304.dat 
to 
pg424_fcds_1_718519105_34336.dat
to another direcory called /data/fcds_logs/

ls output look like below

Code:
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34300.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34301.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34302.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34303.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34304.dat -------------> start
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34305.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34306.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34307.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34308.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34309.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34310.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34311.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34312.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34313.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34314.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34315.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34316.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34317.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34318.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34319.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34320.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34321.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34322.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34323.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34324.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34325.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34326.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34327.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34328.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34329.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34330.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34331.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34332.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34333.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34334.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34335.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34336.dat -----> end
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34337.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34338.dat
-rw-r--r--. 1 root root    0 Jun  8 09:54 pg424_fcds_1_718519105_34339.dat

Another similair requirement, Can I use rm command to remove the range of files I've mentioned ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to print file names in a certain date range using ls

I need to list only file names of a specific date from the command ls -lt. :confused: (2 Replies)
Discussion started by: Shamwari
2 Replies

2. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

3. UNIX for Dummies Questions & Answers

How to list file names in a certain date range using ls command?

Hi experts, I Need to print file names in a certain date range using ls:confused:. Please help me with any sample script. Thanks a lot in advance. Regards, Satish (4 Replies)
Discussion started by: satish.vutti
4 Replies

4. Shell Programming and Scripting

print range between two patterns if it contains a pattern within the range

I want to print between the range two patterns if a particular pattern is present in between the two patterns. I am new to Unix. Any help would be greatly appreciated. e.g. Pattern1 Bombay Calcutta Delhi Pattern2 Pattern1 Patna Madras Gwalior Delhi Pattern2 Pattern1... (2 Replies)
Discussion started by: joyan321
2 Replies

5. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

6. Shell Programming and Scripting

How to deal files with space in names?

I have a bash file as following: #!/bin/sh deal_file(){ printf $1 printf "\t is a file" echo } main(){ for file in `find "$1" ` do deal_file $file done } main $1 then I run ./t.sh .,get the following results: (1 Reply)
Discussion started by: 915086731
1 Replies

7. Shell Programming and Scripting

Split File by Pattern with File Names in Source File... Awk?

Hi all, I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example: ... (2 Replies)
Discussion started by: cul8er
2 Replies

8. Shell Programming and Scripting

copy range of lines in a file based on keywords from another file

Hi Guys, I have the following problem. I have original file (org.txt) that looks like this module v_1(.....) //arbitrary number of text lines endmodule module v_2(....) //arbitrary number of text lines endmodule module v_3(...) //arbitrary number of text lines endmodule module... (6 Replies)
Discussion started by: kaaliakahn
6 Replies

9. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

10. Shell Programming and Scripting

awk to lookup section of file in a range of another file

In the below, I am trying to lookup $1 and $2 from file1, in a range search using $1 $2 $3 of file2. If the search key from file1 is found in file2, then the word low is printed in the last field of that line in the updated file1. Only the last section of file1 needs to be searched, but I am not... (6 Replies)
Discussion started by: cmccabe
6 Replies
ARPSNMP(8)						      System Manager's Manual							ARPSNMP(8)

NAME
arpsnmp - keep track of ethernet/ip address pairings SYNOPSIS
arpsnmp [ -d ] [ -f datafile ] [ -e username ] [ -s username ] file [ ... ] DESCRIPTION
Arpsnmp keeps track for ethernet/ip address pairings. It syslogs activity and reports certain changes via email. Arpsnmp reads information from a file (usually generated by snmpwalk(1)). The -d flag is used enable debugging. This also inhibits mailing the reports. Instead, they are sent to stderr. The -f flag is used to set the ethernet/ip address database filename. The default is arp.dat. Note that an empty arp.dat file must be created before the first time you run arpsnmp. If the -e flag is used, arpsnmp sends e-mail messages to username rather than the default (root). If a single `-' character is given for the username, sending of e-mail is suppressed, but logging via syslog is still done as usual. (This can be useful during initial runs, to collect data without being flooded with messages about new stations.) If the -s flag is used, arpsnmp sends e-mail messages with username as the return address, rather than the default (root). REPORT MESSAGES
(See the arpwatch(8) man page for details on the report messages generated by arpsnmp(8).) FILES
/var/lib/arpwatch - default directory arp.dat - ethernet/ip address database ethercodes.dat - vendor ethernet block list SEE ALSO
arpwatch(8), snmpwalk(1), arp(8) AUTHORS
Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA. The current version is available via anonymous ftp: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz BUGS
Please send bug reports to arpwatch@ee.lbl.gov. Attempts are made to suppress DECnet flip flops but they aren't always successful. 4th Berkeley Distribution 17 September 2000 ARPSNMP(8)
All times are GMT -4. The time now is 09:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy