The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
0answers
42 views

`stat -f` show a ext4 file system type as ext2/ext3

On Ubuntu 14.04, I am checking the ext4 filesystem for my home based on a file new in it: $ stat -f new File: "new" ID: 38d4cd29e44142c6 Namelen: 255 Type: ext2/ext3 Block size: 4096 ...
1
vote
1answer
43 views

Do both “stat -f” and “cat /etc/fstab” show file system ids?

On Ubuntu 14.04, I am checking the filesystem for my home based on a file new in it: $ stat -f new File: "new" ID: 38d4cd29e44142c6 Namelen: 255 Type: ext2/ext3 Block size: 4096 ...
2
votes
0answers
26 views

Linux file creation time. What are the requirement challenges in considering useful atribute? [closed]

I find many users are acquiescent to the fact that many linux/unix variants do not support/store the file creation time. Yet, I feel it has some relevance in operations and audit & trail. I see ...
2
votes
2answers
63 views

Why `find` likes `stat` or `fstat` so much?

I'm trying to make /usr/bin/find to show something meaningful without doing any sort of stat, with no useful results so far. If I forcefully inhibit stat, find stops descending into subdirectories at ...
1
vote
3answers
57 views

How to list atime for files?

According to this post can stat be used to give the atime on Linux, but FreeBSD 10.1 doesn't have the GNU stat. How do I list the atime for files?
0
votes
0answers
25 views

Why is my stat command output different than examples online? [duplicate]

I've been reading about the stat command, and every example output I see has the file attributes organized by name. But when I run it through bash on my OSX system I get something like this: $ stat ...
1
vote
3answers
223 views

How to identify if a direcory is created by System or a root user?

How to identify if a directory is created by Linux system and by user like root. Example: in /etc there is a directory named sys which is created by Linux. And I logged in using root and created the ...
2
votes
1answer
60 views

What is the meaning of the mode mask names from stat(2) and chmod(2)?

The stat calls have a series of symbolic names for the various bits in the mode field. From the stat(2) manual page: The following mask values are defined for the file mode component of the st_mode ...
-1
votes
1answer
30 views

Stat with Python about line count of 2-bits [closed]

Pseudocode to get amount of lines for 2-bit system (2*30=60): python -c "from math import ceil; print ceil(`stat --printf="%s/30"`/500.0)"; but I would like to really run similar stat command ...
1
vote
2answers
66 views

Stat substitution command to capture numeric file permission in Solaris 10

There is no stat command in Solaris 10. Is there any way to get numeric file permission?
0
votes
1answer
31 views

Can I find the filesystem a file is going to be installed to? [duplicate]

I have a list of files along with their filepaths, that I'm planning to copy into a server. Is there a way, I could figure out before I copy, which filesystem it actually would go into? assuming the ...
1
vote
1answer
321 views

get original creation date of html file

Can I find the creation/last modified date of an html file? For example, I would like to know when some index.html file from some website was created, not when I downloaded it.
5
votes
1answer
110 views

stat file system sizes

With stat 8.13 on a Debian based Linux - among many others - the following FORMAT directives (--format=) are offered: In combination with --file-system (-f): %s Block size (for faster transfers) ...
4
votes
2answers
299 views

change file size format when using stat

The formatting character %s makes stat print the filesize in bytes # stat -c'%A %h %U %G %s %n' /bin/foo -rw-r--r-- 1 root root 45112 /bin/foo ls can be configured to print the byte size number ...
4
votes
5answers
521 views

How to cut a date/timestamp String?

So I am using TIMESTAMP=$( stat -c "%y" $JARNAME.jar ) print $TIMESTAMP and its output is something like 2015-04-24 17:23:03.000000000 -0500 I need only the 2015-04-24 17:23:03 part
0
votes
0answers
158 views

/proc/diskstats and iostat are right? strange values on my test

My question is quite simple.. I am doing some tests to confirm the perfect work of both (diskstats and iostat) disk meters and something is wrong here. I write this command on cmd and I get the ...
3
votes
1answer
288 views

