Questions tagged [stat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
86 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 ...
0
votes
1answer
47 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 ...
-1
votes
2answers
251 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 ...
1
vote
1answer
526 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 ...
-2
votes
1answer
126 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 ...
0
votes
1answer
294 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(...
1
vote
1answer
100 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 ...
0
votes
0answers
3k 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 ...
1
vote
0answers
77 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/...
0
votes
2answers
822 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|'/...
0
votes
0answers
272 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.
0
votes
0answers
33 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 ...
13
votes
2answers
7k 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 ...
2
votes
1answer
1k 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 ...
0
votes
0answers
59 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 ...
2
votes
1answer
43 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 ...
3
votes
1answer
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 ...
1
vote
0answers
62 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, ...
0
votes
2answers
930 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 ...
2
votes
1answer
307 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 ...
28
votes
1answer
12k 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: ...
2
votes
1answer
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 ...
12
votes
1answer
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 ...
82
votes
5answers
108k 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: -...
3
votes
1answer
3k 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 ...