08-15-2019
Unsure why access time on a directory isn't changing
Hello... And thanks in advance for any help anyone can offer me
I was trying to work out the differences between displaying modify, access, and change times with the 'ls' command. Everything seems in order when I look at files, but the access time on a directory doesn't seem to change when I expect it too.
I'm sure I must have the concept misunderstood with a directory... But when I 'cd' to a directory like 'Downloads' or do an 'ls' to view it's contents... And then look at it's last access time with 'ls -ldu' or 'stat'... It does not change
It has changed when I wasn't paying attention and has a date/time from yesterday... I just don't understand what would caused it to change
Can someone straighten me out here? THANKS!
Last edited by bodisha; 08-15-2019 at 05:52 PM..
8 More Discussions You Might Find Interesting
1. Solaris
Hi all,
can some one help me in chmod command, and let me know the various combinations for this command.
for : eg chmod -R 777 <dir names>
this gives all rights to all but i want the specific access levels kindly help me out in this issue.
Thank you,
lakshmanan (2 Replies)
Discussion started by: lakshmananl
2 Replies
2. Linux
If i want to display a banner that says Happy Bday, but I want to put that output banner into a file called bday4me,
could I use the command (echo) or (banner -w35) Happy Bday >> bday4me
would this command work? Sorry for asking, but i'm at home just now and don't have access to a UNIX... (3 Replies)
Discussion started by: Cisco
3 Replies
3. Shell Programming and Scripting
Hi all,
Can you tell me how to change the prompt color (only the path part) when I chnange directory with "cd"?
I use the sequence below in ".bashrc" (Solaris 8) to change my prompt colors and I'd like to modify it to change the path color when I cange directory.
PSC() { echo -ne "\"; }... (0 Replies)
Discussion started by: majormark
0 Replies
4. Shell Programming and Scripting
Hi.,
Last modified time of the folder is changing when I view the file inside the directory. Here is the test on sample directory. I believe that ls -l commands gives the time detail w.r.t last modified time. Pl. suggest.
bash-3.2$ mkdir test
bash-3.2$ cd test
bash-3.2$ touch myfile.txt... (2 Replies)
Discussion started by: IND123
2 Replies
5. UNIX for Dummies Questions & Answers
Hey All,
I want to get the access time of files in a directory.
I used ls -lu on a directory and picked a file that had the access time of Mar 1 and used cat to get the contents of the file. Then I used the ls -lu again and the access time changed on that file. Perfect !!
Now if I cat a... (10 Replies)
Discussion started by: vipulgupta0
10 Replies
6. Shell Programming and Scripting
This piece of code is in a shell script I'm trying to modify to run on my system.
sed s:nu\\t.\*:"nu=0"
It's clearly a substitute script which replaces nu\\t.\* with nu = 0.
What exactly does nu\\t.\* demarcate though-- I thought it was just the previous nu = xxxxx (which existed and is... (3 Replies)
Discussion started by: czar21
3 Replies
7. Shell Programming and Scripting
I am trying to do the following task :
export ENV=aaa
export ENV_PATH=$(cd /apps | ls | grep $ENV)
However, it's not working. What's the way to change to directory and search some file in that directory in single command
Please help. (2 Replies)
Discussion started by: saurau
2 Replies
8. Shell Programming and Scripting
When I run the below bash I get the expected output, which is the sum of all matching targets less than 20 in $file1. The filename in the directory is fixed (in bold).
for file1 in /home/cmccabe/Desktop/test/panel/reads/16-0000_EPIL70.txt ; do
bname=`basename $file1`
... (3 Replies)
Discussion started by: cmccabe
3 Replies
STAT(5) File Formats Manual STAT(5)
NAME
stat, wstat - inquire or change file attributes
SYNOPSIS
Tstat tag[2] fid[2]
Rstat tag[2] fid[2] stat[116]
Twstat tag[2] fid[2] stat[116]
Rwstat tag[2] fid[2]
DESCRIPTION
The stat transaction inquires about the file identified by fid. The reply will contain a 116-byte (DIRLEN in <libc.h>) machine-independent
directory entry laid out as follows:
name[28] file name; must be / if the file is the root directory of the server
uid[28] owner name
gid[28] group name
qid.path[4] the file server's identification for the file
qid.vers[4] version number for given path
mode[4] permissions and flags
atime[4] last access time
mtime[4] last modification time
length[8] length of file in bytes
type[2] for kernel use
dev[2] for kernel use
Integers in this encoding are in little-endian order (least significant byte first). The convM2D and convD2M routines (see fcall(2)) con-
vert between directory entries and C structs.
This encoding may be turned into a machine dependent Dir structure (see stat(2)) using routines defined in fcall(2).
The mode contains permission bits as described in intro(5) and the following: 0x80000000 (this file is a directory), 0x40000000 (append
only), 0x20000000 (exclusive use). Writes to append-only files always place their data at the end of the file; the offset in the read or
write message is ignored, as is the OTRUNC bit in an open. Exclusive use files may be open for I/O by only one fid at a time across all
clients of the server. If a second open is attempted, it draws an error. Servers may implement a timeout on the lock on an exclusive use
file: if the fid holding the file open has been unused for an extended period (of order at least minutes), it is reasonable to break the
lock and deny the initial fid further I/O.
The two time fields are measured in seconds since the epoch (Jan 1 00:00 1970 GMT). The mtime field reflects the time of the last change
of content. For a plain file, mtime is the time of the most recent create, open with truncation, or write; for a directory it is the time
of the most recent remove, create, or wstat of a file in the directory. Similarly, the atime field records the last read of the contents;
also it is set whenever mtime is set. In addition, for a directory, it is set by an attach, walk, or create, all whether successful or
not.
The length records the number of bytes in the file. Directories and most files representing devices have a conventional length of 0.
The stat request requires no special permissions.
The wstat request can change some of the file status information. The name can be changed by anyone with write permission in the parent
directory; it is an error to change the name to that of an existing file. The mode and mtime can be changed by the owner of the file or
the group leader of the file's current group. The directory bit cannot be changed by a wstat; the other defined permission and mode bits
can. The gid can be changed: by the owner if also a member of the new group; or by the group leader of the file's current group if also
leader of the new group (see intro(5) for more information about permissions and users(6) for users and groups). None of the other data
can be altered by a wstat. In particular, there is no way to change the owner of a file.
A read of a directory yields an integral number of directory entries in the machine independent encoding given above (see read(5)).
ENTRY POINTS
Stat messages are generated by fstat and stat.
Wstat messages are generated by fwstat and wstat.
STAT(5)