Code Monkey home page Code Monkey logo

mtime_utils's Introduction

mtime_utils

mtime_utils is a collection of tools for accessing and working with mtime (modification time) associated with files.

get_mtime

get_mtime reads in a list of files from stdin, one per line, and outputs in the same order:

The filename (A Tab Character) (File Modification Time)

The format of the modification time can be controlled by arguments passed to get_mtime.

The default format of modification time is the "ctime" format ( Weekday 3-letter-month 24Hour:Minute:Second 4Year )

Epoch Time: You can print epoch time (seconds since JAN-1-1970) by passing --epoch

Custom Format: You can output in a custom format by passing --format="strftime format here" (see man strftime for format chars)

sort_mtime

sort_mtime reads in a list of files frm stdin, one per line, and outputs sorted by mtime.

Default is descending order, with oldest first. You can pass -r to reverse order (newest on top).

Combining

These tools are perfect for use with the "find" command, for example:

find . -name '*.gcda' | sort_mtime | get_mtime

The above will sort all .gcda (profiling) files in descending order (newest on bottom), and display the ctime next to each file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.