Questions tagged [stat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Get all permission octals of files?

'stat -c "%a" foo.bar' shows the three octal permissions of owner, group, and other. How can I show the fourth for setuid, setgid, and sticky bit?
Xavanteex's user avatar
1 vote
1 answer
307 views

How to copy date created to date modified ubuntu 22.04

I am using ubuntu 22.04 LTS and I want to know if the date created on ubuntu can be copied to date modified? I think I've read that the date created on ubuntu isn't actually the date created even ...
ghostanime2001's user avatar
1 vote
1 answer
124 views

why doesnt this bash script get all the files?

I have a large folder with subfolders of pdf files. I want to get all the pdf files (290 of them) and get them into one directory. (I thought that would be simple.) so that I can concatenate them into ...
j0h's user avatar
  • 14.8k
1 vote
2 answers
429 views

Which files formats are considered regular files in Ubuntu?

S_ISREG() is a macro used to interpret the values in a stat-struct. From man page it states : S_ISREG(m) is it a regular file? // Macro checks, if the file is regular or not. Questions : Which ...
Krishna Kanth Yenumula's user avatar
-1 votes
2 answers
1k views

Linux find command - find files based on inode and device?

I want to find the files with a given inode number. Using find with -inum is not entirely helpfull as its listing files with the inode number from every file system/device. How to confine this search ...
samshers's user avatar
  • 258
2 votes
1 answer
1k views

what does a STAT of I mean for ps -aux? "I" does not appear on the man page

ps -aux | grep "I<" root 4 0.0 0.0 0 0 ? I< 16:15 0:00 [kworker/0:0H] root 6 0.0 0.0 0 0 ? I< 16:15 0:00 [mm_percpu_wq] root ...
john hanna's user avatar
-2 votes
1 answer
399 views

How to print last modified time of a file using | in BASH?

I am a novice in BASH coding. Is there any way I can print last modified time of a file (say photos) to a text file named last-modified.txt I tried searching around a bit and could accomplish the ...
badavadapav's user avatar
0 votes
1 answer
810 views

Explain the file permissions, obtained from stat system call, using st_mode

Code: #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char * argv[]) { struct stat st; if(...
Krishna Kanth Yenumula's user avatar
1 vote
1 answer
126 views

stat command format to append '/' to file name if directory, and remove "./" from front

With the following command I have been able to list all the directories relative to the current directory along with the epoch time last modified: find . -exec stat -c '%n: %Y' {} \; the output ...
Mick's user avatar
  • 113
0 votes
0 answers
5k views

ldconfig.real cannot stat an existing directory

I am trying do deploy a application. I created a *.deb package (using fpm) which installs libraries to $HOME/.local/lib/nca and binaries to $HOME/.local/bin. To make my libraries visible I also ...
MarPan's user avatar
  • 11
1 vote
0 answers
85 views

Files, "real" access time when copy from remote host

Question.. Is possible to dig "real" access time of file copied from remote server and using it by including from another script? What I need. I need to know which files on server are unused/...
Stanislav Hosek's user avatar
0 votes
2 answers
1k views

SED or something to delete everything after first space up to `|`

I have a little bash snippet I'm working on: $ stat --printf=%A\|%U\|%G\|%s\|%y\|%N'\n' /usr/src/linux-headers-4.4.0-124/zfs/cmd/zhack drwxr-xr-x|root|root|4096|2018-05-17 05:54:49.361904361 -0600|'/...
WinEunuuchs2Unix's user avatar
0 votes
0 answers
275 views

New STATX: how do I find the creation time (birth time) of a file? [duplicate]

How to use the new statx function to get only one information: the creation time (birth time) of a file. I have tried in terminal command line without success.
cjclm7's user avatar
  • 305
0 votes
0 answers
44 views

Send ubuntu stats on Databox

I would like to send stats about my Ubuntu machine on Databox (uptime, network traffic, free space...) This will allow my colleagues to see the status of the machine. Do you think that would be ...
Lulucmy's user avatar
  • 101
15 votes
2 answers
11k views

When is Birth Date for a file actually used? [duplicate]

When I type the following: $ IFS=$'\n'; arr=( $(stat "/bin/bash") ); for i in ${arr[@]} ; do echo $i ; done File: '/bin/bash' Size: 1037528 Blocks: 2032 IO Block: 4096 regular file ...
WinEunuuchs2Unix's user avatar
2 votes
1 answer
2k views

Getting "unable to stat //bundle (No such file or directory)" even though the file exists

I'm hoping this is just a problem with my not understanding how the $PATH variable works. I'm using Ubuntu 14.04. I'm trying to run rails through a unicorn server. I have the below configuration ...
Dave's user avatar
  • 2,075
0 votes
0 answers
64 views

Why "/proc/pid/stat" have 2 type?

When I run command: cat /proc/$pid/stat, it returns string like this: type 1: 11473 (abc) R 11471 8438 8438 0 -1 4194304 113 0 0 0 0 0 0 0 20 0 1 0 740394567 13586432 387 18446744073709551615 ...
johnU's user avatar
  • 21
2 votes
1 answer
52 views

Nautilus calling stat/file on all directory entries

I am writing a paper and I need to confirm something that is pretty obvious to me but I haven't seen the code that would authoritatively tell me that this is how it works. When I open a folder in ...
ArekBulski's user avatar
  • 1,181
3 votes
1 answer
2k views

Default number of links for directory?

I know that hard link can not point to directories but when i create an empty directory and execute stat command for it links=2 ,I search for symbolic links There is not another link. why for ...
Sinoosh's user avatar
  • 2,031
1 vote
0 answers
69 views

I can copy a file using cp, but trying to use sendfax returns cannot stat file.

As the title says, using Raspberry pi, and Raspbian, I am trying to configure a faxing server that basically reads a file from a CIFS share and sends it using hylafax. If the file is stored locally, ...
rjasmin's user avatar
  • 11
0 votes
2 answers
1k views

Cannot apply 'stat' command for given parameters

I want to make a small shell script that shows all the files in a file tree starting from a given directory that have the given user and size greater than a given size. Hence, my script will take as ...
Vlad Silviu Farcas's user avatar
2 votes
1 answer
352 views

What does mean the second field of sadf`s output?

When you use sadf to make a report from sysstat's datafile, the following lines will be shown: ncm 3 2015-05-11 03:57:15 UTC all %%user 0.08 ncm 3 2015-05-11 03:57:15 UTC all ...
SuB's user avatar
  • 4,199
33 votes
1 answer
15k views

What is the difference between Modify and Change in stat output

What is the difference between Modify and Change in stat output? When I run this command: stat myfile I am getting two lines with identical timestamps: Modify: 2015-03-24 12:34:56.12345678 Change: ...
AlexC's user avatar
  • 433
2 votes
1 answer
3k views

Can a directory's mtime be older than that of file inside?

I have this very silly and very basic question but I thought better to ask before I start pruning my NAS. I want to delete all directories in which all files are older than 30 days. For files I ...
dragosrsupercool's user avatar
12 votes
1 answer
21k views

sudo: unable to stat /etc/sudoers: No such file or directory - File Exists

I am one of a few people managing a gaming server. The Server is currently running Ubuntu 14.04, which was installed just 3 weeks ago. Everything was running fine until a few days ago, we've had a ...
D3_JMultiply's user avatar
87 votes
6 answers
129k views

How do I find the creation time of a file?

I need to find the creation time of a file, when I read some articles about this issue, all mentioned that there is no solution (like Site1, Site2). When I tried the stat command, it states Birth: -...
nux's user avatar
  • 37.9k
3 votes
1 answer
4k views

Sort files in directory by creation date (Birth)

In my Downloads folder I have a lot of files. I need to arrange them according to the following criteria: they shall be arranged by type; files of the same type shall be listed one after the other by ...
Mohammad Reza Rezwani's user avatar