10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14... (3 Replies)
Discussion started by: prvnrk
3 Replies
2. Shell Programming and Scripting
So, I have a directory tree that has many files named thusly:
X_REVY.PDF
I need to find any files that have the same X portion (which can be nearly anything) as any another file (in any directory) but have different Y portions (which can be any number from 1-99).
I then need it to return... (3 Replies)
Discussion started by: Kamezero
3 Replies
3. Shell Programming and Scripting
Hi,
I have file in my $datadir as below :-
SAT_1.txt
SAT_2.txt
BAT_UD.lst
BAT_DD1.lst
DUTT_1.txt
DUTT_la.txt
Expected result :-
should get all the above file in $<Filename>_file.lst
Below is my code :-
for i in SAT BAT DUTT
do
touch a.lst
cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies
4. Shell Programming and Scripting
Hi,
I have a unix file with the below structure -
CustId1 CustName1 CustPhn1 /u/home/xmldata/A000001
CustId2 CustName2 CustPhn2 /u/home/xmldata/A000002
CustId3 CustName3 CustPhn3 /u/home/xmldata/A000003
Then I have another unix directory /u/home/xmldata
This directory has... (3 Replies)
Discussion started by: Simanto
3 Replies
5. Shell Programming and Scripting
Hi
I have one directory whose name i don't remember exactly only starting letter i know which is Resp.
Can you please let me know the command to find the similar directory in the root.
Rajesh (3 Replies)
Discussion started by: guddu_12
3 Replies
6. UNIX for Dummies Questions & Answers
Need a Unix command to save the last 20 versions of a file in a specific directory and delete everything else. Date is irrelevant. Anyone aware of such an animal?
In my test, I came up with:
ls -t1 /tmp/testfile* | tail -n +20 | xargs rm
I don’t quite trust the author though! (1 Reply)
Discussion started by: rwsherman
1 Replies
7. Shell Programming and Scripting
hi all,
I have a requirement where in i have to read all the filenames based on a pattern from a directory and concatenate all these file names and write it to another file.
i am using the following code to do this
var1=''
for filename in $_DIR/${FILE_NAME}*
do
if
if
then... (7 Replies)
Discussion started by: nvuradi
7 Replies
8. Shell Programming and Scripting
HI
I need to concatenate two files which are having headers. the result file should contain only the header from first file only and the header in second file have to be skipped.
file1:
name age
sriram 23
file2
name age
prabu 25
result file should be
name age
sriram 23
prabu ... (6 Replies)
Discussion started by: Sriramprabu
6 Replies
9. UNIX for Dummies Questions & Answers
I'm trying to concatenate records from 2 files and output it to a third file. The problem I'm running into is that it seems like the "While" command is limited to processing one file at a time. It seems like you could read a record from file1 into a variable. Then do the same for the for file2.... (4 Replies)
Discussion started by: Powcmptr
4 Replies
10. UNIX for Dummies Questions & Answers
...
i have 4 files to concatenate but in a certain order and i wanted to do it in a shorter one line command , if possible !
4 files : file , file0 , file1 and file2
file1 into file2
file0 into the result
file into the result
thanks in advance
Christian (1 Reply)
Discussion started by: Nicol
1 Replies