Hello World Script Not Detected Using locate and whereis
As above.
I read somewhere that shell scripts are not detected because they may be system files. So how do I detect them. Noob as I am just doing my hello world program. Also what is the difference between "ls bin" and "ls /bin" |
Not sure what you're referring to, but that's not true at all. all real files will be indexed by locate. Whereis is a different tool though which searches your $PATH statement for appropriate executable files and manuals, see the manpage for more details.
In general, you should state the problem you actually have, not what you think you need to do to fix it. Why are you where you think you are? |
I created a new script and saved it. locate and whereis does not detect it. However, I can see it using my gnome desktop.
|
hmm,
it might be that you didn't refresh the DB for 'locate' with "updatedb &" otherwise you can search for it with find: Code:
#> find / -name 'yourscriptname' -ls good luck with finding 'yourself' :) |
Do I have to do sudo updatedb every time after I log out?
I remembered I did it quite recently. |
Quote:
Or, you can just set a cron job to run it once a day. |
Quote:
"ls /bin" will give you a listing of files in /bin, because that's an absolute path, not a relative one. |
TBH you shouldn't want to do what you're doing. You know where the script is. In your current situation, neither command provides anything you don't already know, so I'd say just forget about it in this *specific* example, it's not important for what you're doing.
|
Re updatedb, I believe most distros these days create a cronjob for that at install time; usually set to run about 4am? Have skim through your crontabs; no point in re-inventing the wheel.
|
All times are GMT -5. The time now is 04:46 PM. |