RE?? or plain old matching?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers RE?? or plain old matching?
# 1  
Old 12-19-2003
RE?? or plain old matching?

Hi,

I need to get filenames without an extension using an ls command. is there a way to do that?

for example.
I want to get: abc_123_ggg
but not: abc_123_ggg.TXT

Anything would be appreciated.
# 2  
Old 12-19-2003
Probably not what you wanted but it does work.

$ ls abc_123_ggg
# 3  
Old 12-19-2003
Thanks for the reply, but yea, that's not what i wanted.

there are hundreds of files, and i need the file name for all of them that does not have the extension.

thanks..
# 4  
Old 12-19-2003
Give examples of the file names -

If they are all the same length (files with and without extensions) then you can do a listing with a wildcard ? (instead of *).

example: all files have 8 characters and then the .ext

$ ls ???????

will only give you files with 8 characters (it does not care what those characters are)

If you pipe output from the ls command to grep, you can also find what you are looking for:

$ ls -1 *|grep -v \[.\]

ls in one column - search and show only lines not containing .

Last edited by RTM; 12-19-2003 at 12:20 PM..
# 5  
Old 12-19-2003
ls !(*.*)
# 6  
Old 12-19-2003
Many Thanks RTM.

is there a way to do this without using grep?

and no, the filenames are not with the same name.

the ideal way i can do this is:
$ ls not *.txt = to find everything not end with .txt

Thanks.
# 7  
Old 12-19-2003
taking this a step further...
can i view the files without an extension from another location?

ie.
$ more /directory/aaaa/*

but that will display everyfile. I only want to read the ones without the .txt extension?

possible?

Thank you.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Plain text table to csv problems

I´m trying to input a plain text table and I want to output a csv file with semicolon field separator. I have some problems with the \r and the fields with more of one line.. Some gnu util to do this without problems or awk solution? I´m attaching the original plain table file and the needed... (2 Replies)
Discussion started by: faka
2 Replies

2. Shell Programming and Scripting

Script to scp every minute with plain password

Hello, I have a Solaris x86 server. I am installing patch cluster on that. Out of so many patches, any one patch is breaking its LDAP authentication and I am not able to figure out, which one is that. I have restored server and planning to apply that patch cluster again. To figure that patch, I... (0 Replies)
Discussion started by: ron323232
0 Replies

3. Shell Programming and Scripting

Modify one line in a plain text file

Hi everyone, I want to know, if there is a way to modify one line in a text file with unix script, with out re-writing all the file. For example, i have this file: CONFIGURATION_1=XXXX CONFIGURATION_2=YYYY CONFIGURATION_3=ZZZZ supose i have a command or function "modify" that... (7 Replies)
Discussion started by: Xedrox
7 Replies

4. Shell Programming and Scripting

from one word for line to plain text

Hello! I've got a very big file (from tokenization) which has one word for line. How is it possible then to rebuild the "original" text, knowing that <s> and </s> are the sentence-delimiters? My file looks like this: <s> && tanzania na Afrika kwa ujumla ambiwa na taifa kubwa... (6 Replies)
Discussion started by: mjomba
6 Replies

5. Shell Programming and Scripting

Is tcsh 100% compatible with the plain-old csh [on Solaris 9]

Hi folks There are about 200 csh scripts (I didn't wrote them). Do all those scripts run with tcsh without modification? Is tcsh 100% compatible with the plain-old csh? $ which csh /usr/bin/csh $ which tcsh /usr/bin/tcsh $ uname -a SunOS purzelse 5.9 Generic_117171-07 sun4u sparc... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

6. Shell Programming and Scripting

delete " from plain text files

Hi, sorry for bothering with this easy problem but I can't understand... I've a file like this: "4","0x23a3" "5","0x4234" "11","" "20","" "11132","0x6456" I would like to create a file like this: 4,23a3 5,4234 11,999999 20,999999 11132,6456 I've tried: cat INPUT.txt | sed -e... (7 Replies)
Discussion started by: TheMrOrange
7 Replies

7. Linux

Plain Text printing issues

I'm attempting to print to a networked konica printer. No linux drivers that I know of exist, but we've always used HP 5si drivers and have had good results. We just loaded a box up with CentOS 5, and now when we print any sort of file from the command line (lp -dkonica <filename>), the text is... (0 Replies)
Discussion started by: fender177
0 Replies

8. UNIX for Dummies Questions & Answers

Plain Unix Certification for oracle developers

Hi I have read every possible thread here on unix certification. I was looking for a suggestion as to which is a reasonable certification in terms of price and familiarity in the market. All the certs mentioned here involve testing in networking,managing users,backups etc which for me is... (1 Reply)
Discussion started by: systemsb
1 Replies

9. Shell Programming and Scripting

My screen saver for a plain session

Good day. :) I don't know exactly where or how to post this kind of stuff, but I though I'd like to have a look at my "Screen Saver" in progress. Comments welcome. This uses bash. Just copy and pase into any file. Make o+x and run. Feel free to edit and change all u like. Thanks. ... (0 Replies)
Discussion started by: Blooper
0 Replies

10. AIX

email from root sent my passord in plain text.

Root emailed me this message and thats ok it is supposed to. The thing that concerns me is that the ADMIN password came in plain text. I Xed it out for the purpose of this message of course. Is there a way for me to set this so the password comes encrypted? OR is not included at all in the... (4 Replies)
Discussion started by: rocker40
4 Replies
Login or Register to Ask a Question