{"id":1810,"date":"2014-11-05T22:26:00","date_gmt":"2014-11-06T04:26:00","guid":{"rendered":"http:\/\/linuxitos.com\/main\/cambiar-la-fecha-de-creacion-de-un-archivo-en-linux\/"},"modified":"2014-11-05T22:26:00","modified_gmt":"2014-11-06T04:26:00","slug":"cambiar-la-fecha-de-creacion-de-un-archivo-en-linux","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/cambiar-la-fecha-de-creacion-de-un-archivo-en-linux\/","title":{"rendered":"Cambiar la fecha de creaci\u00f3n de un archivo en linux"},"content":{"rendered":"<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">Si necesitamos cambiar la fecha y hora de creaci\u00f3n de un archivo en Linux, podemos utilizar el comando<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">touch<\/code><\/span><\/div>\n<\/div>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">Vamos a realizar un ejemplo donde cambiaremos la fecha y la hora de un archivo llamado \u201ctest.txt\u201d que crear\u00e1n en el directorio \u201cDescargas\u201d. Si consultamos la fecha del archivo&nbsp; veremos que tiene la fecha del d\u00eda que lo hemos creado:<br \/>Para consultar esta informaci\u00f3n ejecutamos el siguiente comando:<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">ls -lt<\/code><\/span><\/div>\n<\/div>\n<p>Obtendr\u00e1n una salida parecida a la siguiente:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/1.bp.blogspot.com\/-hnSjqmhloaA\/VFrpa2p8j2I\/AAAAAAAAAUo\/9kCKbuUUNBQ\/s1600\/Captura%2Bde%2Bpantalla%2Bde%2B2014-11-05%2B21%3A20%3A49.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/-hnSjqmhloaA\/VFrpa2p8j2I\/AAAAAAAAAUo\/9kCKbuUUNBQ\/s1600\/Captura%2Bde%2Bpantalla%2Bde%2B2014-11-05%2B21%3A20%3A49.png\" height=\"180\" width=\"320\" \/><\/a><\/div>\n<p><\/p>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\"><br \/>Vamos a cambiar la fecha y hora del archivo a las 9.25 del 30 de agosto. Para ello usaremos el comando touch con el par\u00e1metro -t. El formato que usaremos ser\u00e1 de yyyy\/mm\/dd\/hh\/mm (a\u00f1o, mes, d\u00eda, hora y segundos):<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">touch -y yyyymmddhhmm test.txt<\/code><\/span><\/div>\n<\/div>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">El comando para nuestro ejemplo quedar\u00eda as\u00ed:<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">touch -t 201208300925 test.txt<\/code><\/span><\/div>\n<\/div>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">Y una vez ejecutado, nuestro fichero tendr\u00e1 los nuevos valores:<br \/>Podemos comprobarlo usando el siguiente comando:<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">ls -lt<\/code><\/span><\/div>\n<\/div>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">El comando touch admite m\u00e1s par\u00e1metros y permite realizar otras acciones. Si quieres saber m\u00e1s, te recomendamos que consultes el manual en tu consola:<\/span><\/div>\n<div>\n<div style=\"background-color: white; box-sizing: border-box; color: #444444; font-family: Roboto, Verdana, Helvetica, sans-serif; font-size: 15px; line-height: 22.5px; margin-bottom: 25px; margin-top: 25px; padding-left: 60px;\"><span style=\"box-sizing: border-box; font-weight: 700;\"><code style=\"background: url(http:\/\/blog.desdelinux.net\/wp-content\/themes\/DesdeLinuxV5_new\/img\/terminal.png) 50% 0% no-repeat scroll rgb(45, 45, 45); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(0, 0, 0); box-sizing: border-box; color: #828fff; display: block; font-family: 'Roboto Mono', Consolas, monaco, monospace; font-size: 14px; font-weight: normal; margin: 8px 15px; padding: 30px 4px 10px; text-shadow: none; white-space: pre-wrap;\">man touch<\/code><\/span><\/div>\n<\/div>\n<div style=\"text-align: justify;\"><span style=\"font-family: Verdana,sans-serif;\">Y eso es todo amigos, ahora a enga\u00f1ar al profesor, al decirle que la tarea la hicieron un d\u00eda antes&#8230; suerte con eso&#8230;<br \/><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Si necesitamos cambiar la fecha y hora de creaci\u00f3n de un archivo en Linux, podemos utilizar el comando touch Vamos a realizar un ejemplo donde cambiaremos la fecha y la hora de un archivo llamado \u201ctest.txt\u201d que crear\u00e1n en el directorio \u201cDescargas\u201d. Si consultamos la fecha del archivo&nbsp; veremos que tiene la fecha del d\u00eda [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1419,1420,1418,1416,747,1417,1137,4],"tags":[],"class_list":["post-1810","post","type-post","status-publish","format-standard","hentry","category-archivo","category-cambiar","category-cambiar-nombre-de-archivo","category-change-file-name","category-date","category-fecha","category-file","category-linux"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=1810"}],"version-history":[{"count":0,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1810\/revisions"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=1810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=1810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=1810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}