10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to use grep to find files that have newlines in the filename. For example, I have a directory where I create three files:
$ touch file1
$ touch "file 2"
$ touch "file
> with
> newlines"
$ find
.
./file 2
./file1
./file?with?newlinesI now want to pipe the find output into grep and... (4 Replies)
Discussion started by: Ralph
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have been trying , to find the filename based on some pattern present inside the file
My command is as follows:
filename=`grep -l 'Pattern' path/*.txt `
Its strange that it works some times, but doesn't print anything some times .
But my if test -f $filename is passing all the... (2 Replies)
Discussion started by: Prashanth19
2 Replies
3. Shell Programming and Scripting
Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies
4. UNIX for Dummies Questions & Answers
Hi guys can you please help me with a script to find files with one row the move the file to another directory
the files are in
/optima/prd/optdir/ZTE_BSS/Combiner/ZTE_2G/out/BSC_PS_Basic_Meas
and I want to move them to
/optima/prd/optdir/ZTE_BSS/Loader/error/ZTE_2G/BSC_PS_Basic_Meas
... (5 Replies)
Discussion started by: Dj Moi
5 Replies
5. Shell Programming and Scripting
Hi, I have a series of files (upwards of 500) the filename format is as follows
CC10-1234P1999.WGS84.p190
each of this files is in a directory named for the file but excluding the extension.
Now the last three numeric characters, in this case 999, can be anything from 001 to 999, I need to... (3 Replies)
Discussion started by: roche.j.mike
3 Replies
6. UNIX for Dummies Questions & Answers
Hi
I am newbie to unix scripting, but i have enough knowledge to understand.
I have a specific questions like, I use to collect like 3500 files per experiment, each one named like
data_001.img..
data_002.img
data_003.img
....
data_3500.img
I would like to move every 12 files in the 3500... (3 Replies)
Discussion started by: wpat
3 Replies
7. Shell Programming and Scripting
hi all,
i'm trying to find out how to show files having a particular format. i.e.
files
o570345.out
o5703451.out
XX_570345_1.RTF
so when i search for files using
ls *570345*
it shows all three files but actually i don't like to see the second file o5703451.out because 5703451 is... (6 Replies)
Discussion started by: adshocker
6 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have 500 directories each with multiple data files inside them. The names are sort of random. For example, one directory has files named e_1.dat, e_5.dat, e_8.dat, etc. I need to move the files to a single directory and rename them all in numerical order, from 1.dat to 1000(or some... (1 Reply)
Discussion started by: renthead720
1 Replies
9. Shell Programming and Scripting
Hello,
When I run following script
#!/bin/bash
cd ~/directory1
mv `ls -trF | grep -v / | tail -10 ` ~/directory2
works fine with filenames not having any space but runs into issues with filenames that have spaces tried with $file variable still doesnot work. Can someone help me (4 Replies)
Discussion started by: asakhare
4 Replies
10. UNIX for Dummies Questions & Answers
Hello All.
I am having a directory /tmp/rahul which contains many files in the format
@#home@#rahul@#programs@#script.pl
where /home/rahul/programs is the directory where the script.pl file is to be placed.
I have many files in this format.
What i want is a script which read these... (7 Replies)
Discussion started by: rahulrathod
7 Replies