Are you working with thousands of files? Do you forget the recently modified documents in Linux? but know where you have saved those files.? Then, this article is for you to identify and list down recently modified records in Linux.Using Find CommandThe following command is helpful to identify sorted files in the reverse order of update time-$ find /etc -type f -printf '%TY-%Tm-%Td %TT %p' | sort -rThe sample output should be like this –2016-12-22 11:10:18.2928833250 /etc/cups/subscriptions.conf 2016-12-22 11:09:18.1987314780 /etc/cups/subscriptions.conf.O 2016-12-20 10:38:47.1524556320 /etc/init.d/.depend.stop 2016-12-20 10:38:47.1524556320 /etc/init.d/.depend.start 2016-12-20 10:38:47.1524556320 /etc/init.d/.depend.boot 2016-12-19 13:28:14.3963910250 /etc/ld.so.cache 2016-12-19 13:28:05.8242856890 /etc/mailcap 2016-12-19 13:24:12.4493955340 /etc/apt/sources.list.d/rvm-ubuntu-smplayer-xenial.list 2016-12-19 13:24:12.4493955340 ... Read More
Suppose there are two numbers. We have to check whether a number is divisible by all of the prime factors or the second number or not. Suppose a number is 120. The prime factors are {2, 3, 5}, another number is 75, here the prime factors are {3, 5}. As 120 is divisible by 3 and 5 also, then the decision is yes.If one number is 1, then it has no prime divisors, so answer is True. Otherwise we have to find the GCD of these two numbers. If GCD is 1, then they are co-prime. So answer is false. ... Read More
Here we will see whether a number is Bleak or not. A number is said to be bleak if it cannot be represented as sum of a positive number x and set bit count in x. So x + set_bit_count(x) is not equal to n , for any non-negative number x.The concept is very simple, if the set bit count + the number is not same as the number, then that is Bleak, otherwise it is not.Example Live Demo#include using namespace std; int set_bit_count(int x) { unsigned int bit_count = 0; while (x != 0) { ... Read More
You see them here, there, on the pathways, on the streets, across bridges, inside parks, inside shopping malls between buildings, behind parking lots, and basically anywhere outdoors imaginable. It seems as if the world has been invaded by a huge fleet of ‘Pokemon Go Zombies’ or more generally called ‘Pokemon-goers’.What’s all the Fuss about?Despite mixed reviews and a tad bit of criticism from game critics, Pokemon Go has become quite a phenomenon since its release on the 6th of July, 2016. It is basically a game that makes the use ofthe GPS and the Camera of any Android or IOS ... Read More
Here we will see a number is unusual number or not. A number is said to be unusual if the greatest prime factor of the number is strictly greater than square root of the number. Some of the unusual numbers are: 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 20, 21, 22, 23, 26, 28, 29, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 46To solve this, we will try to find the largest prime factor, then check whether the factor is greater than square root of the number or not. If yes, ... Read More
We have a list L, with n elements. We have to check whether the list is pairwise sorted or not. Suppose the list is like {8, 10, 18, 20, 5, 15}. This is pairwise sorted as (8, 10), (18, 20), (5, 15) are sorted. If the list has odd number of elements, then last one will be ignored.The approach is too simple, traverse the number from left to right. Two consecutive elements are taken, and check whether they are sorted or not, if any one pair is not sorted, return false, if no pair is found, that is unsorted, return ... Read More
One of the most captivating branches of Computer Science – the Artificial Intelligence (AI) – has been thriving on technological fronts. AI is currently used in the programming of computer games, understanding of natural human languages (Apple’s Siri and Microsoft Cortana), neural networks and robotics (eg. Sophia – the most advanced human-like robot).Companies are investing in AI and the percentage is increasing year on year – 38% in 2016 to 62% in 2018, with an expected increase in market growth from Dollars 8 billion in 2016 to Dollars 47 billion in 2020 as per Forbes recent publication.Here the hottest technologies ... Read More
Here we will see, hoe to check a linked list is circular linked list or not. To check whether the linked list is circular or not, we will store the header node into some other variable, then traverse the list, if we get null at the next part of any node, then that is not circular, otherwise we will check the next node is same as the stored node or not, if so then that is circular.Example Live Demo#include using namespace std; class Node{ public: int data; Node *next; }; Node* getNode(int data){ Node *newNode = ... Read More
In this article, we will learn – How to install and configure the Puppet 4 on Ubuntu 16.04. Puppet is a configuration management tool which helps in the automation of tasks with respect to system administrators. These type of tools will save a lot of time and effort too.Pre-requisitesHere in this article, we need at least two to three Ubuntu machines with the following requirements.All the machines with a non-root user with Sudo permissions on the machine.One Puppet masterOne or two puppet agents to test the configuration.Configuring the Host FilesAll the server and clients needed to communicate with the host ... Read More
Here we will see how to check a number is divisible by 13 or not. In this case the number is very large number. So we put the number as string.A number will be divisible by 13, if the number satisfies the following situations −A number is divisible by 13 if and only if we get the alternating sum i.e. alternatively adding and subtracting of blocks of three numbers from right to left is divisible by 13. For example, 2911285 is divisible by 13 because the alternating sum of blocks of size 3 is 2 – 911 + 285 = ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP