|By Hovhannes Avoyan||
|August 25, 2011 04:30 PM EDT||
In the first part of our series we described how to use find (and locate) to search for files using their names. Today we are going to review how to utilize find in a less common but very useful way. But first a few words on testing (okay, this might not be necessary for everyone, but bear with me!).
1. How to test
It is very important to remember that the find command allows you to create a list of objects having the value of a property the same, greater or smaller then given “n” — which stands for a number of days defined as 24 hours periods, with any frictional part ignored:
- +n – value of file property grater than n,
- n – value of file property the same as n,
- -n – value of file property smaller than n.
2. Search using time related information.
One of the most useful features of find is the ability to separate files based on the time of their creation, access and modification. This is done by the family of “time” tests. In “n” language, 47 hours will be given the same value as 25 hours (n=1). This behaviour can be changed by adding the option “-daystart” (measure time from beginning of today, so “n” for yesterday equals 1 in front of a test. Have a look at these time definitions below:
- -mtime n (Modification TIME) – probably the most useful from time-related tests, allowing to search files based on their modification time. If you want to have a list of all log files modified 2 days ago (or to be precise between 48 and 72 hours ago) you can run:
find /var/log -mtime 2
- -atime n (Access TIME) – the results based on a file’s last access time. If you want to see all logs accessed today you can run:
find /var/log -atime 0
Please remember it might be misleading if you check the file system mounted with option -noatime (which improves performance).
- -ctime n ([status] Change TIME) – this test searches files based on change of status (It means ownership, access privileges or type). For example you want to find which (or any at all) of the files in your home directory have changed status in the last 48 hours (which might indicate problems) you can run:
find ~ -ctime -1
Measuring time in days is not always very handy. Sometimes it is necessary to find more recent changes. To make it possible, the above test has minuets-base equivalents:
- -mmin n – test modification time but in minutes rather than days;
- -amin n – test access time but in minutes rather than days;
- -cmin n – test status change time but in minutes rather than days.
Imagine the following situation: You have downloaded a file under five minutes ago, but you are not sure where you have saved it. You can try the following command:
find ~ -mmin -5
In this scenario mmin can be change to amin or cmin, because all “three times” have the same initial value.
Lastly, there are tests allow you to search files in relation to a property of another file. For example:
- -newer file – returns files modified more recently than the given file,
- -anewer file – return files accessed more recently than the given file,
- -cnewer file – return files with the status changed more recently than for the given file.
For example, the following command will list all files accessed later than file DSCF1002.avi in directory /home/movies:
find /home/movies -anewer DSCF1002.avi
There is also a fourth ‘newer’ test:
- -newerXY reference – which compares timestamp with the given timestamp of the reference file. XY has to be substituted by one or two from the following timestamp type:
- a – access time,
- B – birth (creation) time,
- c – inode status change time,
- m – modification time,
- t – reference is interpreted directly as a time.
Please remember that not all combinations are supported (notable X cannot equal t) and B is not supported on all systems. For example, to get the list of all files accessed in /var/cache later than (in BST) July 20th 10:45:32 2011:
find /var/cache -newerat ‘Jul 20 10:45:32 BST 2011’
To create another list with files modified later than the last access to your .profile file:
find /var/cache -newerma ~/.profile
There is one more test that allows you to search based on a time-related parameter:
- -used n – creates the list of files accessed “n” days after its status was last changed. To find not very often accessed files (let say one month) in /var directory, use this command:
find /var/ -used +30
Appendix. ls and time
You can try to create similar lists with a little help from the ls command. There are three ls commands that correspond to the above find test. They allow you to sort files according to:
- -t – modification time (mtime);
- -u – access time (atime);
- -c – status change time (ctime).
Option -t simply sorts by modification time, but option -u and -c behave different in connection with other options:
- ls -u – sorts by access time (receptively ls -c sorts by status change time);
- ls -ul – shows access time but sorts by name (ls -cl – shows status change time but sorts by name);
- ls -ult – shows and sorts by access time (ls -clt – shows and sorts by status change time).
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Mar. 26, 2017 12:45 PM EDT Reads: 1,243
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Mar. 26, 2017 12:30 PM EDT Reads: 1,076
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
Mar. 26, 2017 11:00 AM EDT Reads: 2,163
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
Mar. 26, 2017 10:45 AM EDT Reads: 603
SYS-CON Events announced today that Infranics will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
Mar. 26, 2017 10:15 AM EDT Reads: 2,997
SYS-CON Events announced today that SD Times | BZ Media has been named “Media Sponsor” of SYS-CON's 20th International Cloud Expo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and commercial UAV markets.
Mar. 26, 2017 09:30 AM EDT Reads: 4,285
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
Mar. 26, 2017 09:15 AM EDT Reads: 1,949
Now that the world has connected “things,” we need to build these devices as truly intelligent in order to create instantaneous and precise results. This means you have to do as much of the processing at the point of entry as you can: at the edge. The killer use cases for IoT are becoming manifest through AI engines on edge devices. An autonomous car has this dual edge/cloud analytics model, producing precise, real-time results. In his session at @ThingsExpo, John Crupi, Vice President and Eng...
Mar. 26, 2017 09:00 AM EDT Reads: 3,870
SYS-CON Events announced today that HTBase will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
Mar. 26, 2017 08:15 AM EDT Reads: 2,884
There are 66 million network cameras capturing terabytes of data. How did factories in Japan improve physical security at the facilities and improve employee productivity? Edge Computing reduces possible kilobytes of data collected per second to only a few kilobytes of data transmitted to the public cloud every day. Data is aggregated and analyzed close to sensors so only intelligent results need to be transmitted to the cloud. Non-essential data is recycled to optimize storage.
Mar. 26, 2017 08:15 AM EDT Reads: 2,985
"I think that everyone recognizes that for IoT to really realize its full potential and value that it is about creating ecosystems and marketplaces and that no single vendor is able to support what is required," explained Esmeralda Swartz, VP, Marketing Enterprise and Cloud at Ericsson, in this SYS-CON.tv interview at @ThingsExpo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Mar. 26, 2017 08:00 AM EDT Reads: 4,155
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
Mar. 26, 2017 07:15 AM EDT Reads: 1,667
SYS-CON Events announced today that IoT Now has been named “Media Sponsor” of SYS-CON's 20th International Cloud Expo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. IoT Now explores the evolving opportunities and challenges facing CSPs, and it passes on some lessons learned from those who have taken the first steps in next-gen IoT services.
Mar. 26, 2017 03:30 AM EDT Reads: 3,870
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex softw...
Mar. 26, 2017 01:45 AM EDT Reads: 3,762
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Mar. 26, 2017 12:30 AM EDT Reads: 1,948
What sort of WebRTC based applications can we expect to see over the next year and beyond? One way to predict development trends is to see what sorts of applications startups are building. In his session at @ThingsExpo, Arin Sime, founder of WebRTC.ventures, will discuss the current and likely future trends in WebRTC application development based on real requests for custom applications from real customers, as well as other public sources of information,
Mar. 26, 2017 12:15 AM EDT Reads: 793
As businesses adopt functionalities in cloud computing, it’s imperative that IT operations consistently ensure cloud systems work correctly – all of the time, and to their best capabilities. In his session at @BigDataExpo, Bernd Harzog, CEO and founder of OpsDataStore, will present an industry answer to the common question, “Are you running IT operations as efficiently and as cost effectively as you need to?” He will expound on the industry issues he frequently came up against as an analyst, and...
Mar. 26, 2017 12:00 AM EDT Reads: 4,182
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
Mar. 26, 2017 12:00 AM EDT Reads: 1,778
Apache Hadoop is emerging as a distributed platform for handling large and fast incoming streams of data. Predictive maintenance, supply chain optimization, and Internet-of-Things analysis are examples where Hadoop provides the scalable storage, processing, and analytics platform to gain meaningful insights from granular data that is typically only valuable from a large-scale, aggregate view. One architecture useful for capturing and analyzing streaming data is the Lambda Architecture, represent...
Mar. 25, 2017 08:45 PM EDT Reads: 6,074
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Mar. 25, 2017 08:45 PM EDT Reads: 2,849