How can I see a file's historical modification times? [duplicate]

stat outputs a file's last modification time. How can I see a list of all the times a file was modified? For example, I'd like to edit a file 5 times, and see 5 modification times.
1
vote
1answer
211 views

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 ...
3
votes
2answers
134 views

get timestamp of files presented by FOR loop

My aim is to find $files on some $devices and save them to one or more folders which are namend corresponding to a timestamp of each file. To get the timestamp I wanted to use stat. In contrast to ...
3
votes
4answers
376 views

get file size and line count at the same time

I'm looking for a way to list all files in a directory, with both their size, and a line count. Right now I'm using stat -c \"%s %n\" /directory/* to get file names and sizes, and I know I can use ...
6
votes
1answer
606 views

stat: print time in “long-iso” format

For my script, I would like to have stat command to print time in a nice, human friendly, way: 2015-02-04 00:48:31. ls calls this format long-iso and it can be used like this: $ ls -lA ...
0
votes
0answers
15 views

Superuser can't `lstat` a directory but ordinary user can, what gives? [duplicate]

This really looks like a bug, and I'd like to dig in and find it, but I'm not sure where to start. First of all, I'm running Linux Mint, with a 3.13.0-24 x86_64 kernel. When I plug my Android tablet ...
1
vote
1answer
46 views

find's - cnewer broken on NTFS-3g?

After extracting an archive to the wrong place, I thought I'd erase everything created after it, but find . -cnewer archive.7z gave the wrong results. So I made a controlled test by touching three ...
2
votes
3answers
112 views

How to determine if a soft link's target is a directory or a file?

Given the ll command outputs as follows #> ll lrwxrwxrwx ... How to determine if a soft link's target is a directory or a file from "lrwxrwxrwx"?
1
vote
1answer
533 views

List files from time X to time Y

How to list out all files created between from 'x' to 'y' time? I want to list out files created between "29-dec-2014 18:00" to "30-dec-2014 18:00". Using ls or stat?
6
votes
3answers
3k views

Determine if a file has been modified

In Linux (currently using ext4 filesystem), how can one check quickly if the contents of a file has been modified without reading any of its contents? Is the stat command a recommended approach? I ...
3
votes
2answers
1k views

Output of stat on OSX

I want to use the stat command to get information on a file. I did this: Josephs-MacBook-Pro:Desktop Joseph$ echo 'hello' > info.txt Josephs-MacBook-Pro:Desktop Joseph$ stat info.txt 16777220 ...
5
votes
2answers
48 views

How to find the number of bytes rewritten to a folder hierarchy?

I want metrics for how much writing and reading have been done to a folder. vmstat -d gives metrics at the whole disk level. iotop will give per process rw stats. But how can I find out how much ...
0
votes
2answers
63 views

How to save stat of all files found in a search?

I had a cron which removes all files with a specific pattern from temp. find /tmp/* -type f -iname magick-* -exec rm {} \; Now, I want to log the stat of all files before deleting them for future ...
1
vote
1answer
213 views

Why ls and stat shows different modified dates? [duplicate]

When I ls a file the last modified date shows as Nov 29 11:13, am but stat shows the file changed at Dec 3rd, why is the date different on ls and stat output. -rw-rr 1 iadm sys 266240 Nov 29 ...
0
votes
1answer
169 views

Cannot stat error?

Running a "restore" script which moves a file previously deleted (moved to a trashbin folder) back to where it came from. Running the secondary script I receive this error... "mv: cannot stat `test': ...
5
votes
1answer
368 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
46 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 ...
2
votes
1answer
805 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
434 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
3k 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
2answers
800 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
109 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
178 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
896 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
633 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
121 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
473 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
350 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
2k 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 ...
6
votes
3answers
2k 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 ...
5
votes
1answer
4k 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: ...
53
votes
7answers
97k 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
140 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
367 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 ...