Questions tagged [stat]
The stat tag has no summary.
193 questions
4 votes
3 answers
729 views
Why does stat show different timezones corresponding to different files?
I always thought that the timezone is not stored by the filesystem, and that stat would show times formatted with the current timezone of the user, and therefore if I do stat on various files today ...
1 vote
0 answers
38 views
Idle time (tty st_atime) not updating when emacs is running
When running GNU emacs in a terminal (in the old-fashioned way, that is, i.e. not in its X windows mode) I've noticed that the w command shows the session as idle, even though emacs is active and ...
0 votes
1 answer
139 views
How to detect when modified time (mtime) returned by stat/lstat cannot be trusted
stat returns the last modified time of a file, but I'm under the impression that it's not always updated correctly, e.g. due to the lazytime mount option or just the driver for some weird virtual or ...
0 votes
1 answer
75 views
obtain time and information about file/folder name change of exfat file system
If I do a stat on a file of a exfat file system, it does provide me the modify/change/creation times. Is there a way to find if the file name has changed? I know there are likely lower level commands ...
0 votes
1 answer
758 views
stat not giving birth datetime in cluster
with the command stat file.txt I get Access: 2024-06-10 14:55:36.254879000 +0300 Modify: 2024-06-10 14:55:36.254879000 +0300 Change: 2024-06-10 14:55:36.254879000 +0300 Birth: - I work in a cluster ...
-1 votes
2 answers
529 views
Is this "stat [option]... inode number..." possible?
Is it possible to use stat for retrieving meta data of File1 by passing File1's inode number as an argument to stat instead of the file name? stat [option - any doing this?] [inode number of File1] ...
1 vote
4 answers
2k views
Bash script - check if any files changed recently
I am writing a script which needs to check if any of the files in a given directory have been modified recently. I thought I could simply use find, however it reports success even if it doesn't find a ...
0 votes
1 answer
449 views
How to determine when KVM vm was created?
OS is Debian. Not asking about uptime of course, but I would like to determine when vm was created and/or first booted. Normally you can do something like: stat / and check birth time, but for a kvm ...
0 votes
1 answer
1k views
After `su user`, getting `fatal: failed to stat : Permission denied` with `git push`
There's a lot of setup for this question: I've got a host (rpi5.local) with 2 user accounts: pi and cake. I wanted to explore git, and I created the cake account to "own" the "server/...
0 votes
0 answers
27 views
In `find -exec`, using back quotes (backticks) with `stat` [duplicate]
I would like find to execute a different command depending on what the stats of a file are. If I run the command find . -name "*" -exec echo {} \+ then I get the list of files in the ...
-1 votes
1 answer
304 views
Bash - cannot stat the last file created in a for...do loop
In a bash script (on Ubuntu 22 if it matters) I have a function which, executed from within a for...do loop, is given a filename to execute some SQLplus <query_name>.sql and store the results in ...
0 votes
0 answers
242 views
Properly escape a string variable that contains special characters to be used in a shell script?
I feel dumb for asking such a simple question but Im absolutely stuck on this one. I've search everywhere, tried several methods to escape or properly quote this variable, but no matter what when I ...
0 votes
0 answers
158 views
How do I get the number of hardlinks of a folder?
I am on Mac. However, I use gstat (GNU stat) so my understanding is that behavior should match linux. I cd to a folder. Then I use gstat --format=%h .. The output is 65. Next, I use gfind . -maxdepth ...
1 vote
1 answer
599 views
How to display file and folder properties from search
I thought this would be easy and there are a lot of somewhat close threads on the internet, but nothing quite right. I want to use fd (simple find command) to display just file name and file size (...
3 votes
4 answers
616 views
Apply arithmetic into piped command
So far I have this: sudo find /path/to/dir -type f | xargs -d "\n" sudo stat -c "%Y %n" | {arithmetic to check if %Y is between 1685518962 and 1685624474??} | {show ...