Use touch command to set modification time of a file to the Unix epoch





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















Edit: Better worded question: How do I only use the touch command to set the modification time of a file to the unix epoch?



I know that the unix epoch value can be retrieved using "data %s", but how do I use the touch command (and only that command) to set the modification time to the unix epoch?



Edit2:



So, I found that this runs without any errors:



touch -m -d ”@$(date +%s)” fileexample.txt


Is this a correct way of setting the modification time of a file to the Unix epoch?







Original Question (disregard)...:



Using the Linux manual for the “touch” command, show the command that you would 
use to set the modification time of a file to the Unix epoch.


I understand that the Unix epoch is the amount of second (or miliseconds, I forgot) that has passed since the epoch (1970, January, 01)



What does the question mean by saying: setting the time "to the Unix epoch"?



So, Is it basically asking for today's time, or 1970 01 01, or...?



I know the command for this would be:



touch -m -t time file


But what time do I set it to?



Also, am I meant to use the unix epoch format for the time in the command?










share|improve this question

























  • what have you tried?

    – jsotola
    Nov 23 '18 at 9:46











  • @jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

    – Mandingo
    Nov 23 '18 at 9:47













  • ????? I don't understand the question ... is this a school assignment?

    – jsotola
    Nov 23 '18 at 9:51











  • @jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

    – Mandingo
    Nov 23 '18 at 9:54













  • read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

    – jsotola
    Nov 23 '18 at 9:58




















2















Edit: Better worded question: How do I only use the touch command to set the modification time of a file to the unix epoch?



I know that the unix epoch value can be retrieved using "data %s", but how do I use the touch command (and only that command) to set the modification time to the unix epoch?



Edit2:



So, I found that this runs without any errors:



touch -m -d ”@$(date +%s)” fileexample.txt


Is this a correct way of setting the modification time of a file to the Unix epoch?







Original Question (disregard)...:



Using the Linux manual for the “touch” command, show the command that you would 
use to set the modification time of a file to the Unix epoch.


I understand that the Unix epoch is the amount of second (or miliseconds, I forgot) that has passed since the epoch (1970, January, 01)



What does the question mean by saying: setting the time "to the Unix epoch"?



So, Is it basically asking for today's time, or 1970 01 01, or...?



I know the command for this would be:



touch -m -t time file


But what time do I set it to?



Also, am I meant to use the unix epoch format for the time in the command?










share|improve this question

























  • what have you tried?

    – jsotola
    Nov 23 '18 at 9:46











  • @jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

    – Mandingo
    Nov 23 '18 at 9:47













  • ????? I don't understand the question ... is this a school assignment?

    – jsotola
    Nov 23 '18 at 9:51











  • @jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

    – Mandingo
    Nov 23 '18 at 9:54













  • read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

    – jsotola
    Nov 23 '18 at 9:58
















2












2








2








Edit: Better worded question: How do I only use the touch command to set the modification time of a file to the unix epoch?



I know that the unix epoch value can be retrieved using "data %s", but how do I use the touch command (and only that command) to set the modification time to the unix epoch?



Edit2:



So, I found that this runs without any errors:



touch -m -d ”@$(date +%s)” fileexample.txt


Is this a correct way of setting the modification time of a file to the Unix epoch?







Original Question (disregard)...:



Using the Linux manual for the “touch” command, show the command that you would 
use to set the modification time of a file to the Unix epoch.


I understand that the Unix epoch is the amount of second (or miliseconds, I forgot) that has passed since the epoch (1970, January, 01)



What does the question mean by saying: setting the time "to the Unix epoch"?



So, Is it basically asking for today's time, or 1970 01 01, or...?



I know the command for this would be:



touch -m -t time file


But what time do I set it to?



Also, am I meant to use the unix epoch format for the time in the command?










share|improve this question
















Edit: Better worded question: How do I only use the touch command to set the modification time of a file to the unix epoch?



I know that the unix epoch value can be retrieved using "data %s", but how do I use the touch command (and only that command) to set the modification time to the unix epoch?



Edit2:



So, I found that this runs without any errors:



touch -m -d ”@$(date +%s)” fileexample.txt


Is this a correct way of setting the modification time of a file to the Unix epoch?







Original Question (disregard)...:



Using the Linux manual for the “touch” command, show the command that you would 
use to set the modification time of a file to the Unix epoch.


I understand that the Unix epoch is the amount of second (or miliseconds, I forgot) that has passed since the epoch (1970, January, 01)



What does the question mean by saying: setting the time "to the Unix epoch"?



So, Is it basically asking for today's time, or 1970 01 01, or...?



I know the command for this would be:



touch -m -t time file


But what time do I set it to?



Also, am I meant to use the unix epoch format for the time in the command?







linux date touch






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 12:29









Jeff Schaller

44.9k1164146




44.9k1164146










asked Nov 23 '18 at 9:38









MandingoMandingo

1155




1155













  • what have you tried?

    – jsotola
    Nov 23 '18 at 9:46











  • @jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

    – Mandingo
    Nov 23 '18 at 9:47













  • ????? I don't understand the question ... is this a school assignment?

    – jsotola
    Nov 23 '18 at 9:51











  • @jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

    – Mandingo
    Nov 23 '18 at 9:54













  • read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

    – jsotola
    Nov 23 '18 at 9:58





















  • what have you tried?

    – jsotola
    Nov 23 '18 at 9:46











  • @jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

    – Mandingo
    Nov 23 '18 at 9:47













  • ????? I don't understand the question ... is this a school assignment?

    – jsotola
    Nov 23 '18 at 9:51











  • @jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

    – Mandingo
    Nov 23 '18 at 9:54













  • read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

    – jsotola
    Nov 23 '18 at 9:58



















