Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 072009
 

Becareful when using the mtime option in find command

Answer:

A simple command like the following is very handy when finding all the files in the current directory which have been modified within 1 day.

# find -type f -mtime -1

But the above interpretation is simply wrong!

The real meaning of the above command is: Find all the files in the current directory which have been modified less than 2 days.

So if a file is modified before 1.9999999.. day, it still match the above command since the fractional part is ignored.

Try it yourself if you don't believe.

Reference:

man find

Mar 042008
 

What is the maximum length of a valid UTF-8 character?

Answer:

A valid UTF-8 character take up 1 to 4 bytes (and within each octet, only the first 128 US-ASCII characters is used, so it can compatible with legacy systems).

A subset of UTF-8 called UTF-8 Basic Multilingual Plane (BMP), which only takes 3 bytes and can represent most frequently used characters and is compatible with UTF-16/UCS-2.

Reference: http://en.wikipedia.org/wiki/UTF-8