The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
60 views

What does 'stat' mean in this sentence?

This sentence is from a Linux command's return,I can only thought it as 'statistics' but it is the noun form rather than the verb form. unable to stat ./config-2.6.32-431.el6.i686: No such file or ...
2
votes
1answer
32 views

Using `stat` to determine filled blocks

How can I find the number of filled block of a certain file, using the stat function? I have already found the command $(stat -c%b "$FILENAME"), which gives the number of allocated blocks but I don't ...
0
votes
1answer
51 views

Stat, Blocks and Sector size - ext4

While reading upon how files are stored in the filesystem, I created a testfile which happened to be of size 217 bytes. Checking the output of stat on this file, I saw that this file is occupying 8 ...
1
vote
1answer
36 views

Allow non-root user go get network traffic statistics

I know that I can use cat /sys/class/net/eth0/statistics/rx_bytes to see the amount of received bytes. Sadly I only can run this command as root. When I am another user, I get cat: ...
0
votes
1answer
405 views

What does `process_usershare_file` do?

I have a samba server that is giving me this in logs for every single share (in this case "Public" is the share): Sep 2 07:49:42 MyServer smbd[31606]: [2014/09/02 07:49:42.398065, 0] ...
1
vote
1answer
112 views

Check the filesystem format with BusyBox (stat -f and df -T do not work)

I am using latest BusyBox v1.22.1 in my target. I want to check the filesystem type using stat -f or df -T but busybox doesn't support such commands. busybox help shows stat command as supported but ...
-1
votes
1answer
34 views

Is %a an option of stat?

Usage: stat [OPTION]... FILE... Display file or file system status. -L, --dereference follow links -f, --file-system display file system status instead of file status -c ...
3
votes
1answer
63 views

Get device with major number 0 (btrfs subvolume)

When I stat a file on a btrfs subvolume I get a major device number of 0. Is there a reliable way to find the mount point of this device, without knowing in advance it is a btrfs subvolume? e.g. I'd ...
0
votes
1answer
108 views

What's the difference between modification date and inode's modification date?

I've just found some interesting information for me in man stat: a, m, c, B The time file was last accessed or modified, of when the inode was last changed, or the birth time of the inode. But ...
1
vote
2answers
149 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 ...
0
votes
0answers
59 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 ...
2
votes
2answers
136 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?
0
votes
2answers
182 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 > ...
1
vote
1answer
625 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 ...
4
votes
3answers
590 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 ...
2
votes
1answer
1k 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: ...
20
votes
6answers
25k 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.
0
votes
1answer
88 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 ...
3
votes
2answers
197 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
71 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 ...
2
votes
1answer
618 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 ...
3
votes
2answers
457 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 ...
2
votes
1answer
227 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 ...
0
votes
1answer
2k 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.. ...
3
votes
2answers
366 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 ...
6
votes
3answers
1k 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, ...
16
votes
2answers
5k 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 ...
4
votes
1answer
418 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 ...
7
votes
1answer
1k 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 ...
2
votes
1answer
607 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 ...
3
votes
3answers
4k 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
1answer
610 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
3k 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
3answers
1k 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 ...
6
votes
2answers
4k 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
2answers
1k 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. ...
8
votes
1answer
11k 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+'?
4
votes
1answer
514 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 ...
8
votes
1answer
2k views

When was `relatime` made the default?

What is the first Linux kernel release to set relatime as the default mount option?
6
votes
2answers
874 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
818 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 ...
2
votes
2answers
244 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 ...
3
votes
1answer
4k 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 ...