The tag has no wiki summary.

learn more… | top users | synonyms

16
votes
4answers
6k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.
12
votes
1answer
3k views

Birth is empty on ext4

I was just reading up on the Birth section of stat and it appears ext4 should support it, but even a file I just created leaves it empty. ~ % touch test ...
7
votes
1answer
1k views

When was `relatime` made the default?

What is the first Linux kernel release to set relatime as the default mount option?
7
votes
1answer
934 views

Does inotify fire a notification when a write is started or when it is completed?

Imagine two processes, a reader and a writer, communicating via a regular file on an ext3 fs. Reader has an inotify IN_MODIFY watch on the file. Writer writes 1000 bytes to the file, in a single ...
6
votes
2answers
727 views

What can you do to a file without triggering the “Change” Timestamp?

What can you do to a file without triggering the "Change" stat? For instance, it appears that simply changing a bit will trigger Change.
6
votes
2answers
691 views

Change file creation time on a FAT filesystem

I need a way to change the creation time of a file on a mounted FAT32 volume. I have to do that because my MP3 player will only read files sorted by this creation time. If I can find a way to set the ...
6
votes
3answers
819 views

Equivalent of date --reference in Solaris

The GNU implementation of the date command has a nice feature to show the date of the last modification of a reference file, and using the +FORMAT parameter it is easy to get the date in any format, ...
5
votes
1answer
8k views

What does this process STAT indicates?

If you check the STAT column in above image you will see Ss S S< SN and R+ What does this indicates ? Process states. If yes,Then what is the significance of 'Ss S< SN and R+'?
5
votes
2answers
3k views

Get CPU utilization stats from C program

I want to read the CPU utilization stats from a C program, I am interested in the percentage of use of CPU, steal time etc. These stats are shown in the 3rd row from the top command. I tried to parse ...
4
votes
1answer
297 views

How to compare attributes of two files on Linux ext4

cmp(1) will of course tell me if the contents of two files are identical, but in order to test restoring from backups I also wanted to compare the relevant (!) file attributes. So if I did something ...
4
votes
3answers
294 views

How to inspect group permissions of a file

I would like to inspect group permissions of a file from a bash script. Specifically, I need to check whether a file has the group writeable bit on. That's it. Simple as that. However: I also need ...
4
votes
2answers
889 views

Access history of a file

I was wondering if there are any tools to keep track of the access history of a file. I know of stat, but as far as I understand, it only returns information about the last time the file was accessed. ...
4
votes
1answer
435 views

Efficiency of lots of inotify watches or stat calls

I am developing software that will utilize inotify to track changes on a large amount of files (tens to hundreds of thousands of files). I have come up with these ideas: one watch per file one watch ...
3
votes
3answers
2k views

using stat to provide timestamp for touch

Am trying to OCR some documents insitu (from a linux command line on a windows share). The process of OCRing is find and I have muddled through using the find command to pipe the files through the ...
3
votes
2answers
129 views

Determining if a file system object is a procfs/sysfs/etc. “virtual file” which doesn't report its length correctly

Some kinds of pseudo-files, like many in the procfs and sysfs virtual file systems, have no file size (stat returns st_size == 0) and do not support SEEK_END in fseek. These file system objects, such ...
3
votes
1answer
405 views

Is there a way to view a list of timestamp history of a document/file via terminal/command line?

This seems like it's simple but for some reason, it's not: Problem: I've been writing a paper- not even a script...just an economics paper- over the last 3 months. I'm trying to determine how much ...
3
votes
2answers
293 views

Why do . and .. have a file size of 4 kB and 12 kB, respectively? [duplicate]

As displayed by ls -al, for example: drwxr-xr-x 9 jb jb 4.0K Mar 8 18:05 ./ drwx------ 49 jb jb 12K Mar 17 14:15 ../ I assume this is the minimum amount of space required to store the inode's ...
3
votes
1answer
3k views

Error when using stat, errno=2

The case is as this, I create many files, and after the file generation, I use stat to get the all files info under the directory. The purpose is to purge all the files which are old than the ...
3
votes
1answer
64 views

stat on an encrypted volume in osx takes a long time

