Unix Commands to display the Filesnames


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unix Commands to display the Filesnames
# 1  
Old 05-02-2007
Unix Commands to display the Filesnames

Query: In a directory there are 20 files, I have to display the Filenames which contains the content as JAVA in any line of the file. Please tell me the command or commands.
# 2  
Old 05-02-2007
Query: In a directory there are 20 files, I have to display the Filenames which contains the content as JAVA in any line of the file. Please tell me the command or commands.
# 3  
Old 05-02-2007
Quote:
Originally Posted by kish_kk84
Query: In a directory there are 20 files, I have to display the Filenames which contains the content as JAVA in any line of the file. Please tell me the command or commands.
Code:
grep -l "JAVA" *

# 4  
Old 05-03-2007
you can search like...
grep -nc "JAVA*" "Filename"

-n and -c are equivalent to -l.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX commands to display the biggest file by size in a directory

Hello guys, Please i need to know the biggest files in my directory let's say$ >du -h | egrep 'M|G|G' 195M ./TMP 3.6M ./TP_DEC2012 146G . But here the result it's giving me the biggest directory in the path. Actually i want to know the biggest file in 146G . Can anyone... (6 Replies)
Discussion started by: gillesi
6 Replies

2. UNIX for Dummies Questions & Answers

Display Pie Chart/Bar Graph in microsoft outlook email using UNIX commands/Shell scripts

I have a shell script which executes to write html codes into a text file. My next step is to email the text file so that receiving person (people who i send email to) should be able to see pie/chart or bar graph (whatever i design in my code) in their email. Following is the example of a sample... (7 Replies)
Discussion started by: bikerboy
7 Replies

3. UNIX for Advanced & Expert Users

Fc command does not display all commands history of a user

hi, i have an AIX6.1 machine and i modified a user's profile so that it creates history file for each ip address that connects with this user. the reason i did this is because more than 1 person connects with the same user so i want to keep track of command run by all of them. therefore, in the... (5 Replies)
Discussion started by: omonoiatis9
5 Replies

4. UNIX for Dummies Questions & Answers

Display lines 30 to 40 of a text file using head and/or tail commands

Assume that the text file contains over 40 lines. How do you do this?!?!? (5 Replies)
Discussion started by: phunkypants
5 Replies

5. UNIX for Dummies Questions & Answers

Display Commands

Hi everyone, I am kunal,.... What command is used to display only directories (not files). ? thanks in advance..... kunal patil kunalpatil09@gmail.com (2 Replies)
Discussion started by: kunalpatil09
2 Replies

6. Solaris

display remote commands

is there a way to display the commands the the remote user is typing -I would like to know a way by which i can log onto a remote system and type commands as the user watched on the console - I know about vnc but that is not what i am looking for -or is it rexec ? Ndegem SCSA (4 Replies)
Discussion started by: ndegem
4 Replies

7. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

8. Shell Programming and Scripting

Listing filesnames in bare format with fullpath

Hi, Need help. How can I get a listing of files in bare format with full path. I mean in the following format. /root/dir1/sub-dir1/file1 /root/dir1/sub-dir1/file2 /root/dir1/sub-dir2/file1 /root/dir1/sub-dir2/file2 /root/dir2/sub-dir1/file1 /root/dir2/sub-dir2/file1... (2 Replies)
Discussion started by: tipsy
2 Replies

9. Shell Programming and Scripting

How to display fractions of a second in UNIX

How can I display fraction of a second using Date command? (2 Replies)
Discussion started by: GNMIKE
2 Replies

10. UNIX for Dummies Questions & Answers

Maingrame to UNIX sending UNIX commands

I want to know if there is a way to send unix commands thru FTP from a mainframe to kick off Autosys Jobs. I just need to send a command from the mainframe to UNIX and have UNIX execute that command. (2 Replies)
Discussion started by: skammer
2 Replies
Login or Register to Ask a Question