what have you tried?

– jsotola
Nov 23 '18 at 9:46





what have you tried?

– jsotola
Nov 23 '18 at 9:46













@jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

– Mandingo
Nov 23 '18 at 9:47







@jsotola Well, I don't understand the question - or maybe I don't know enough about it. I can set it to the current time or to 1st January 1970 using -t 197001010000, but I don't know what I'm actually meant to do and I'm being very stupid right now.

– Mandingo
Nov 23 '18 at 9:47















????? I don't understand the question ... is this a school assignment?

– jsotola
Nov 23 '18 at 9:51





????? I don't understand the question ... is this a school assignment?

– jsotola
Nov 23 '18 at 9:51













@jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

– Mandingo
Nov 23 '18 at 9:54







@jsotola Not exactly, but it's a question I was set to do in an introductory programme to Linux (There's a bunch of other questions, but I just don't exactly understand or know how to do this one as I'm a beginner in Linux and almost never used it before, and the wording is throwing me off.)

– Mandingo
Nov 23 '18 at 9:54















read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

– jsotola
Nov 23 '18 at 9:58







read your own sentence above, the one starting with I understand ... ....... now think, when is unix epoch zero? ..... when is it 10? .... when is it 20? ......... is this correct ? 1st January 1970 using -t 197001010000

– jsotola
Nov 23 '18 at 9:58












1 Answer
1






active

oldest

votes


















4














-t doesn't accept epoch time, -d does



   -d, --date=STRING
parse STRING and use it instead of current time

-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time


You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:



   EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'


Example:



touch --date=@1442968132 test.txt


If you want to change modify time only, use -m or --time modify or --time mtime, without it both modify and access times are changed.



   -m     change only the modification time

--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m


Examples:



$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -

$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -

$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100





share|improve this answer


























  • Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

    – Mandingo
    Nov 23 '18 at 10:23






  • 1





    yes if you want to change modify time only, without it it will change access time also

    – rAlen
    Nov 23 '18 at 10:25














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483634%2fuse-touch-command-to-set-modification-time-of-a-file-to-the-unix-epoch%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














-t doesn't accept epoch time, -d does



   -d, --date=STRING
parse STRING and use it instead of current time

-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time


You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:



   EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'


Example:



touch --date=@1442968132 test.txt


If you want to change modify time only, use -m or --time modify or --time mtime, without it both modify and access times are changed.



   -m     change only the modification time

--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m


Examples:



$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -

$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -

$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100





share|improve this answer


























  • Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

    – Mandingo
    Nov 23 '18 at 10:23






  • 1





    yes if you want to change modify time only, without it it will change access time also

    – rAlen
    Nov 23 '18 at 10:25


















4














-t doesn't accept epoch time, -d does



   -d, --date=STRING
parse STRING and use it instead of current time

-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time


You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:



   EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'


Example:



touch --date=@1442968132 test.txt


If you want to change modify time only, use -m or --time modify or --time mtime, without it both modify and access times are changed.



   -m     change only the modification time

--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m


Examples:



$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -

$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -

$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100





share|improve this answer


























  • Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

    – Mandingo
    Nov 23 '18 at 10:23






  • 1





    yes if you want to change modify time only, without it it will change access time also

    – rAlen
    Nov 23 '18 at 10:25
















4












4








4







-t doesn't accept epoch time, -d does



   -d, --date=STRING
parse STRING and use it instead of current time

-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time


You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:



   EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'


Example:



touch --date=@1442968132 test.txt


If you want to change modify time only, use -m or --time modify or --time mtime, without it both modify and access times are changed.



   -m     change only the modification time

--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m


Examples:



$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -

$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -

$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100





share|improve this answer















-t doesn't accept epoch time, -d does



   -d, --date=STRING
parse STRING and use it instead of current time

-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time


You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:



   EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date

$ date --date='@2147483647'


Example:



touch --date=@1442968132 test.txt


If you want to change modify time only, use -m or --time modify or --time mtime, without it both modify and access times are changed.



   -m     change only the modification time

--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m


Examples:



$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -

$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -

$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 23 '18 at 10:41

























answered Nov 23 '18 at 10:21









rAlenrAlen

845511




845511













  • Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

    – Mandingo
    Nov 23 '18 at 10:23






  • 1





    yes if you want to change modify time only, without it it will change access time also

    – rAlen
    Nov 23 '18 at 10:25





















  • Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

    – Mandingo
    Nov 23 '18 at 10:23






  • 1





    yes if you want to change modify time only, without it it will change access time also

    – rAlen
    Nov 23 '18 at 10:25



















Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

– Mandingo
Nov 23 '18 at 10:23





Also, is touch -m -d ”@$(date +%s)” test.txt a correct way of doing it?

– Mandingo
Nov 23 '18 at 10:23




1




1





yes if you want to change modify time only, without it it will change access time also

– rAlen
Nov 23 '18 at 10:25







yes if you want to change modify time only, without it it will change access time also

– rAlen
Nov 23 '18 at 10:25




















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483634%2fuse-touch-command-to-set-modification-time-of-a-file-to-the-unix-epoch%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?