Display File with a specific letter


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Display File with a specific letter
# 1  
Old 10-09-2010
Error Display File with a specific letter

Hi im a noob in Unix
Do you guys know what command display you the files that have the character n in there name im not looking that they have the n in the beginning or in the end im looking that in search the entire string to see if it have the character n i try this

Code:
ls n*

but only show me the files that begins with n but didnt include the other files that have the letter n but that wasnt in the beging of their names i try to mix the commands

Code:
ls n**n

but didnt work and i have to use ls i cant use find but i can mix with grep sandly im still dont understand how to apply grepSmilie

Last edited by Scott; 10-10-2010 at 06:23 AM.. Reason: Fixed code tags
# 2  
Old 10-10-2010
What about...

Code:
ls | grep *n*


Last edited by Scott; 10-10-2010 at 06:23 AM.. Reason: Added code tags
# 3  
Old 10-10-2010
No, grep doesn't work that way. Shell globbing does, though. Try ls *n* or find ./ -name '*n*' (find is better when you have hundreds or more matching files).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace specific letter in a file by other letter

Good afternoon all, I want to ask how to change some letter in my file with other letter in spesific line eg. data.txt 1 1 1 0 0 0 0 for example i want to change the 4th line with character 1. How could I do it by SED or AWK. I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies

2. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

3. Shell Programming and Scripting

Display specific lines content from the file

Hell, I want to grep certain word from file and display above 2 lines and after two lines. Here is the content of sample file. Mar 14, 2013 12:56:59 AM Agent.Agent SendTo INFO: Connection to server:7041 - Credential Transmit Successesful Mar 14, 2013 8:54:21 AM cgent SendTo WARNING:... (7 Replies)
Discussion started by: balareddy
7 Replies

4. UNIX for Dummies Questions & Answers

Display blocks containing specific pattern

Hi, I have a file containing multiple entries. Each block starts with <BEGIN and ends with <END. Sample data is given below <BEGIN IMSI=095001202630; MSISDN=00145132916; DEFCALL=TS11; CURRENTNAM=BOTH; CAT=COMMON; TBS=TS11&TS12&TS21&TS22; CARDTYPE=SIM; ... (2 Replies)
Discussion started by: krabu
2 Replies

5. Shell Programming and Scripting

Parse and display specific columns

Hi.. I am in help of displaying this specific case. I have multiple files where i have to display accordingly. Input file ##INFO1 ##INFO2 ##INFO3 #CHROM POS INFO 57.sorted.bam 58.sorted.bam 59.sorted.bam 34.sorted.bam 55.sorted.bam... (12 Replies)
Discussion started by: empyrean
12 Replies

6. Homework & Coursework Questions

Using ls or echo to display a specific output

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: What single command line would you enter to get the following output? 8140 drwxr-xr-x 9 root bin 18 Jan 20... (6 Replies)
Discussion started by: dasboot
6 Replies

7. Solaris

Is it possible to setup a samba share to always mount to a specific Windows drive letter???

I'm trying to setup Samba in a solaris zone... Is there a way to setup Samba so that every Windows machine that tries to connect to the share always gets it mounted under the same drive letter (e.g. H:)??? My Samba share (in smb.conf) /home/pickup I want that all Window users get it mounted... (3 Replies)
Discussion started by: verdepollo
3 Replies

8. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

9. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

10. Shell Programming and Scripting

How to print at a specific position of the display

Hi, How can I write a string in a specific position of the screen in a bourne shell? Regards, Elio (1 Reply)
Discussion started by: efernandes
1 Replies
Login or Register to Ask a Question