Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Find a file in multiple directory and get modified date and time

    General pfSense Questions
    3
    9
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yunushaikh
      last edited by

      Hello Experts,

      Can you help me with one command? Here is the scenario
      I have multiple directories on the server whose names starts with tomcat_
      Under this there is a file for example managetest.class

      Now I need to get only the modified date and time for that particular file in the below format

      Folder name            modifieddate

      Is this possible with any command.

      Any help will be appreciated.
      Thanks.

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        By server you mean pfsense?

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

        1 Reply Last reply Reply Quote 0
        • Y
          yunushaikh
          last edited by

          I am really sorry but this is not related to pfsense.

          any help will be great for me if you can

          1 Reply Last reply Reply Quote 0
          • E
            Eskir
            last edited by

            Looking at it from a unix perspective something like

            ls -all -t -d tomcat_*/ 
            

            Edit: This doesn't exactly fit your requirement but if you read more into the -less/-all parameter (provided you're even on unix/linux) I'm sure you'll find the answer.

            Edit2: If the file is always named the same you might want to check

            ls -all -t tomcat_*/filename.filetype 
            

            (Kind of misread your question at first)

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              Well then go to a linux board..  You do understand this a forum for support of pfsense, which is based on freebsd..

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 0
              • Y
                yunushaikh
                last edited by

                This command is giving me lot of things like permissions and owner group

                I just need modified date and time of that file

                1 Reply Last reply Reply Quote 0
                • E
                  Eskir
                  last edited by

                  @johnpoz:

                  Well then go to a linux board..  You do understand this a forum for support of pfsense, which is based on freebsd..

                  This is a good point actually, stackexchange is a great resource there.

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    ^ exactly do you go to a bank and order a bigmac??

                    While there are quite often topics on networking, and even some server stuff - its normally related to getting stuff working through the firewall or networking with pfsense, etc..

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                    1 Reply Last reply Reply Quote 0
                    • Y
                      yunushaikh
                      last edited by

                      Its ok man,
                      Sorry for this topic.
                      Thanks for your help.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.