07-01-2011
Hmmm. That's weird. It works fine here, pasted keystroke for keystroke, and I've not encountered a version of GNU date before that didn't have it. You definitely have a working -d option, since the epoch time it printed is correct for that date.
What does date --version show you? I've got 8.5.
Maybe it just doesn't have @ for epoch seconds? That can be worked around using the syntax tukuyomi noticed. Does date -d '20110701 - 7 days' work?
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Please tell me how can I wirte a function to return the date 7 days ago by using calendar command? :confused: (2 Replies)
Discussion started by: LAY
2 Replies
2. UNIX for Dummies Questions & Answers
How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago?
It has to be korn shell script.
Thanks. (1 Reply)
Discussion started by: YoungBlood
1 Replies
3. Shell Programming and Scripting
How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago?
It has to be korn shell script.
Thanks. (2 Replies)
Discussion started by: YoungBlood
2 Replies
4. Shell Programming and Scripting
i need a script that can tell me the date 2 days ago or 3 days ago.
please help (7 Replies)
Discussion started by: tomjones
7 Replies
5. Shell Programming and Scripting
Hi,
Anybody knows how to get what date was 28 days ago of the current system date through UNIX script.
Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies
6. Shell Programming and Scripting
How could I using the following example, change it to show 2 days ago within the same time frame 0600 AM to 0600 AM
let foo=`date "+(1%H-106)*60+1%M-100"` bar=foo+1440
find . -mmin +$foo -mmin -$bar | tr -s '/','-' '^' | cut -f2,3 -d"^" | tr -s '^' ' ' |
Please use code tags (7 Replies)
Discussion started by: freddie999
7 Replies
7. UNIX for Dummies Questions & Answers
I know the topic of getting yesterday's date has been covered ad nauseum, but I just want to be clear on something.
I recently started using the command
date --date='1 days ago' '+%m/%d/%y'
to get yesterday's date and it's been working great. I just want to be certain that it is going to... (1 Reply)
Discussion started by: DeCoTwc
1 Replies
8. UNIX for Advanced & Expert Users
Hi,
the following gives today
$(date '+%d%m%y')
For example 210111 for today (21 of january 2011).
How can I have n days ego ? For example 160111 for 5 days ego ?
thank you. (3 Replies)
Discussion started by: big123456
3 Replies
9. UNIX for Beginners Questions & Answers
How to find a file that's modified more than 2 days ago but was modified less than 5 days ago by use of any Linux utility ? (4 Replies)
Discussion started by: abdulbadii
4 Replies
10. Shell Programming and Scripting
Hi all,
I have been researching to obtain SSL certification expiry for most of our webistes. For some cases, some hosts where not directly accessible so i finally got a solution working with curl using my proxy. This lists the expiry date which i'm finally looking for.
# curl --proxy... (4 Replies)
Discussion started by: nms
4 Replies
LEARN ABOUT CENTOS
lchage
lchage(1) General Commands Manual lchage(1)
NAME
lchage - Display or change user password policy
SYNOPSIS
lchage [OPTION]... user
DESCRIPTION
Displays or allows changing password policy of user.
OPTIONS
-d, --date=days
Set the date of last password change to days after Jan 1 1970.
Set days to -1 to disable password expiration (i.e. to ignore --mindays, and --maxdays and related settings).
Set days to 0 to enforce password change on next login. (This also disables password expiration until the password is changed.)
-E, --expire=days
Set the account expiration date to days after Jan 1 1970. Set days to -1 to disable account expiration.
-i, --interactive
Ask all questions when connecting to the user database, even if default answers are set up in libuser configuration.
-I, --inactive=days
Disable the account after days after password expires (after the user is required to change the password). Set days to -1 to keep
the account enabled indefinitely after password expiration.
-l, --list
Only list current user's policy and make no changes.
-m, --mindays=days
Require at least days days between password changes. Set days to 0 or -1 to disable this requirement.
If this value is larger than the value set by --maxdays, the user cannot change the pasword.
-M, --maxdays=days
Require changing the password after days since last password change. Set days to -1 to disable password expiration.
-W, --warndays=days
Start warning the user days before password expires (before the user is required to change the password). Set days to 0 or -1 to
disable the warning.
EXIT STATUS
The exit status is 0 on success, nonzero on error.
NOTES
Note that "account expiration" (set by --expire) is distinct from "password expiration" (set by --maxdays). Account expiration happens on
a fixed date regardless of password changes. Password expiration is relative to the date of last password change.
libuser Nov 8 2012 lchage(1)