Comando tzselect en Linux: Configurar Zona Horaria Interactivamente
El comando tzselect en Linux puede utilizarse para elegir la zona horaria y mostrar cuál es el valor correcto para la variable TZ.
Su funcionamiento es simple: primero se debe elegir el continente:
# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
1) Africa 7) Europe
2) Americas 8) Indian Ocean
3) Antarctica 9) Pacific Ocean
4) Asia 10) geographical coordinates
5) Atlantic Ocean 11) TZ
6) Australia
Luego se debe elegir el país:
Please select a country whose clocks agree with yours.
1) Anguilla 12) Cayman Islands
2) Antigua 13) Chile
3) Argentina 14) Colombia
4) Aruba 15) Costa Rica
5) Bahamas 16) Cuba
6) Barbados 17) Curaçao
7) Belize 18) Dominica
8) Bolivia 19) Dominican Republic
9) Brazil 20) Ecuador
( ... )
Y por último la zona horaria:
Please select one of the following timezones.1) Atlantic islands 2) Pará (east); Amapá3) Brazil (northeast: MA, PI, CE, RN, PB)4) Pernambuco 5) Tocantins 6) Alagoas, Sergipe 7) Bahia 8) Brazil (southeast)
( ... )
Una vez seleccionada la zona horaria deseada, tzselect pide confirmar la configuración:
The following information has been given: Brazil Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS)Therefore TZ='America/Sao_Paulo' will be used.Selected time is now: Sat Oct 19 11:56:56 -03 2019.Universal Time is now: Sat Oct 19 14:56:56 UTC 2019.Is the above information OK?1) Yes2) No
Y luego crea la línea de comando para la configuración de la variable TZ e indica dónde debe guardarse:
You can make this change permanent for yourself by appending the line TZ='America/Sao_Paulo'; export TZto the file '.profile' in your home directory; then log out and log in again.
Aprende mucho más sobre Linux en nuestro curso en línea. Puedes realizar la inscripción aquí. Si ya tienes una cuenta, o quieres crear una, simplemente ingresa o crea tu usuario aquí.
¿Te gustó? Comparte
Eso fue solo una pieza. El curso enseña el camino completo — desde tu primer comando hasta el día del examen.