[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
Próxima revisiónAmbos lados, revisión siguiente
es:howtos:general_admin:cli_constructs_and_useful_info [2019/02/07 19:41 (UTC)] – [Construye] slackwarespanoles:howtos:general_admin:cli_constructs_and_useful_info [2019/02/07 20:05 (UTC)] – [Sources] slackwarespanol
Línea 151: Línea 151:
 === Enlaces externos === === Enlaces externos ===
   * http://www.grymoire.com/Unix/Quote.html   * http://www.grymoire.com/Unix/Quote.html
-==== Regular expressions ==== +==== Expresiones regulares ==== 
-=== Basic === +=== Básico === 
-  * ''.'' matches any single character+  * ''. '' coincide con cualquier carácter individual
-  * ''\'' escapes the next character+   * '' \ '' evita del siguiente carácter
-<note>Remember to escape the ''.'' using ''\.'' if you want an actual ''.''+<note>Recuerde que debe evitar ''. '' usando '' \. '' Si quieres un verdadero ''. ''
 <code> <code>
 bash-4.2$ cat test.txt  bash-4.2$ cat test.txt 
Línea 167: Línea 167:
 test test
 </code></note> </code></note>
-  * ''[]'' is a class and matches anything inside the brakets for a single characterExamples:  +  
-    * ''[Yy]'' matches or y. +  * '' [ ] '' es una clase y combina cualquier cosa dentro de los corchetes para un solo personajeEjemplos  
-    * ''[a-z0-9]'' includes a rangeand in this case matches through and through 9. +    * '' [Yy] '' coincide con y.  
-    * ''[^a-z]'' negates the rangeso in this case it matches anything but through z. +    * '' [a-z0-9] '' incluye un rangoy en este caso coincide con a través de y de 9.  
-  * ''^'' matches the beginning of a lineExample: ''^a'' matches an at the beginning of a line+    * '' [^ a-z] '' niega el rangopor lo que, en este caso, se ajusta a cualquier cosa excepto a a z.  
-  * ''$'' matches the end of a lineExample: ''a$'' matches an at the end of a line+  * '' ^ '' coincide con el principio de una líneaEjemplo: '' ^ a '' coincide con una al principio de una línea.  
-  * ''\<'' matches the beginning of a wordExample: ''\<a'' matches an at the beginning of a word+  * '' $ '' coincide con el final de una líneaEjemplo: '' a $ '' coincide con una al final de una línea.  
-  * ''\>'' matches the end of a wordExample: ''a\>'' matches an at the end of a word+  * '' \ <'' coincide con el principio de una palabraEjemplo: '' \ <a '' coincide con una al principio de una palabra.  
-    Example: ''\<[tT]he\>'' matches the word ''the'' or ''The''+  * '' \> '' coincide con el final de una palabraEjemplo: '' a \> '' coincide con una al final de una palabra.  
-  * ''*'' matches any number of the previous character or nothing no characterExample: ''[0-9]*'' which will match any number of numbers. ''.*'' matches any number of anything+   Ejemplo: '' \ <[tT] he \> '' coincide con la palabra '' el '' '' El ''   
-=== Extended regular expressions === +  * '' * '' coincide con cualquier número del carácter anterior o nada ningún carácterEjemplo: '' [0-9] * '' que coincidirá con cualquier número de números. ''. * '' coincide con cualquier número de cualquier cosa
-The following must be supported by the program for them to workFor example for grep you must run ''egrep'' or ''grep -E''+=== Expresiones regulares extendidas === 
-  * ''+'' matches any number of the previous characterlike ''*'', but there must be at least one to matchso it will not match nothing or no character+ 
-  * ''?'' makes the previous character optional (it can be missing), and is matched at most once+El programa debe admitir lo siguiente para que funcionenPor ejemplo, para grep debe ejecutar '' egrep '' '' grep -E ''
-  * ''(|)'' acts like an OR statementExample: ''(it|her|this)'' matches any of those words+ 
-  * ''a{3}'' matches ''aaa'' = 3 a's. +   * '' + '' coincide con cualquier número del carácter anteriorcomo '' * '', pero debe haber al menos uno para que coincidapor lo que no coincidirá con nada o ningún carácter
-  * ''a{4,8}'' matches an at least times and at max timesso ''aaaa'', ''aaaaa'', ''aaaaaa'', ''aaaaaaa'', and ''aaaaaaaa''+   * ''? '' hace que el carácter anterior sea opcional (puede faltar), y se compara como máximo una vez
-  * ''{0,}'' = ''*'' +   * '' (|) '' actúa como una declaración OR. Ejemplo: '' (it | her | this) '' coincide con cualquiera de esas palabras
-  * ''{1,}'' = ''+'' +   * '' a {3} '' coincide con '' aaa '' = 3 a's. 
-  * ''{,1}'' = ''?'' +   * '' a {4,8} '' coincide con al menos veces y como máximo vecespor lo que '' aaaa '', '' aaaaa '', '' aaaaaa '', '' aaaaaaa '' '' aaaaaaaa ''
-=== External Links ===+   * '' {0,} '' = '' * '' 
 +   * '' {1,} '' = '' + '' 
 +   * '' {, 1} '' = ''? '' 
 +=== Enlaces externos ===
   * http://www.grymoire.com/Unix/Regular.html   * http://www.grymoire.com/Unix/Regular.html
   * http://www.regular-expressions.info/   * http://www.regular-expressions.info/
-==== Useful commands and info ====+==== Comandos útiles e información ====
 === stat === === stat ===
-Stat is the most accurate way to determine+Stat es la forma más precisa de determinar
-  File size in bytes: <code bash>stat -c '%s' file.txt</code> +   Tamaño del archivo en bytes:<code bash>stat -c '%s' file.txt</code> 
-  File permissions in octal: <code bash>stat -c '%a' file.txt</code> +   Permisos de archivos en octal: <code bash>stat -c '%a' file.txt</code> 
-=== awk variable defaults === +=== awk variable por defecto === 
-An important point is that awk variables are set to zero by defaultThis may cause problems in some situtationsExample:+Un punto importante es que las variables awk se establecen en cero de forma predeterminadaEsto puede causar problemas en algunas situacionesEjemplo:
 <code bash> <code bash>
 echo -ne '-321\n-14\n-1\n-34\n-4\n' | awk 'BEGIN{max=""}{if ($1 > max) max=$1; if ($1 < min) min=$1;}END{print min"\t"max}' echo -ne '-321\n-14\n-1\n-34\n-4\n' | awk 'BEGIN{max=""}{if ($1 > max) max=$1; if ($1 < min) min=$1;}END{print min"\t"max}'
 </code> </code>
-This works properly because max is set to an empty string and thus has a lower value than any numberTry removing the BEGIN clause and see what happensAlso note that adding ''min=""'' to the BEGIN clause fails as well+Esto funciona correctamente porque max se establece en una cadena vacía y, por lo tanto, tiene un valor más bajo que cualquier númeroIntenta eliminar la cláusula BEGIN y ver qué pasaTambién tenga en cuenta que la adición de '' min = "" '' a la cláusula BEGIN también falla. 
-=== no data directory test === + 
-You can use this to test if a directory contains no dataFor exampleit will say ''0'' if the directory only contains empty files and directories no data.+=== no hay prueba de directorio de datos === 
 + 
 +Puede usar esto para probar si un directorio no contiene datosPor ejemplodirá '' 0 '' si el directorio solo contiene archivos vacíos y directorios sin datos.
 <code bash> <code bash>
 du -s directory du -s directory
 </code> </code>
 === cmp === === cmp ===
-This can compare two files byte by byte, and can be more useful than checksumsFor exampleafter you burn a CD/DVD, you can run:+Esto puede comparar dos archivos byte byte, y puede ser más útil que las sumas de comprobaciónPor ejemplodespués de grabar un CD / DVD, puede ejecutar:
 <code bash> <code bash>
 cmp slackware.iso /dev/sr0 cmp slackware.iso /dev/sr0
 </code> </code>
-It should say the following if the disk burned correctly:+Debe decir lo siguiente si el disco se quemó correctamente:
 <code bash> <code bash>
 cmp: EOF on slackware.iso cmp: EOF on slackware.iso
 </code> </code>
-=== shell math === +=== shell matemáticas === 
-Remember that shell utilities like ''let'' and ''expr'' only do integer mathFor floating point use either ''bc'' or ''awk''.+Recuerde que las utilidades de shell como '' let '' '' expr '' solo hacen matemáticas enterasPara el punto flotante, use '' bc '' '' awk ''.
 === shell GUI === === shell GUI ===
-There are numerous programs that allow you to create GUIs from a shell script.+Existen numerosos programas que le permiten crear GUI desde un script de shell.
   * [[http://xdialog.free.fr/|Xdialog is fully dialog compatible.]]   * [[http://xdialog.free.fr/|Xdialog is fully dialog compatible.]]
   * [[https://sites.google.com/site/easybashgui/home|A function library that increases shell GUI portability.]]   * [[https://sites.google.com/site/easybashgui/home|A function library that increases shell GUI portability.]]
   * [[http://code.google.com/p/gtkdialog/|Gtkdialog has advanced features for customized GUIs.]]   * [[http://code.google.com/p/gtkdialog/|Gtkdialog has advanced features for customized GUIs.]]
-=== External Links ===+=== Enlaces externos ===
   * [[http://www.grymoire.com/Unix/|Guide to awk, bash, sed, find, and more]]   * [[http://www.grymoire.com/Unix/|Guide to awk, bash, sed, find, and more]]
   * [[http://www.tldp.org/LDP/abs/html/index.html|Advanced bash guide]]   * [[http://www.tldp.org/LDP/abs/html/index.html|Advanced bash guide]]
Línea 233: Línea 238:
 <!-- * Originally written by [[wiki:user:xxx | User X]] --> <!-- * Originally written by [[wiki:user:xxx | User X]] -->
 <!-- * Contributions by [[wiki:user:yyy | User Y]] --> <!-- * Contributions by [[wiki:user:yyy | User Y]] -->
-  * I quoted ''man comm'' +  * Cit{e''man comm'' 
-  * I used ''man grep'' for the regex section+  * Usé '' man grep '' para la sección de expresiones regulares
-  * Written by [[wiki:user:htexmexh|H_TeXMeX_H]]+  * Escrito por [[wiki:user:htexmexh|H_TeXMeX_H]] 
 +  * Traducido por:  [[wiki:user: slackwarespanol | Victor]]  2019/02/07 20:04 (UTC)
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
 {{tag>howtos software author_htexmexh}} {{tag>howtos software author_htexmexh}}
 es:howtos:general_admin:cli_constructs_and_useful_info ()