LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2012, 10:59 AM   #1
kshari8888
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
shell script to find certain file created or not


one file is created and any shell script to find that file is created or not
 
Old 12-13-2012, 11:02 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Hi and welcome to LQ.

... And your question is?

Please describe your problem in a clearer way and tell us where you are stuck so that we can help you.
 
1 members found this post helpful.
Old 12-13-2012, 11:05 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You'd need to provide more detail.

Are you writing a script that creates the file and checking to see if it in fact created it or are you just looking to see if a file exists.

If the latter you don't need a script. If you know the location you can use ls and if you don't you can use find:
e.g.
If you're looking for a file named billybob and it is should be in /usr/local/bin you can do "ls /usr/local/bin/billybob". If it is there it will show the file - if not it will say "not found".
If you don't know where it is you can do "find / -name billybob" and it will find any file of that name.
Note that find is context switch heavy so if you can narrow it down (e.g. if you know it should be somewhere under /usr but not sure exactly where) you should do so:
"find /usr -name billybob"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
to find if a file exist using shell script nanxy Programming 8 09-16-2013 10:30 PM
Shell script to find a file size sharincharles Linux - Newbie 10 06-20-2011 01:06 PM
How to find the tag value in xml file through unix shell script hussain.s Linux - General 2 11-03-2010 07:52 AM
bash shell script find and edit fields in a file hchoonbeng Programming 9 10-29-2008 02:13 AM
Shell script: how to find a file containing a string guarriman General 2 08-27-2007 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration