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
SYSTEMD-VOLATILE-ROOT.SERVICE(8)			   systemd-volatile-root.service			  SYSTEMD-VOLATILE-ROOT.SERVICE(8)

NAME
systemd-volatile-root.service, systemd-volatile-root - Make the root file system volatile SYNOPSIS
systemd-volatile-root.service /lib/systemd/systemd-volatile-root DESCRIPTION
systemd-volatile-root.service is a service that replaces the root directory with a volatile memory file system ("tmpfs"), mounting the original (non-volatile) /usr inside it read-only. This way, vendor data from /usr is available as usual, but all configuration data in /etc, all state data in /var and all other resources stored directly under the root directory are reset on boot and lost at shutdown, enabling fully stateless systems. This service is only enabled if full volatile mode is selected, for example by specifying "systemd.volatile=yes" on the kernel command line. This service runs only in the initial RAM disk ("initrd"), before the system transitions to the host's root directory. Note that this service is not used if "systemd.volatile=state" is used, as in that mode the root directory is non-volatile. SEE ALSO
systemd(1), systemd-fstab-generator(8), kernel-command-line(7) systemd 237 SYSTEMD-VOLATILE-ROOT.SERVICE(8)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy