03-24-2008
Copying specific files
I wanted to see if some one could confirm the proper command and format for copying specific files i.e., ones that contain certain character string in the file name. I would like to copy all files that contain a numeric sequence in the file name i.e., "922371". Files are compressed - *.gz. Would the command format shown below work okay?
cp *922371* directory_name
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am trying to rsync some of the latest files from remote m/c to my local linux box.
Folder structure in my remote m/c looks like this
/pub/Nightly/Package/ROLL/WIN
/pub/Nightly/Package/SOLL/sol
/pub/Nightly/Package/SOLL/linux
Each of the folder contains gzip files which on daily... (0 Replies)
Discussion started by: jhoomsharabi
0 Replies
2. UNIX for Advanced & Expert Users
I am userB and have a dir
/temp1
This dir is owned by me.
How do I recursively copy files from another users's dir userA?
I need to preserve the original user who created files, original group information, original create date, mod date etc.
I tried
cp -pr /home/userA/* .
... (2 Replies)
Discussion started by: Hangman2
2 Replies
3. Shell Programming and Scripting
Hello all
i know it is pretty hard one but you will manage it all
after noticing and calculating i find a rhythm for the file i want to edit
to copy the last 12 characters in line but the problem is to add after first 25 characters in same line
in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies
4. Shell Programming and Scripting
Hi Folks,
I have one curious case. There are list of following files placed in one directory such as... And updated each month.
files.JAN09.csv files.FEB09.csv files.MAR09.csv .....
Now, I need to move a specific files; i.e,
For this month, I need to move only OCT09, NOV09, DEC09,... (1 Reply)
Discussion started by: Jerald Nathan
1 Replies
5. Shell Programming and Scripting
Hi friends,
I have data in tab separated file with headers like this :
*sml1 *sml3 *smln7 smfk9 smllf56...
Which shell command I should use if i want to extract entire columns that have header names beginning with "*" ? i want to copy these columns into another file.
Thanks, (14 Replies)
Discussion started by: jacks
14 Replies
6. UNIX for Dummies Questions & Answers
Hello. I need help with copying part of a file structure to another directory while still keeping the structure. For example look below:
../folder1/sub1/txt.txt
../folder1/sub2/pic.png
../folder2/sub1/pic.png
../folder2/sub2/txt.txt
So in this I would like to copy only the directories and... (3 Replies)
Discussion started by: the
3 Replies
7. Shell Programming and Scripting
Hi All,
I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files.
To Do
From Directory : /myproject/MainDir
To Directory : /myproject/data
List of files need to copy is in the file: /myproject/filesList.txt
... (4 Replies)
Discussion started by: linuxadmin
4 Replies
8. Shell Programming and Scripting
Hi All
I am trying to copy files from one location to another and given below are some sample ones:
aaa_bbb_ccc_ddd_cost_code_20140330.gz
aaa_bbb_ccc_ddd_revenue_zone_20140329.gz
aaa_bbb_ccc_ddd_benefit_extract_20140330.csv.gz
aaa_bbb_ccc_ddd_profit_zone_20150509.csv.gz... (17 Replies)
Discussion started by: swasid
17 Replies
9. Shell Programming and Scripting
I am trying to make my script as simple as a possible but, I am not sure if the way I am approaching is necessarily the most efficient or effective it can be. What I am mainly trying to fix is a for loop to remove a string from the specified files and within this loop I am trying to copy the lines... (2 Replies)
Discussion started by: Allie_gastrator
2 Replies
10. Shell Programming and Scripting
I am trying to write a script that cycles through a folder containing many folders and when inside each one it's supposed to copy all the .fna.gz files to a folder elsewhere if the file and the respective folder have the same name.
for fldr in /home/playground/genomes/* ; do
find .... (8 Replies)
Discussion started by: Mr_Keystrokes
8 Replies
lif(4) Kernel Interfaces Manual lif(4)
NAME
lif - logical interchange format description
DESCRIPTION
LIF (Logical Interchange Format) is a Hewlett-Packard standard mass-storage format that can be used for interchange of files among various
HP computer systems. A LIF volume contains a header (identifying it as a LIF volume) and a directory that defines the contents (i.e.
files) of the volume. The size of the directory is fixed when the volume is initialized (see lifinit(1)) and sets an upper bound on the
number of files that can be created on the volume.
HP-UX contains a set of utilities (referred to as lif*(1)) that can be used to:
o Initialize a LIF volume (i.e. create a header and an empty directory),
o Copy files to and from LIF volumes,
o List the contents of LIF volumes,
o Remove LIF files,
o Rename LIF files.
The lif*(1) utilities are the only utilities within HP-UX where the internal structure of a LIF volume is known. To the rest of HP-UX, a
LIF volume is simply a file containing some unspecified data. The term LIF volume should in no way be confused with the HP-UX notion of a
file system volume or mountable volume.
LIF utilities on HP-UX currently support three file types, ASCII (1), BINARY (-2) and BIN (-23951).
Three copying modes are associated with these file types:
If the copying mode is
ASCII and an HP-UX file is being copied to a LIF volume, the utility strips the trailing LF (line-feed) character, and
inserts two bytes of record length in front of each record. These records are then written to a LIF-formatted medium.
When copying a LIF ASCII file to HP-UX the two-byte record length is stripped and a trailing LF is appended. These
records are then written to the destination. In this mode of copying, the length of the file is preserved. The default
file type for this mode of copying is ASCII (1).
If the copying mode is
and an HP-UX file is being copied to a LIF volume, the utility simply inserts two bytes for record length in front of each
1-Kbyte record. A trailing fractional block has a count reflecting the number of bytes in that block. No interpretation
is placed on the content of the records. These records are then written to a LIF-format medium. When copying a LIF file
to an HP-UX file in copying mode, the record lengths are stripped and the content of records is directly written to the
destination. In this mode of copying, the length of the binary file is preserved. The default file type for this mode of
copying is (-2).
If the copying mode is
RAW, and an HP-UX file is being copied to a LIF volume, the utility simply copies the raw data to the destination. File
sizes that are not integer multiples of 256 bytes are padded with nulls to the next higher multiple. Therefore, When
copying a LIF file to an HP-UX file in RAW mode, the information is copied directly without any interpretation placed on
the content of the source. The default file type for this mode of copying is (-23951).
A LIF volume can be created on any HP-UX file (either regular disk file or device special file) that supports random access via (see
lseek(2)). lif*(1) utilities. See lifinit(1) for details. Within a LIF volume, individual files are identified by 1- to 10-character
file names. File names can consist of uppercase alphanumeric characters (A through Z, 0 through 9) and the underscore character (_). The
first character of a LIF file name must be a letter (A through Z). The lif*(1) utilities accept any file name (including illegal file
names generated on other systems), but can only create legal names. This means that files whose names contain lowercase letters can be
read but not created.
LIF file names are specified to the lif*(1) utilities by concatenating the HP-UX path name for the LIF volume followed by the LIF file
name, separating the two with a colon For example:
specifies LIF file accessed via HP-UX device special file
specifies LIF file within HP-UX disk file
Note that this file-naming convention is applicable only for use as arguments to the lif*(1) utilities, and does not constitute valid path
naming for any other use within the HP-UX operating system.
lif*(1) utilities.
SEE ALSO
lifcp(1), lifinit(1), lifls(1), lifrename(1), lifrm(1).
lif(4)