The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
28 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
50 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
63 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) ...
3
votes
2answers
151 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
231 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
47 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
211 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
109 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
60 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 ...
1
vote
4answers
136 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
143 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
14 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
31 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
69 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
100 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?
4
votes
3answers
1k 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 ...
2
votes
2answers
222 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
44 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
47 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
118 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
80 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
136 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
40 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 ...
1
vote
1answer
382 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
201 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
2k 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
425 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
64 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
119 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
386 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
380 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
91 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
296 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
254 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
1k 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 ...
5
votes
3answers
1k 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 ...
3
votes
1answer
3k 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: ...
36
votes
6answers
57k 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
114 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
281 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
76 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
902 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
585 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
356 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
452 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. Then using the +FORMAT parameter it's easy to get the date in any format, ...
21
votes
3answers
8k 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
502 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 ...
8
votes
1answer
2k 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 ...