ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux Find command

    IT Discussion
    linux cli education learning
    2
    9
    1.3k
    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.
    • DustinB3403D
      DustinB3403
      last edited by

      Ok so looking to the community as I'm working on production and I don't want to screw up.

      find /home/FTP/* -type file -mtime +14 -print > ~/ftp-files-old.txt

      The goal is to look in every sub from /home/FTP/ and find any files older than 14 days and output the list into that document.

      Is this the right way to do this?

      scottalanmillerS 1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @DustinB3403
        last edited by

        @dustinb3403 said in Linux Find command:

        Ok so looking to the community as I'm working on production and I don't want to screw up.

        Should be...

        find /home/FTP ....
        
        DustinB3403D 1 Reply Last reply Reply Quote 1
        • scottalanmillerS
          scottalanmiller
          last edited by

          Otherwise, looks fine.

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403 @scottalanmiller
            last edited by

            @scottalanmiller said in Linux Find command:

            @dustinb3403 said in Linux Find command:

            Ok so looking to the community as I'm working on production and I don't want to screw up.

            Should be...

            find /home/FTP ....
            

            find /home/FTP -type file -mtime +14 -print > ~/ftp-files-old.txt

            So that should work?

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @DustinB3403
              last edited by

              @dustinb3403 said in Linux Find command:

              @scottalanmiller said in Linux Find command:

              @dustinb3403 said in Linux Find command:

              Ok so looking to the community as I'm working on production and I don't want to screw up.

              Should be...

              find /home/FTP ....
              

              find /home/FTP -type file -mtime +14 -print > ~/ftp-files-old.txt

              So that should work?

              Looks right

              DustinB3403D 1 Reply Last reply Reply Quote 1
              • DustinB3403D
                DustinB3403 @scottalanmiller
                last edited by

                @scottalanmiller Cool.

                Thanks for the help.

                1 Reply Last reply Reply Quote 0
                • DustinB3403D
                  DustinB3403
                  last edited by DustinB3403

                  Hrm. . .

                  One more thing, would it be possible to print the last access date to this some how?

                  scottalanmillerS 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @DustinB3403
                    last edited by

                    @dustinb3403 said in Linux Find command:

                    Hrm. . .

                    One more thing, would it be possible to print the last access date to this some how?

                    Possible, yes. Easy. No since the find command never shows that.

                    DustinB3403D 1 Reply Last reply Reply Quote 1
                    • DustinB3403D
                      DustinB3403 @scottalanmiller
                      last edited by

                      @scottalanmiller said in Linux Find command:

                      @dustinb3403 said in Linux Find command:

                      Hrm. . .

                      One more thing, would it be possible to print the last access date to this some how?

                      Possible, yes. Easy. No since the find command never shows that.

                      Would there be a better approach? I'm trying to create a list of things to make people clean up their crap, and I can show them "hey this hasn't been access in X years. . . delete it or I will"

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post