[SOLVED] somebody please help me to understand this question
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Destribution : Rhel 6 Question: create a file /root/filetest1 with month update two months before..
somebody please help me to understand this question
No idea, especially since you don't provide a context, and the question isn't phrased correctly. Is that the EXACT question, and exactly how it's written, because in English, that doesn't make grammatical sense.
If you mean you want the date of a file to be two months in the past, then you need to read the man page on the touch command.
that sounds like you are doing something like a RH033 Basic Essentials Course...
If that's the case have a read in your provided papers but always remember: there is more to read (man pages, books, online stuff...)
thanks , what it does actually ..create a file with a time stamp of 2 months back!!! please give an idea , its not clear from the man page
Well, a time stamp of 2 months back means exactly that: the date that it was two months ago. Just like "three days back" would mean three days ago, etc. Simple.
Quote:
Originally Posted by P.B
[[CC]YY]MMDDhhmm[.ss] --- what is meant by the CC written at first !!
...and a brief search would tell you that the "CC" means the first two digits of a year, which are optional.
Most of your questions seem like verbatim homework assignments, and show very little effort of your own.
Well, a time stamp of 2 months back means exactly that: the date that it was two months ago. Just like "three days back" would mean three days ago, etc. Simple.
...and a brief search would tell you that the "CC" means the first two digits of a year, which are optional.
Most of your questions seem like verbatim homework assignments, and show very little effort of your own.
wow ..what a good guess TBOne ...you are a genius ..and i am an ordinary beginner ..
thanks a ton to all those bothered to answer my question and help me to understand the usage of touch -t.
It was not a guess, and you could easily have found all this out, had you tried to research any of it on your own FIRST.
Sir..I am also learning from all of you how to research and proceed ...one just can not research blindly...that's why people need a mentor ..and in my case this forum , all of you are acting as my guru...i can understand that my questions seems to a guru like you is a very stupid one ... but please understand whenever i am getting stuck , not finding a way out ..i am coming here and people here are so good and helpful ..they are guiding me like a father to a child.. ...In case of this question i got the first clue ...when i got the reply "date --date='-2months' .. it clicked and showed me the way to research further....sorry to disturb you all with my silly questions sir..but i am helpless...assuring you day by day quality of my questions is going to improve...i am confident enough ...all that i need is your support...hope to get it throughout my technical journey with Linux.
It was a stupid question and a stupid answer written by a stupid teacher. If they were trying to teach you how to use the help system then they obviously failed miserably. Someone might want to recover the file as it was before 2 month worth of stupid changes but in the real world you'll probably only use touch to create an empty file.
$ touch stupid.txt
You have to understand that many people just come on here and ask direct questions, without first doing proper research.
The fact that your question is obviously related to some course and appears to be an "end of chapter exercise" is worrying, and "annoying"
Really you need to go back to the beginning and work through the book again.
if you are ever stuck with a command ( even if not, worth a look for the extras )
command --help ( sometimes -h or -help )
man command
info command
websearch : " command tldp " ( other things to include are linux bash shell )
tldp is "The Linux Documentation Project"
When you ask a question, give a little background
show what you have tried, what you expected and how the results are not what you expected.
show sample data that represents any input, and what output you want from that.
and don't get angry because someone got angry because they thought you were being lazy
looking forward to your answer to the question in OP
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.