My workstation is a MacBook Pro with an SSD. For security reasons, my main volume is encrypted. I ran this command on a folder: time find . -exec stat {} + >/dev/null real 0m5.205s user ...
3
votes
2answers
2k views

file block size - difference between stat and ls

I've noticed that when I do a: ls -ls file It provides block count, say 8 blocks. When I do: stat file I notice that the block count is 16, twice the number given by ls. The block size on my ...
2
votes
2answers
236 views

Has the GNU coreutils stat tool changed?

Has the GNU coreutils (8.6) version of stat changed? After a recent update, some scripts I wrote that call stat are not working as expected; in particular, I had been making use of stat -c %Y ...
2
votes
2answers
93 views

Why load is high despite the fact that neither CPU or disk is overused

I'm getting the following output from top: Cpu(s): 43.8%us, 32.5%sy, 4.8%ni, 2.0%id, 15.6%wa, 0.2%hi, 1.2%si, 0.0%st Mem: 16331504k total, 15759412k used, 572092k free, 4575980k buffers ...
2
votes
3answers
900 views

cp launched from code results in cannot stat '/tmp/somedir' works in shell

I'm working on making some scripts more elegant by implementing them in a real x application etc... At some point in the scripts we basically want to take everything from a mounted removable storage ...
2
votes
2answers
274 views

linux disk caching affects access times reported by stat?

On Ubuntu 12.04 I did the following stat a file cat the same file stat the file again cat the file again after 5 min stat the file The access time reported at 3. reflects the point at which 2. was ...
2
votes
1answer
246 views

Linux - File change time versus modification time

I'm using Ubuntu 12.04, though I'd imagine this question spans all Linux variants. In the manpage for the stat command, there are two (four) formatting options that appear to mean the same thing: ...
2
votes
1answer
400 views

rsync and backup and changing timezone

I back up my pictures from my camera using rsync, using: rsync -vzrtl --progress --stats --timeout=0 host destination Now I was in a different timezone when I did my first backup then I moved to a ...
2
votes
1answer
138 views

Local, regular file causes `stat` or `ls -l` to hang

I've seen a few different questions about ls hanging. It's usually because they use the -l switch, which causes a stat on the file, which in turn is a bad symlink or pointing to an NFS mount or some ...
2
votes
2answers
43 views

Stat command detail information

I am running command stat -c%y filename on linux system. Output: 2014-03-08 13:26:29.335545828 -0800 I am not able to understand the last -0800 thing. Anyone have any idea?
1
vote
2answers
55 views

Find last edited date of file (strange exec behaviour)

I am trying to get the last modified dates of all the word documents in all the directories below this one $ pwd /run/user/1000/gvfs/smb-share:server=myServer,share=myResources If I do a regular ...
1
vote
1answer
424 views

What is “raw mode in hex” from stat output?

When using GNU stat to probe the filesystem, there are a number of format sequences available for the --format/--printf arguments; this one in particular %f Raw mode in hex doesn't make much ...
1
vote
1answer
192 views

Unable to stat symbolic link to file

Background I am trying to wrap my head around how html is unable to access a file via a symlink. I performed the following simple experiment to try and gain an understanding of how apache would be ...
0
votes
2answers
99 views

How can I format the output of stat to contain the null character?

I want to delimit file paths by using the null character (NUL, \0, ...) just like for example find -print0 does. I'm using bash and I tried the following without success: find $1 -print0 > ...
0
votes
1answer
1k views

Installing prstat package command on Ubuntu Linux

I'm trying to run the prstat command on my Ubuntu server, but it doesn't seem to be installed, I have searched the web for the package name needed to install it but without any luck for some reason.. ...
0
votes
0answers
23 views

Shell script time output over java enviroment

I am running a script from java program using sshxcute API. Script contains: #!/bin/sh data=`stat -c%y filename` echo $data Script running on bash gives output: 2014-03-08 13:26:29.335545828 -0800 ...
0
votes
1answer
66 views

How to increase the link count for a directory, link count went to 0?

I have made myself land in this situation, it is a chrooted workspace on my system where I virtualize the entire file system ( so its not actual /var/log ) Is there a way that I can either delete this ...