The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
3answers
63 views

How to delete that directory?

I have a directory, that I cannot delete with rmdir. I get always a permission denied error. But when list the directory (with ls -l) I get this: drwxrwxrwx 2 user user 4096 Aug 28 09:34 directory ...
1
vote
3answers
198 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
30 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
26 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
44 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
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
120 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
75 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
191 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
301 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
96 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
230 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
130 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
84 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 ...
2
votes
4answers
193 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
242 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
37 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
85 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
161 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
2k 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
364 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
47 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
48 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
145 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
98 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
191 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
482 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
268 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
504 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
82 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
132 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
509 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
434 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
99 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
324 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
283 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 ...
5
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: ...
40
votes
6answers
68k 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
119 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
307 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
77 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
960 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
645 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
388 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.. ...