LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-14-2020, 07:56 AM   #1
marius09
Member
 
Registered: Mar 2019
Posts: 37

Rep: Reputation: Disabled
directory creation


hi,
i like to know why after i login to a new user account the date of user home directory change?

useradd y32
ls -ld /home/y32
drwx------. 2 y32 y32 62 May 14 04:39 /home/y32

ssh y32@192.168.30.105
y32@192.168.30.105's password:
Last login: Thu May 14 04:44:08 2020 from 192.168.30.105
[y32@test5 ~]$ logout
Connection to 192.168.30.105 closed.
ls -ld /home/y32
drwx------. 2 y32 y32 83 May 14 04:44 /home/y32
 
Old 05-14-2020, 08:11 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
.bash_history gets updated? No, crap, must be something else. BTW, on my system geany and gedit-plugin-terminal require VTE which installs /etc/profile.d/vte.sh which, in turn, sets PROMPT_COMMAND thusly:
Code:
$ echo $PROMPT_COMMAND
history -a; history -n; printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"
Quote:
directory creation
The thread name is wrong. What ls -l shows by default is the modification time (mtime). It's the time of the last write.

Use ls -cl to display the status change time (ctime) instead. It changes e.g. when the file gets moved/renamed or its ownership/permissions are changed.

Use stat %w to display the file creation time (birthtime).

From the GNU Coreutils manual:
Quote:
Naively, a file’s atime, mtime, and ctime are set to the current time whenever you read, write, or change the attributes of the file respectively, and searching a directory counts as reading it. A file’s atime and mtime can also be set directly, via the touch command (see touch invocation). In practice, though, timestamps are not updated quite that way.

For efficiency reasons, many systems are lazy about updating atimes: when a program accesses a file, they may delay updating the file’s atime, or may not update the file’s atime if the file has been accessed recently, or may not update the atime at all. Similar laziness, though typically not quite so extreme, applies to mtimes and ctimes.

Last edited by shruggy; 05-14-2020 at 05:17 PM.
 
Old 05-14-2020, 04:23 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
The same happens on my system.
Funny, I never noticed it before.
Currently 'ls -ald ~' shows May 15 00:13 which is definitely hours after I logged in.

I don't see anything problematic with that.

Last edited by ondoho; 05-16-2020 at 02:21 AM. Reason: the added 'd' to ls options makes my meaning clearer
 
Old 05-15-2020, 03:26 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
I guess I got it.
Quote:
Originally Posted by marius09 View Post
after i login to a new user account
Quote:
Originally Posted by shruggy View Post
.bash_history gets updated?
Not updated, but created.
 
Old 05-16-2020, 02:28 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ yeah, I guess it changes every time some file is created or deleted in $HOME:
Code:
$> ls -ald ~
drwx------ 25 ondoho ondoho 4.0K May 16 10:00 /home/ondoho/
$> touch yadda
$> ls -ald ~
drwx------ 25 ondoho ondoho 4.0K May 16 10:22 /home/ondoho/
...wait a few minutes...
$> rm yadda
$> ls -ald ~
drwx------ 25 ondoho ondoho 4.0K May 16 10:24 /home/ondoho/
It does NOT change when you just modify the file:
Code:
$> ls -al yadda
-rw-r--r-- 1 ondoho ondoho 0 May 16 10:25 yadda
$> touch yadda
$> ls -al yadda
-rw-r--r-- 1 ondoho ondoho 0 May 16 10:26 yadda
$> ls -ald ~
drwx------ 25 ondoho ondoho 4.0K May 16 10:25 /home/ondoho/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic User Creation with SSH Key creation kjsubbu Linux - Security 5 07-21-2014 09:15 AM
[SOLVED] Prevent subdirectory creation while allowing file creation bweddell Linux - Security 5 07-31-2011 08:54 PM
System user creation with mysql user creation moos3 Programming 1 08-11-2007 08:01 PM
Azureus directory creation cleff Linux - Software 4 08-21-2004 10:41 PM
makedev - accidental creation of a directory machala Mandriva 3 07-17-2004 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration