LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 11: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, 12:02 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
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, 12:05 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:30 PM
Shell script to find a file size sharincharles Linux - Newbie 10 06-20-2011 02:06 PM
How to find the tag value in xml file through unix shell script hussain.s Linux - General 2 11-03-2010 08:52 AM
bash shell script find and edit fields in a file hchoonbeng Programming 9 10-29-2008 03:13 AM
Shell script: how to find a file containing a string guarriman General 2 08-27-2007 04:39 AM


All times are GMT -5. The time now is 08:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration