Questions tagged [stat]

25 questions
23
votes
3 answers

how to know if noatime or relatime is default mount option in kernel?

I was trying to know if relatime or noatime was set on a filesystem, but i didn't found the information, neither in /etc/fstab, neither in kernel boot options. First of all, it seems clear that i don't have the "normal" behaviour on…
13
votes
5 answers

Windows equivalent to the unix "stat" command?

So, I'm looking for a command-line approach to get a short(ish) textual dump of relatively low-level metadata for a file, approximately the same way that stat does on *nix systems. In other words, information that's readily available through Win32…
SamB
  • 1,070
8
votes
1 answer

How to get actual creation time of a file on Unix?

I'm inspecting some files in my dedicated web server via linux cli after a hack attack and found some files have been modified with the 'touch' command to change the dates. I'm willing to get the exact file creation date for these specific…
inckka
  • 233
7
votes
4 answers

Mac OS X 10.6 /usr/bin/stat command, what is the default output showing me?

When I run the stat command, what is the output actually showing? I know you can specify format, but I'm troubleshooting rsync from OS X to NetApp SMB, and trying to work out what is and is not copying.. # stat…
6
votes
1 answer

Faster du/stat alternative for directories

I have several very big directories and i want to know their estimated size. I use for this purpose mostly du, but it takes for each folder about 3 minutes, so i'm asking if there is an alternative to du or stat that takes less time (it could be…
rwx
  • 239
6
votes
2 answers

stat and ls show wrong file size (terabytes wrong)

Ok, I have a bunch of vCard files, all about 200 to 300 Bytes in size. While trying to get them archived, I wondered why that takes so long and discovered that there is one file with a wrong size. Both ls and stat are showing a size of about 8.1…
WolleTD
  • 281
5
votes
1 answer

stat command in Mac OS X

I'm trying to get a formatted time output using a such command in Mac OS X 10.7.5 (in the Terminal app): stat -f "%m" -t "%Y" "myfilename.jpg" However, it still gives me a unixtime, not the formatted string: 1349690206 What I'm doing wrong?
4
votes
3 answers

What's up with stat on Mac OS X/Darwin? Or filesystems without names

In response to a question I asked on SO, Give the mount point of a path, one respondant suggested using stat to get the device name associated with the volume of a given path. This works nicely on Linux, but gives crazy results on Mac OS X 10.4. …
3
votes
1 answer

what is faster, du or stat?

Which goes faster on Linux/Unix? du -b file.dat or: stat -c %s file.dat
Matt
  • 787
2
votes
3 answers

Can not stat over a file name having space in it

I m very new to shell scripting and writing a script for a project. I am having a problem while doing "stat" on a file name, to check size, which has spaces in it. The problem is that I can not write the command directly, and first I have to store…
2
votes
0 answers

accesstime on macOS Catalina 10.15

Suppose you own a file system on a unix machine, and you would like to know which of the regular files on this system you have accessed within some interval. ("Regular file" means it is not a directory.) Not modified, not changed their status, …
2
votes
1 answer

Why is the modification date of my swapfile not changing?

If I check with stat the modification date is not up to date File: /home/shares/swap.file Size: 1962934272 Blocks: 3833864 IO Block: 4096 regular file Device: 801h/2049d Inode: 15 Links: 1 Access: (0600/-rw-------) Uid: ( 0/…
bomben
  • 272
2
votes
2 answers

how to modify the "time offset from UTC" of files

I use stat to get information of files, I notice Access: 2013-12-28 13:12:11.244573123 +0100 Modify: 2013-11-12 22:54:42.274460079 +0200 Change: 2013-12-13 12:45:08.164394887 +0100 the +0100 +0200 means "time offset from UTC" I want to make the…
lily
  • 2,015
1
vote
0 answers

cp: cannot stat error - when filename has Asian characters

I am simply trying to copy files using cp -r /home/user/source/ /home/user/destination/ but it throws me the cp: cannot stat /source/filename.xxx error for some of the files. When I searched for this error, I found some matching questions such as…
Abhinav
  • 111
1
vote
1 answer

Does stat/lstat on nonexistent file cause a disk seek?

When searching for a library file from a right folder, my application currently does couple of lstat's for the possible locationslocations. Now I'm wondering whether these lstat's (application is being a web service, thereby there can be hundred's…
1
2