Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Unix Help

  • 19-02-2008 11:54PM
    #1
    Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭


    Its been a logn time since I used Unix and even then it was not that much


    I am trying to access this file 'find' in directory /usr/bin/find
    but when i do cd find in /usr/bin/ I get an error saying 'find' is not a directory.

    How can i access this file?


Comments

  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    Just type 'find'

    :)


  • Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭helimachoptor


    find: insufficient number of arguments
    find: path-list predicate-list



    I get this error blowfish?


  • Registered Users, Registered Users 2, Paid Member Posts: 748 ✭✭✭Dero


    What exactly are you trying to do? I presume you're trying to find some file on your system, but some more detail might make it easier to get help.


  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    find: insufficient number of arguments
    find: path-list predicate-list



    I get this error blowfish?
    Find is a command used for locating files, it's not particularly useful unless you give it something to search for ;)

    Have a look here for an intro on how to use it.


  • Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭helimachoptor


    sorry blowfish her eis the path i am trying to get to...
    /usr/bin/find /transfer/ so find is just a step along it


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    sorry blowfish her eis the path i am trying to get to...
    /usr/bin/find /transfer/ so find is just a step along it
    Ah, well with that, there is a space between the '/usr/bin/find' bit and the '/transfer/' bit. Basically what that means is that you are trying to run the 'find' command (to search for file(s)) on the '/transfer/' folder (the folder you are looking for the file(s) in).


  • Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭helimachoptor


    Blowfish wrote: »
    Ah, well with that, there is a space between the '/usr/bin/find' bit and the '/transfer/' bit. Basically what that means is that you are trying to run the 'find' command (to search for file(s)) on the '/transfer/' folder (the folder you are looking for the file(s) in).

    I can see the space that is just a typo in the email i got and i copied from there,

    I am typing in usr/bin/find/transfer

    Or should i have the space in there?


  • Registered Users, Registered Users 2 Posts: 1,065 ✭✭✭Snowbat


    While 'find' is an executable binary file, like everything else in /bin and /usr/bin it is more useful to think of it as a command:
    eg. find -name *.mp3

    http://www.linux.ie/newusers/beginners-linux-guide/find.php
    http://linux.about.com/od/commands/l/blcmdl1_find.htm


  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    I can see the space that is just a typo in the email i got and i copied from there,

    I am typing in usr/bin/find/transfer

    Or should i have the space in there?
    Keep the space in there, it's not a typo.


  • Registered Users, Registered Users 2 Posts: 1,065 ✭✭✭Snowbat


    Are you looking for a for a file or directory called 'transfer' somewhere in your file system?

    cd /
    find -name transfer


  • Advertisement
  • Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭helimachoptor


    No transfer is another directory with 1 file in it that i need to run a a crontab command on, I've done what i am supposed to but now its asking me do i want to remove the directory which I dont

    Here is the full command i suppose this would have been a better place to start..

    /usr/bin/find /transfer/procesados/ -mtime +60 -exec rm {} \;

    Basically I want to delete the content of the directory every 60 days


    But not the actual directory


  • Registered Users, Registered Users 2, Paid Member Posts: 748 ✭✭✭Dero


    Try

    /usr/bin/find /transfer/procesados/ -type f -mtime +60 -exec rm {} \;


  • Moderators, Science, Health & Environment Moderators Posts: 21,807 Mod ✭✭✭✭helimachoptor


    Dero wrote: »
    Try

    /usr/bin/find /transfer/procesados/ -type f -mtime +60 -exec rm {} \;

    Dero cheers that worked, I now will not have to go near unix for a longtime hopefully!
    Thanks to the rest of you guys too.


Advertisement