informatica:linux:crlf
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | informatica:linux:crlf [2017/02/10 11:16] (current) – created javi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CRLF ====== | ||
+ | |||
+ | CR LF Retorno de carro EOL end of line | ||
+ | |||
+ | https:// | ||
+ | |||
+ | En DOS el final de linea suele ser un Carriage Return (CR) y un Line Feed (LF), mientras que en Unix es tan solo un Line Feed (LF). | ||
+ | |||
+ | ===== Comprobar si un archivo tiene CRLF ===== | ||
+ | |||
+ | Comando: | ||
+ | |||
+ | file metabox-class.php | grep ASCII | ||
+ | |||
+ | En caso de que **SI** tenga CRLF la salida será: | ||
+ | |||
+ | metabox-class.php: | ||
+ | |||
+ | En caso de que **NO** tenga CRLF la salida será: | ||
+ | |||
+ | metabox-class.php: | ||
+ | |||
+ | ===== Reemplazar CRLF por LF ===== | ||
+ | |||
+ | 1. Instalar paquete: | ||
+ | |||
+ | sudo aptitude install dos2unix | ||
+ | | ||
+ | 2. Ejecutar: | ||
+ | |||
+ | dos2unix metabox-class.php | ||
+ | | ||
+ | 3. Comprobar: | ||
+ | |||
+ | file metabox-class.php | grep ASCII | ||
+ | |||
+ | Salida esperada: | ||
+ | |||
+ | metabox-class.php: | ||
informatica/linux/crlf.txt · Last modified: 2017/02/10 11:16 by javi