Difference between revisions of "Linux"

From Sinfronteras
Jump to: navigation, search
(Permisologia de archivos y directorios)
Line 1: Line 1:
 
__NUMBEREDHEADINGS__
 
__NUMBEREDHEADINGS__
 
<div class="noFloat">__TOC__</div>
 
<div class="noFloat">__TOC__</div>
==Mount discs==
 
Montar discos o particiones
 
  
<syntaxhighlight lang="bash">
+
==Instalación de Ubuntu==
sudo mount /dev/sda3 /home/adelo/1-system/4-windows/
 
sudo umount /dev/sda3
 
</syntaxhighlight>
 
  
===Montar discos permanentemente===
+
===Creating a bootable USB flash drive===
http://doc.ubuntu-fr.org/mount_fstab
 
  
Para montar permanentemente mi disco_local y mi disco_ext, tuve que agregar las siguientes líneas en el archivo /etc/fstab
+
====Creating a bootable Ubuntu USB flash drive from Ubuntu a través de usb-creator====
 +
<span style="color:#FFFFFF; background:#483D8B">
 +
'''Me ha generado muchos problemas últimamente. Recomiendo usar el método por terminal a través del comando dd; método que además parece funcionar en otras distribuciones.'''
 +
</span>
  
<syntaxhighlight lang="bash">
+
https://help.ubuntu.com/community/Installation/FromUSBStick
# Disco_local:
 
UUID=0B8D61386C315368 /home/adelo/1-system/1-disco_local ntfs auto,users,exec,permissions 0 0
 
  
# Disco externo - TOSHIBA EXT:
+
Startup Disk Creator alias usb-creator viene instalado por defecto. Para iniciarlo desde el terminal:
UUID=3C9A5D379A5CEF40 /home/adelo/1-system/2-disco_ext ntfs auto,nofail,users,permissions 0 0
+
usb-creator-gtk
</syntaxhighlight>
+
usb-creator-kde
  
===Mount a remote filesystem in your local machine===
+
Luego:
https://stackoverflow.com/questions/32747819/remote-java-development-using-intellij-or-eclipse
+
# Insert and mount the USB drive.
 +
# Start usb-creator.
  
https://serverfault.com/questions/306796/sshfs-problem-when-losing-connection
+
El sistema de archivos del USB drive debe ser FAT o creo que también EXT. No puede ser ntfs. Si el pendrive está en ntfs u otro filesystem inadecuado, el programa usb-creator dirá que no hay suficiente espacio en el dispositivo. Podemos en este caso utilizar la opción «Erase Disk» que formatea el dispositivo en FAT32. Luego de esto el dispositivo debería de estar disponible y habilitada la opción «Make Startup Disk» que permite iniciar la creación del bootable USB. También podemos formatear el dispositivo en FAT32 antes de iniciar el programa usb-creator. [[Linux#Formatear una unidad Flash USB|Formatear una unidad Flash USB]]
 +
 
 +
Cuando intenté crear el USB bootable en Ubuntu 14.04, el programa daba un error al final del proceso. Decía que no podía instalar el arranque. Luego intenté hacerlo en una versión antigua de Ubuntu que tenía instalada y el programa usb-creator ejecutaba el proceso de creación con éxito; sin embargo cuando intentaba bootear desde el dispositivo USB creado, se detenía el arranque y se mostraba un mensaje que decía:
  
https://askubuntu.com/questions/358906/sshfs-messes-up-everything-if-i-lose-connection
+
Missing parameter in configuration file.
  
https://askubuntu.com/questions/716612/sshfs-auto-reconnect
+
Luego encontré en un forum que dicho problema se solucionaba haciendo Tab, escribiendo live y Enter. Esto funcionó perfectamente y Ubuntu inició normalmente desde la memoria USB. http://askubuntu.com/questions/544414/missing-parameter-in-configuration-file-keyword-path
  
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
+
Al parecer también se puede crear a bootable Ubuntu USB flash drive usando: UnetBootin, LiliUSB or Universal USB Installer
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 visitor@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
+
https://help.ubuntu.com/community/Boot-Repair
  
sshfs -o allow_other root@sinfronteras.ws: /home/adelo/1-system/3-cloud
+
En la siguiente página se explica como podemos crear el bootable Ubuntu USB flash drive desde la línea de comandos. Sin embargo, no pude crearlo con éxito. Cuando arranqué desde el disco USB que creé, el SO no cargó correctamente.
 +
Cuando intenté crear el bootable USB encontré el siguiente error:
  
 +
cp: no se puede crear el enlace simbólico «/media/adelo/D853-0856/./dists/stable»: Operación no permitida
  
https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs
+
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
  
==Free Up Space On Ubuntu==
+
====Creating a bootable CentOS-Ubuntu USB flash drive desde el terminal a través de dd====
Liberar espacio
 
  
===Clean up APT cache in Ubuntu===
+
Creo que la forma de crearlo para/en  Ubuntu o CentOS es la misma. Sin embargo aquí hay dos forums:
You can see the size of this cache with the command below:
 
sudo du -sh /var/cache/apt
 
  
Now, you have two options to handle the cache. Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary.
+
'''Estos son para CentOS:'''
sudo apt-get autoclean
 
  
Or clean out the cache in its entirety (frees more disk space):
+
Starting with CentOS 6.5, one can install from USB keys by simply transferring the desired ISO using dd https://wiki.centos.org/HowTos/InstallFromUSBkey
sudo apt-get clean
 
  
===Clean the thumbnail cache===
+
https://wiki.centos.org/HowTos/InstallFromUSBkey
du -sh ~/.cache/thumbnails
 
rm -rf ~/.cache/thumbnails/*
 
  
===Empty the Trash===
+
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
Vaciar papeleras
 
  
Los directorios Trash* pueden ser borrados sin ningún problemas puesto que se crean automáticamente.
+
https://www.centos.org/forums/viewtopic.php?t=56578
  
* '''Papeleras en la partición donde se encuentra instalado Ubuntu:'''
+
'''En este se trata el caso de Linux en general:'''
<blockquote>
 
  
<syntaxhighlight lang="bash">
+
http://superuser.com/questions/591234/how-to-create-a-bootable-usb-from-a-bootable-iso-with-the-command-line-on-linux
  
/home/adelo/.local/share/Trash  (Estas rutas creo que deber ser comprobada como usuario y como '''root'''. Ver nota abajo)
 
/home/adelo/.Trash-*
 
/root/.local/share/Trash
 
link del ícono de la papelera
 
  
</syntaxhighlight>
+
Como se puede ver, parece ser el mismo procedimiento. Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15 desde Ubuntu 15, otro de CentOS 7 desde Ubuntu 15, y ambos funcionaron correctamente.
  
'''Nota:''' Por alguna razón que aún desconozco, al comparar los archivos en las dos rutas mostradas arriba con los archivos que se encueentran en la papelera al abrila a través del link del ícono de la papelera, se encuentran discrepancias. Es decir, hay archivos que se observan a través del link de la papelera que no se encuentran en las dos rutas mostradas arriba y viceversa. Por esta razón, debo también vaciar la papelera a través del link de la papelera.
+
* Antes de crear el bootable drive es apropiado [[Linux#Formatear una unidad Flash USB|formatear]] el dispositivo en Fat32 (vFat).
  
</blockquote>
+
* Debemos desmontar el dispositivos antes de ejecutar el comando dd:
  
* '''Papeleras en disco_local''' (comprobar como usuario y como '''root'''):
+
umount /dev/sdb*
<blockquote>
 
<syntaxhighlight lang="bash">
 
  
/home/adelo/1-system/1-disco_local/.Trash-0
+
* Creación del bootable USB flash a través de dd:
/home/adelo/1-system/1-disco_local/.Trash-1000
 
  
</syntaxhighlight>
+
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
</blockquote>
 
  
* '''Papeleras en disco_ext''' (comprobar como usuario y como '''root'''):
+
<div id="Nota_sdb">Nota_sdb</div>Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb  drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.
<blockquote>
 
<syntaxhighlight lang="bash">
 
  
/home/adelo/1-system/2-disco_ext/.Trash-0
+
Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:
/home/adelo/1-system/2-disco_ext/.Trash-1000
 
  
</syntaxhighlight>
+
sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
</blockquote>
+
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
 +
└─sdb2 vfat    ANACONDA        C522-73DA
  
* '''Papeleras en el cloud''':
+
====How can I create a Windows bootable USB stick with Ubuntu:====
<blockquote>
+
=====winusb=====
<syntaxhighlight lang="bash">
+
http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
  
/root/.local/share/Trash
+
http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu
/root/.Trash-*
 
  
</syntaxhighlight>
+
Esto lo había realizado con éxito a través del comando '''winusb''' en Ubuntu 14; instalándolo a partir de los repositorios:
</blockquote>
+
sudo add-apt-repository ppa:colingille/freshlight
 +
sudo apt-get update
 +
sudo apt-get install winusb
  
==Filesystem Hierarchy Standard==
+
Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
+
 
 +
En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
  
{| class="wikitable" summary="A description of the hierarchy specified in the FHS."
+
'''Install WinUSB in Ubuntu 16.04'''
|-
 
!Directory
 
!Description
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/}}'''</span>
 
|Primary hierarchy root and root directory of the entire file system hierarchy.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/bin}}'''</span>
 
|Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/boot}}'''</span>
 
|Boot loader files, e.g., kernels, initrd.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/dev}}'''</span>
 
|Essential device files, e.g., /dev/null.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/etc}}'''</span>
 
<!-- Please see the talk page before changing this -->
 
|Host-specific system-wide configuration files
 
  
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".
+
Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.
|-
+
 
|
+
Before you begin to install WinUSB, run the command given below to install the dependencies:
:<span style="color:#FFF; background:#FF0000">'''{{big|/home}}'''</span>
+
 
|Users' home directories, containing saved files, personal settings, etc.
+
sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev
|-
+
 
|
+
Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:
:<span style="color:#FFF; background:#FF0000">'''{{big|/lib}}'''</span>
+
 
|Libraries essential for the binaries in /bin/ and /sbin/.
+
wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
|-
+
tar zxf winusb-1.0.11.tar.gz
|
+
cd winusb*/src
:<span style="color:#FFF; background:#FF0000">'''{{big|/media}}'''</span>
+
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
|Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
+
sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp
|-
+
 
|
+
Now it’s time to compile winusb-1.0.11 bu running the commands given below:
:<span style="color:#FFF; background:#FF0000">'''{{big|/mnt}}'''</span>
+
 
|Temporarily mounted filesystems.
+
cd ..
|-
+
./configure
|
+
make
:<span style="color:#FFF; background:#FF0000">'''{{big|/opt}}'''</span>
+
sudo make install
|Optional application software packages.
+
cd ..
|-
+
rm -rf winusb-1.0.11
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/proc}}'''</span>
+
'''Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).'''
|Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
+
 
|-
+
'''Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.'''
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/root}}'''</span>
+
Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.
|Home directory for the root user.
+
 
|-
+
=====A través de dd=====
|
+
Lo intenté hacer desde la línea de comando a través del comando ''dd'' y no resultó.
:<span style="color:#FFF; background:#FF0000">'''{{big|/run}}'''</span>
+
 
|Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
+
=====unetbootin=====
|-
+
También utilicé otro programa creado para este fin: '''unetbootin''', y no pude crearlo correctamente.
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/sbin}}'''</span>
 
|Essential system binaries, e.g., fsck, init, route.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/srv}}'''</span>
 
|Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/sys}}'''</span>
 
|Contains information about the devices connected to the computer.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/tmp}}'''</span>
 
|Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/usr}}'''</span>
 
|Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/var}}'''</span>
 
|Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
 
|-
 
|}
 
  
==Fonctionnalités notoires du shell==
+
https://www.youtube.com/watch?v=uivN0yLxir8
  
===Historique===
+
http://askubuntu.com/questions/707159/how-can-i-create-a-windows-10-boot-usb-from-ubuntu
* '''Flecha hacia arriba:''' remonter,
 
  
*'''Flecha hacia abajo:''' redescendre dans l’historique;
+
===Proceso de instalación===
 +
En el proceso de instalación de Ubuntu 15.10 se propone de una vez la instalación de "Third-party sortwares" (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.
  
*'''Ctrl + R <chaine>:''' Chercher une commande dans l’historique contenant <chaine> ;
+
====Creación y elección de la partición donde será instalado el SO====
** '''A nouveau Ctrl + R:''' cherche la commande précédente ;
+
Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
  
'''Ctrl + G:''' interrompt la recherche.
+
La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.
  
==Cursos de Linux online==
+
Los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas. https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco
  
https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server
+
Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa [[Linux#GParted|GParted]]
  
Red Hat Enterprise Linux 7 System Administrator's Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/System_Administrators_Guide/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf
+
Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.
  
http://www.learnlinux.org.za
+
GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.
  
The Linux System Administrator's Guide:
+
Para instalar Linux tenemos que crear por lo menos dos particiones '''(Indispensables)''':
http://www.tldp.org/LDP/sag/html/index.html
 
  
13 Linux Network Configuration and Troubleshooting Commands:
+
'''La partición Swap :''' Puede ser Primaria o Lógica -- [[Linux#Donde colocar la partición Swap|Se puede crear en cualquier posición]] -- Filesystem: Swap -- [[Linux#Que tamaño debe tener la partición swap|Tamaño]] -- [[Linux#Utilidad|Utilidad]].
http://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/
 
  
Linux Internet Web Server and Domain Configuration Tutorial: http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html
+
'''La particion root / :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go.  
  
https://en.wikiversity.org/wiki/Linux_server_administration#A_curriculum_for_the_first_6_months_of_using_Linux
 
  
http://brajeshwar.com/2008/top-free-linux-online-courses/
+
En muchos forums se propone también la creación de las siguientes particiones '''(Opcionales)''':
  
https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0
+
'''/boot :''' [[Linux#Utilidad de la partición boot|Ésta podría ser indispensable]] -- Creo que debe ser primaria -- [[Linux#Utilidad de la partición boot|Se debe crear al inicio del disco]] -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- [[Linux#Utilidad de la partición boot|Utilidad]] -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
http://study.com/articles/10_Sites_Offering_Free_Linux_Courses_Online.html
+
'''/home :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- [[Linux#Utilidad de la partición home|Utilidad]] -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 +
 +
También he visto que podría ser ventajoso crear particiones para:
 +
/tmp
 +
/var
 +
/usr
 +
 +
Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.
  
==Red Hat==
+
En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales
He creado una cuenta for the Red Hat Developer Program (email y clave habitual), lo cual me permite descargar una versión gratis de Red Hat:
+
https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
http://developers.redhat.com/
+
====La partición swap====
 +
What is swap?
  
http://developers.redhat.com/products/rhel/download/
+
Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq
  
http://developers.redhat.com/products/rhel/get-started/
+
=====Utilidad=====
 +
Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
%%%%%%%%
+
=====Que tamaño debe tener la partición swap=====
 +
How much swap do I need?
  
Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:
+
For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM
  
Hi Adelo,
+
For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq
  
I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:
 
  
* Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found [http://developers.redhat.com/products here].
+
'''I have 16GB RAM. Do I need 32GB swap?'''
* Highlighted and new content: For ease we will have that on our [http://developers.redhat.com homepage] and will be adding material multiple times a week.
 
* You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found [http://developers.redhat.com/community/contributor/ here]. And did I mention contributing gets you swag?
 
  
Again, welcome to Red Hat Developers.
+
It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap
  
Andréa
+
Here's a very good recommendation from RedHat:
  
%%%%%%%%
+
In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following table.  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007
  
Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat https://access.redhat.com/products/red-hat-enterprise-linux/evaluation
+
  Amount of RAM in the system  Recommended swap space        Recommended swap space
 +
                                                              if allowing for hibernation
 +
---------------------------  ----------------------------  ---------------------------
 +
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
 +
2GB to 8GB of RAM            Equal to the amount of RAM    2 times the amount of RAM
 +
8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
 +
64GB of RAM or more          4GB of swap space              No extra space needed
  
Para crear el bootable usb: https://access.redhat.com/articles/142303
+
=====Donde colocar la partición Swap=====
 +
Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final.
 +
It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).
  
===All certifications and exams===
+
====Utilidad de la partición boot====
https://www.redhat.com/en/services/all-certifications-exams
+
Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des [http://forum.ubuntu-fr.org/viewtopic.php?pid=13576521#p13576521 problèmes], aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification
+
====Utilidad de la partición home====
 +
Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter [https://doc.ubuntu-fr.org/tutoriel/deplacer_home#public ce comparatif] pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
====Red Hat Certified System Administrator (RHCSA) exam====
+
Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.
https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam
 
  
===All training courses and exams===
+
http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/
https://www.redhat.com/en/services/training/all-courses-exams
 
  
====Red Hat System Administration I====
+
====Partición para los datos====
https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i
+
Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.
  
====Red Hat System Administration II with RHCSA exam====
+
Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.
https://www.redhat.com/en/services/training/rh135-red-hat-system-administration-ii-rhcsa-exam
 
  
====Combines Red Hat System Administration I and II at a rapid pace====
+
====Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?====
https://www.redhat.com/en/services/training/rh200-rhcsa-rapid-track-course-rhcsa-exam
 
  
===Documentación gratis===
+
=====chmod y chown en particiones ntfs=====
Creo que esta guía para RedHad está bastante buena:
+
Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/
 
  
En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more:
+
* https://forum.ubuntu-fr.org/viewtopic.php?id=370751
https://www.certdepot.net/
+
: Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
  
===Instalación===
+
* http://ubuntuforums.org/showthread.php?t=1446788
Short guide: https://developers.redhat.com/products/rhel/hello-world/
 
  
Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html
 
  
====System Requirements====
+
Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.
  
The requirements for your physical system are:
+
En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:
 +
* http://askubuntu.com/questions/342791/file-permissions-wont-change/343154#343154
 +
* http://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/91054#91054
  
a 64-bit x86 machine.
+
Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:
  
4 GB of RAM
+
Para particiones internas:
 +
<pre>
 +
# <file system>          <mount point>                <type>    <options>                          <dump>  <pass>
 +
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions        0      0
 +
</pre>
  
20 GB of available disk space.
+
=====Can't be put in the trash. Do you want to delete it immediately?=====
 +
Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error. Cuando quería borrar un archivo desde directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus), el archivo no podíaser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba.
  
For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html
+
El problema que estoy teniendo es exáctamente el descrito en este Forum:
  
 +
Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder
  
====Software selection====
+
http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti
  
The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.
+
Since a few days, I cannot send files to trash anymore from some folders.
  
Click Software selection.
+
That worked perfectly for years :(
  
On the next screen, under Software selection, in the Base environment list on the left, select '''Server with GUI'''.
+
In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:
  
In the list Add-ons for selected environment on the right, select Development tools.
+
Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/
  
 +
Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.
  
====Installation destination====
 
to specify which disk or partition(s) to use for Red Hat Enterprise Linux. Note: It is important that you understand the choices that you are making in this section to avoid accidental data loss. It is strongly recommended that you read the Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html
 
  
  
=====Particionamiento=====
+
Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~
Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos seleccionar la opción "I will configure particioning". Lo cual nos llevará a la ventana "Manual Particioning"
 
  
El programa de instalación de Red Hat permite intalar el SO una partición previamente creada o crear una nueva partición a partir de espacio libre en el disco.
+
https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781
  
Para crear una nueva partición debemos especificar el tipo de partición en "New mount points will use the following partitioning scheme":
+
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112
* LVM (Logical Volume Manager).
 
* ,
 
y luego hacer clic en + para crear la partición.
 
  
Sin embargo, el programa de particionamiento no es muy amigable, y no permite especificar la posición de la partición y creo que tampoco permite general un esquema complejo de particiones. Por ejemplo, crear una partición extendida y dentro un conjunto de particiones lógicas en las posiciones deseadas.
+
=====Para discos externos=====
 +
http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
  
Por tanto, me parece mucho más apropiado crear las particiones (con Gparted) antes de iniciar la instalación de Red Had.
+
https://wiki.archlinux.org/index.php/Fstab#External_devices
  
==Grub2==
+
En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), si no se usa <nofail>, el sistema buscará la partición, al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.
The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.  
 
  
En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0
+
The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
  
===Installing - Reinstalling Grub2===
+
En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.
https://help.ubuntu.com/community/Grub2/Installing
 
  
====Reinstalling GRUB 2 from a Working System====
+
<pre>
 +
UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext      ntfs      auto,nofail,users,exec,permissions 0      0
 +
</pre>
  
If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal.
+
Para saber el '''UUID''' de la partición: sudo blkid
  
X is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.
+
'''auto:''' will automatically mount the partition when you boot.
  
sudo grub-install /dev/sdX  # Example: sudo grub-install /dev/sda
+
'''users:''' allows users to mount and umount.
  
This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running
+
'''exec:''' permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition
  
sudo update-grub after the install will ensure GRUB 2's menu is up-to-date.  
+
'''nofail:''' external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices
  
====If a system has become unbootable====
+
'''permissions:''' es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.
There are various methods for reinstalling GRUB 2. The simplest is listed first, followed by more complicated methods.
 
  
=====Via Boot-Repair Graphical Tool=====
+
'''dump''' est utilisé pour les sauvegardes. (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
https://help.ubuntu.com/community/Boot-Repair
 
  
=====Via GRUB2 Rescue mode=====
+
'''pass''' pour l'ordre de vérification au démarrage: (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot.
+
* 1 pour la racine
https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode
+
* 2 pour les autres partitions Linux
 +
* 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).
  
=====Via the LiveCD terminal=====
+
Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
Este método se encuentra explicado aquí: https://help.ubuntu.com/community/Grub2/Installing
 
  
y aquí: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
+
No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.
  
Creo que en el segundo link se encuentra una mejor explicación, la cual resumo a continuación:
+
Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:
  
======How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB======
+
chown -R adelo:adelo /home/adelo/1-mis_archivos
Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.
 
  
Warning
+
Para modificar los permisos de todos los archivos en la partición ver [[Linux#A través del comando find|aquí]]
Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.
 
  
Terminal Commands
 
  
Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.
+
En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:
 +
* http://www.lunaticgeek.com/2011/08/como-conseguir-permisos-en-particiones.html
  
sudo mount /dev/sdXY /mnt
+
====Esquemas de particionamiento====
 +
Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.
  
Now bind the directories that grub needs access to to detect other operating systems, like so.
+
Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
  
sudo mount --bind /dev /mnt/dev &&
+
'''En mi disco de 300G'''
sudo mount --bind /dev/pts /mnt/dev/pts &&
 
sudo mount --bind /proc /mnt/proc &&
 
sudo mount --bind /sys /mnt/sys
 
  
Now we jump into that using chroot.
+
'''Opción 1:'''
 +
* Partición extendida de 200G al inicio del disco
 +
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
 +
** Particion Lógica ext4 de 196G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 +
* Partición Primaria de 100G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
  
sudo chroot /mnt
+
De Manera que me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.
  
  
Now install, check, and update grub.
+
'''Opción 2:'''
 +
* Partición extendida de 60G al inicio del disco
 +
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
 +
** Particion Lógica ext4 de 56G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 +
* Partición Primaria ntfs de 200G al inicio del espacio restante. Esta será la partición de almacenamiento de todos mis archivos.
 +
* Partición Primaria de 40G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
  
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.
+
En este esquema de particiones, todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados. Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos. Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.
  
grub-install /dev/sdX
+
<span style="color:#FFFFFF; background:#483D8B">
 +
'''Nota: Me parece que la próxima vez debería dejar más espacio a la partición de Linux, porque en la distribución que voy a usar día a día debe estar en una partición de al menos 30G; por tanto, no me quedaría mucho espacio para instalar todas las distribuciones de Linux que necesito probar: Debian, RedHad, Centos, etc. Creo que cada distribución de prueba debe estar en una partición de al menos 10G.'''
 +
</span>
  
  grub-install --recheck /dev/sdX
+
==Mis configuraciones==
 +
===Directorios===
 +
He creado el directorio:
 +
  '''~/1-disco_local/.1-conf''' : donde pienso guardar todos mis archivos relacionados con configuraciones o archivos ocultos.
  
  update-grub
+
He creado los directorios:
 +
  '''~/1-disco_local/.archivos_programas''' : donde pienso guardar algunos archivos de programas. Más que todo archivos que quiera guardar aún después de la desinstalación de un programa. Ej: eclipse-workspace.
 +
'''~/1-disco_local/.archivos_programas/windows''' :
  
Now grub is back, all that is left is to exit the chrooted system and unmount everything.
+
'''~/.archivos_programas-ubuntu''' : donde pienso guardar los archivos de programas que demandan la creación de un directorio en ~ durante el proceso de instalación.
  
exit &&
+
===Permisologia de archivos y directorios===
sudo umount /mnt/sys &&
 
sudo umount /mnt/proc &&
 
sudo umount /mnt/dev/pts &&
 
sudo umount /mnt/dev &&
 
sudo umount /mnt
 
  
Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
+
====Ajustar la permisologia de todos los archivos y directorios====
  
You may want to update grub or re-install burg however you like it.
+
Ver:
Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!
 
  
You can now reboot your computer.
+
[[Linux#Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers]]
  
===Notas===
+
[[Linux#A través del comando find]]
Instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Esto lo resolví reinstalando grub2 desde Ubuntu como se muestra en [[Linux#Reinstalling GRUB 2 from a Working System]]
 
  
==GIMP==
+
Ejecutar los siguientes comandos (3-cloud y 4-windows '''NO''' deben estar montados).
  
===How can I put multiple images side by side to make one image===
+
Para los directorios:
https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/
+
find 1-system -type d -exec chmod 755 {} +
  
Unir/Conbinar varias imágenes:
+
Para los archivos:
* Open one of the pictures in GIMP
+
find 1-system -type f -exec chmod 664 {} +
* Go to File > Open As Layers and select the other two pictures
 
* Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
 
* Select the different layers one at a time and move them to where you want:
 
: Crl PgUp / PgDn to change layer.
 
* Finally go to Image > Fit Canvas to Layers
 
  
==vim==
+
====Ajustar la permisologia por defecto al crear un archivo o directorio====
« vi » puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar « vim »
+
Ver [[Linux#Permisología por defecto]]
  
Guardar y cerrar:
+
Añadir la siguiente línea a .bashrc
:qw
 
  
Cerrar sin guardar los cambios:
+
  umask u=rwx,g=rx,o=rx
  :q!
 
  
==KATE==
+
para que los directorios y archivos sean creados con permisología:
kate color scheme
+
drwxr-xr-x  (755)
 +
-rw-r--r--  (644)
  
==Sublime Text==
+
===fstab===
Sublime Text is a sophisticated text editor for code, markup and prose.
+
/etc/fstab
 +
<syntaxhighlight lang="bash">
 +
#===========================
 +
# Cambios realizados por mi
 +
#===========================
 +
# Disco_local:
 +
UUID=0B8D61386C315368 /home/adelo/1-system/1-disco_local ntfs auto,users,exec,permissions 0 0
  
https://www.sublimetext.com/
+
# Disco externo - TOSHIBA EXT:
 +
UUID=3C9A5D379A5CEF40 /home/adelo/1-system/2-disco_ext ntfs auto,nofail,users,permissions 0 0
 +
</syntaxhighlight>
  
===Instalación===
+
===.bashrc (home)===
Install Sublime Text 3 en Ubuntu: https://tecadmin.net/install-sublime-text-editor-on-ubuntu/
+
/home/adelo/.bashrc
  
$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
+
<syntaxhighlight lang="bash">
$ sudo apt-get update
+
#===========================
$ sudo apt-get install sublime-text-installer
+
# Cambios realizados por mi
 +
#===========================
  
===Keyboard shortcut to comment lines in Sublime Text 3===
+
# Para la instalación del Seismic Unix:
http://stackoverflow.com/questions/17742781/keyboard-shortcut-to-comment-lines-in-sublime-text-3
+
export CWPROOT=/home/adelo/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-geofisica-procesamiento-modelado_sismico/seismic_unix/instalacion_seismic_unix
  
https://forum.sublimetext.com/t/st3-3012-toggle-comments-broken/8930/8
 
  
As a workaround, go to Preferences->Key Bindings - User and add these keybindings (if you're using Linux):
+
PATH=$PATH:$CWPROOT/bin
 +
export PATH
  
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
 
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
 
  
===Indentation===
+
# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
https://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-to-indent-two-spaces-per-tab
+
PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/eclipse/java-photon/eclipse:
  
If you want it for all files, go to Preferences -> Settings - Default/User. But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose.
+
# Después de la instalación de NetBeans, para adicionar el ejecutable a la lista de comandos:
 +
# PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin:
 +
# Otra forma de hacerlo es a trav'es de un soft link (claro que es necesario colocarlo en el .bashrc):
 +
# ln -s /home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin/netbeans /usr/local/bin/netbeans8.2
  
To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -> More -> Syntax Specific -> User. This should open a settings window named Ruby.sublime-settings
 
  
Save these settings:
+
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
 +
umask u=rwx,g=rx,o=rx
  
<syntaxhighlight lang="php">
 
{
 
  "tab_size": 2,
 
  "translate_tabs_to_spaces": true,
 
  "detect_indentation": false
 
}
 
</syntaxhighlight>
 
  
===Crear un proyecto en Sublime Text===
+
# -X : sort alphabetically by entry extension
# Abrimos una nueva ventana: File > New Window
+
# -A : do not list implied . and ..
# Add folder to project
+
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
# Save project as: es apropiado guardarlo en el mismo directorio en donde fue creado el proyecto.
+
alias la='ls -AX'
  
Esto creará dos archivos:
 
* nombre-111.sublime-project
 
* nombre-111.sublime-workspace : Este es el que debemos abrir para ingresar al proyecto.
 
  
==GParted==
+
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning
+
alias ls='ls -v --color=auto'
  
Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o monta: no sé si se usa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.
 
  
A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.
+
# He creado los comandos cdd y cdp para facilitar el acceso a 1-system y 1-pe:
 +
function cds() {
 +
  cd ~/1-system
 +
}
 +
cds
  
Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.
+
function cdp() {
 +
  cd ~/1-system/1-disco_local/1-mis_archivos/1-pe
 +
}
  
==Latex==
 
sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)
 
 
===Kile===
 
  
==LibreOffice/OpenOffice==
+
# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
===Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice===
+
# La siguiente función is to rename terminal tab title in gnome-terminal:
http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/
+
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
 
+
# # set-title my new tab title
sudo apt-get install myspell-es
+
function set-title() {
sudo apt-get install myspell-fr myspell-fr-gut
+
  if [[ -z "$ORIG" ]]; then
sudo apt-get install myspell-*
+
    ORIG=$PS1
 +
  fi
 +
  TITLE="\[\e]2;$*\a\]"
 +
  PS1=${ORIG}${TITLE}
 +
}
  
===No mostrar número de página y nombre de la página en Excel LibreOffice===
 
How NOT to print sheet name and page number in OpenOffice.org Calc: https://superuser.com/questions/200056/how-not-to-print-sheet-name-and-page-number-in-openoffice-org-calc
 
  
Go to: Format > Page: Header/Footer y desactivar ambos
+
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 +
alias del=gvfs-trash
  
==Adobe Reader (Acroread)==
 
Adobe has recently removed the Linux support from its official download page. Therefore Adobe Reader for Linux is no longer available for download from Adobe website.
 
  
Antes, la versión para Linux podía encontrarse en la página oficial de Adobe:
+
# added by Anaconda3 installer
https://get.adobe.com/fr/reader/otherversions/
+
export PATH="/home/adelo/.anaconda3/bin:$PATH"
 +
</syntaxhighlight>
  
Todavía se puede instalar de dos formas:
+
Ver [[Linux#Mover archivos a la papelera desde el terminal|Mover archivos a la papelera desde el terminal]] para más detalles del por qué se ha realizado la siguiente configuración: alias del=gvfs-trash
  
===From the old Canonical Partners repository===
 
http://ubuntuhandbook.org/index.php/2014/10/install-adobe-reader-ubuntu-14-10/
 
  
We can still install Adobe Reader (Acroread) 9 in Ubuntu 14.10 through the old Canonical Partners repository.
+
===.bashrc (root)===
 +
/root/.bashrc
  
sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
+
<syntaxhighlight lang="bash">
sudo apt-get update
+
#===========================
sudo apt-get install acroread
+
# Cambios realizados por mi
 +
#===========================
  
After properly installed Adobe Reader, don’t forget to remove the Canonical Partners repository for Precise:
+
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
 +
umask u=rwx,g=rx,o=rx
  
sudo add-apt-repository -r "deb http://archive.canonical.com/ precise partner"
 
sudo apt-get update
 
  
===From the latest official package for Linux, que Adobe incluyó en su sitio de descargas===
+
# -X : sort alphabetically by entry extension
Actually the latest official package (AdbeRdr9.5.5-1_i386linux_enu.deb) is still available en algunos sitios, but it might be removed in near future.
+
# -A : do not list implied . and ..
 +
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 +
alias la='ls -AX'
  
wget -c http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
 
  
Install Gdebi to handle the DEB package:
+
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
 +
alias ls='ls -v --color=auto'
  
sudo apt-get install gdebi
 
  
Now install the package via Gdebi. It’ll also install the dependencies:
+
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 +
alias del=gvfs-trash
  
sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb
 
  
If Adobe Reader is still missing libraries after installation. Run the command below to install them:
+
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
 +
umask u=rwx,g=rx,o=rx
 +
</syntaxhighlight>
  
sudo apt-get install libgtk2.0-0:i386 libnss3-1d:i386 libnspr4-0d:i386 lib32nss-mdns* libxml2:i386 libxslt1.1:i386 libstdc++6:i386
 
  
===How to Set Adobe Reader as default PDF reader===
+
/etc/bash.bashrc
'''Método 1:'''
+
<syntaxhighlight lang="bash">
 +
#===========================
 +
# Cambios realizados por mi
 +
#===========================
  
sudo gedit /etc/gnome/defaults.list
+
# -X : sort alphabetically by entry extension
 +
# -A : do not list implied . and ..
 +
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 +
alias 'la=ls -AX'
 +
</syntaxhighlight>
  
When the file opens, do:
+
===user-dirs.dirs===
 +
/home/adelo/.config/user-dirs.dirs
  
*Find out and change the line
+
<syntaxhighlight lang="bash">
 +
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 +
# usados por el sistema
 +
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 +
# /usr/share/icons/Humanity/places/64/folder-download.svg
  
application/pdf=evince.desktop
+
XDG_DESKTOP_DIR="$HOME/1-system/desktop"
 +
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
 +
XDG_TEMPLATES_DIR="$HOME/"
 +
XDG_PUBLICSHARE_DIR="$HOME/"
 +
XDG_DOCUMENTS_DIR="$HOME/"
 +
XDG_MUSIC_DIR="$HOME/"
 +
XDG_PICTURES_DIR="$HOME/"
 +
XDG_VIDEOS_DIR="$HOME/"
 +
</syntaxhighlight>
  
into:
 
  
  application/pdf=acroread.desktop
+
'''Luego creé los siguientes soft links:'''
 +
  ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/desktop-dis/    /home/adelo/1-system/desktop
 +
ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/downloads-dis/  /home/adelo/1-system/desktop/downloads
  
*Add below line into the end:
+
'''Luego cabié las imágenes de los íconos:'''
 +
/usr/share/icons/Humanity/places/128/user-desktop.svg
 +
/usr/share/icons/Humanity/places/64/folder-download.svg
  
application/fdf=acroread.desktop
+
==Mount discs==
application/xdp=acroread.desktop
+
Montar discos o particiones
application/xfdf=acroread.desktop
 
application/pdx=acroread.desktop
 
  
Finally save the file and restart nautilus (run command nautilus -q in terminal) to apply changes.
+
<syntaxhighlight lang="bash">
 +
sudo mount /dev/sda3 /home/adelo/1-system/4-windows/
 +
sudo umount /dev/sda3
 +
</syntaxhighlight>
  
 +
===Montar discos permanentemente===
 +
http://doc.ubuntu-fr.org/mount_fstab
  
'''Método 2:'''
+
Para montar permanentemente mi disco_local y mi disco_ext, tuve que agregar las siguientes líneas en el archivo /etc/fstab
  
mimeopen -d *.pdf
+
<syntaxhighlight lang="bash">
 +
# Disco_local:
 +
UUID=0B8D61386C315368 /home/adelo/1-system/1-disco_local ntfs auto,users,exec,permissions 0 0
  
===To remove Adobe Reader===
+
# Disco externo - TOSHIBA EXT:
sudo apt-get remove acroread; sudo apt-get autoremove
+
UUID=3C9A5D379A5CEF40 /home/adelo/1-system/2-disco_ext ntfs auto,nofail,users,permissions 0 0
 +
</syntaxhighlight>
  
===Ver también===
+
===Mount a remote filesystem in your local machine===
En el siguiente post también se encuentra buena información sobre como instalar Adobe Reader:
+
https://stackoverflow.com/questions/32747819/remote-java-development-using-intellij-or-eclipse
http://askubuntu.com/questions/455135/how-do-i-install-adobe-acrobat-reader-from-the-repository
 
  
==Skype==
+
https://serverfault.com/questions/306796/sshfs-problem-when-losing-connection
sudo apt-get install skype
 
  
==Seismic Unix==
+
https://askubuntu.com/questions/358906/sshfs-messes-up-everything-if-i-lose-connection
Instalación del SU
 
  
==Scilab==
+
https://askubuntu.com/questions/716612/sshfs-auto-reconnect
sudo apt-get install scilab
 
  
==Crear y borrar usuarios==
+
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
How to Add (create) and Delete Users on Ubuntu 16.04
+
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 visitor@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
 
  
  adduser newuser
+
  sshfs -o allow_other root@sinfronteras.ws: /home/adelo/1-system/3-cloud
  
You can delete the user itself, without deleting any of their files, by typing this as root:
 
deluser newuser
 
  
If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:
+
https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs
deluser --remove-home newuser
 
  
==apt-get==
+
==Free Up Space On Ubuntu==
 +
Liberar espacio
  
Desinstalar un programa:
+
===Clean up APT cache in Ubuntu===
 +
You can see the size of this cache with the command below:
 +
sudo du -sh /var/cache/apt
  
Uninstall the program and all configuration files:
+
Now, you have two options to handle the cache. Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary.
  sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*)
+
  sudo apt-get autoclean
  
 +
Or clean out the cache in its entirety (frees more disk space):
 +
sudo apt-get clean
  
También se podría:
+
===Clean the thumbnail cache===
  sudo apt-get autoremove eclipse*
+
  du -sh ~/.cache/thumbnails
   
+
  rm -rf ~/.cache/thumbnails/*
Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.
 
  
 +
===Empty the Trash===
 +
Vaciar papeleras
  
También podría ser necesario:
+
Los directorios Trash* pueden ser borrados sin ningún problemas puesto que se crean automáticamente.
rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)
 
  
 +
* '''Papeleras en la partición donde se encuentra instalado Ubuntu:'''
 +
<blockquote>
  
Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:
+
<syntaxhighlight lang="bash">
sudo apt-get remove <programname>
 
  
==Which==
+
/home/adelo/.local/share/Trash  (Estas rutas creo que deber ser comprobada como usuario y como '''root'''. Ver nota abajo)
Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:
+
/home/adelo/.Trash-*
adelo@adelo-laptop:~$ which python
+
/root/.local/share/Trash
/usr/bin/python
+
link del ícono de la papelera
 
==source==
 
The source command can be used to load any functions file into the current shell script or a command prompt.
 
  
The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.
+
</syntaxhighlight>
  
Uno de los usos más comunes es para reload your .bashrc without re-login or restart.
+
'''Nota:''' Por alguna razón que aún desconozco, al comparar los archivos en las dos rutas mostradas arriba con los archivos que se encueentran en la papelera al abrila a través del link del ícono de la papelera, se encuentran discrepancias. Es decir, hay archivos que se observan a través del link de la papelera que no se encuentran en las dos rutas mostradas arriba y viceversa. Por esta razón, debo también vaciar la papelera a través del link de la papelera.
source .bashrc
 
. .bashrc
 
  
==ls==
+
</blockquote>
  
===Listar sólo archivos o sólo directorios===
+
* '''Papeleras en disco_local''' (comprobar como usuario y como '''root'''):
Listar solo directorios:
+
<blockquote>
ls -lah | grep -v "^-"
+
<syntaxhighlight lang="bash">
  
Listar solo archivos:
+
/home/adelo/1-system/1-disco_local/.Trash-0
ls -lah | grep -v "^d"
+
/home/adelo/1-system/1-disco_local/.Trash-1000
  
==Listar archivos con su ruta absoluta==
+
</syntaxhighlight>
List files with their absolute path in linux:
+
</blockquote>
  
readlink -f *
+
* '''Papeleras en disco_ext''' (comprobar como usuario y como '''root'''):
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
  
==Listar archivos modificados antes, después, o en una cierta fecha==
+
/home/adelo/1-system/2-disco_ext/.Trash-0
https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/
+
/home/adelo/1-system/2-disco_ext/.Trash-1000
  
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:
+
</syntaxhighlight>
 +
</blockquote>
  
find . -mtime -1 -print
+
* '''Papeleras en el cloud''':
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
  
To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:
+
/root/.local/share/Trash
 +
/root/.Trash-*
  
find /directory_path -type f -mtime -1 -print
+
</syntaxhighlight>
 +
</blockquote>
  
To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:
+
==Filesystem Hierarchy Standard==
 +
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
  
touch -t `date +%m%d0000` /tmp/$$
+
{| class="wikitable" summary="A description of the hierarchy specified in the FHS."
find /tmefndr/oravl01 -type f -newer /tmp/$$
+
|-
rm /tmp/$$
+
!Directory
 
+
!Description
==Contar archivos en un directorio==
+
|-
https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/
+
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/}}'''</span>
 +
|Primary hierarchy root and root directory of the entire file system hierarchy.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/bin}}'''</span>
 +
|Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/boot}}'''</span>
 +
|Boot loader files, e.g., kernels, initrd.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/dev}}'''</span>
 +
|Essential device files, e.g., /dev/null.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/etc}}'''</span>
 +
<!-- Please see the talk page before changing this -->
 +
|Host-specific system-wide configuration files
  
'''Con find'''
+
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".
 
+
|-
'''La cuenta es mas exacta con find, por ejemplo:'''
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/home}}'''</span>
find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo
+
|Users' home directories, containing saved files, personal settings, etc.
 
+
|-
find . -type f | wc -l # Contar archivos de forma recursiva ilimitada
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/lib}}'''</span>
find . -type d | wc -l # Contar directorios de forma recursiva ilimitada
+
|Libraries essential for the binaries in /bin/ and /sbin/.
 
+
|-
find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/media}}'''</span>
find . | wc -l #Contar archivos y carpetas de forma recursiva
+
|Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
 
+
|-
find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/mnt}}'''</span>
 
+
|Temporarily mounted filesystems.
'''Con ls'''
+
|-
 
+
|
Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/opt}}'''</span>
 
+
|Optional application software packages.
ls | wc -l
+
|-
 
+
|
Para incluir los archivos ocultos:
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/proc}}'''</span>
 
+
|Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
ls -A | wc -l
+
|-
 
+
|
El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/root}}'''</span>
 
+
|Home directory for the root user.
==du==
+
|-
Para incluir archivos ocultos:
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/run}}'''</span>
* La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
+
|Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
 
+
|-
* Para listar sólo los archivos ocultos:
+
|
du -hs .[^.]*
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/sbin}}'''</span>
 +
|Essential system binaries, e.g., fsck, init, route.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/srv}}'''</span>
 +
|Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/sys}}'''</span>
 +
|Contains information about the devices connected to the computer.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/tmp}}'''</span>
 +
|Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/usr}}'''</span>
 +
|Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/var}}'''</span>
 +
|Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
 +
|-
 +
|}
  
* Si queremos listar ocultos y normales:
+
==Fonctionnalités notoires du shell==
du -hs $(ls -A)
 
  
* Si queremos ordenar los archivos por tamaño:
+
===Historique===
du -s $(ls -A) | sort -rn 
+
* '''Flecha hacia arriba:''' remonter,
  
Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.
+
*'''Flecha hacia abajo:''' redescendre dans l’historique;
 +
 
 +
*'''Ctrl + R <chaine>:''' Chercher une commande dans l’historique contenant <chaine> ;
 +
** '''A nouveau Ctrl + R:''' cherche la commande précédente ;
  
* Ahora si queremos listar en una unidad en particular:
+
'''Ctrl + G:''' interrompt la recherche.
sudo du -csh --block-size=1M $(ls -A) | sort -rn  (--block-size=1G)
 
Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.
 
  
* Si queremos excluir algún archivo o directorio:
+
==Cursos de Linux online==
du -s --exclude=Directorio $(ls -A) | sort -rn
 
  
==chown==
+
https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server
chown command changes the user and/or group ownership of for given file. The syntax is:
 
  
chown owner-user file
+
Red Hat Enterprise Linux 7 System Administrator's Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/System_Administrators_Guide/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf
chown options owner-user:owner-group file
 
  
chown adelo:adelo prueba.txt
+
http://www.learnlinux.org.za
chown -R adelo:adelo directorio
 
  
==chmod==
+
The Linux System Administrator's Guide:
https://doc.ubuntu-fr.org/permissions
+
http://www.tldp.org/LDP/sag/html/index.html
  
===En gerant chaque droit separement===
+
13 Linux Network Configuration and Troubleshooting Commands:
À qui s'applique le changement:
+
http://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/
* u (user, utilisateur) représente la catégorie "propriétaire" ;
 
* g (group, groupe) représente la catégorie "groupe propriétaire" ;
 
* o (others, autres) représente la catégorie "reste du monde" ;
 
* a (all, tous) représente l'ensemble des trois catégories.
 
   
 
La modification que l'on veut faire:
 
* + : ajouter
 
* - : supprimer
 
* = : affectation
 
  
Le droit que l'on veut modifier
+
Linux Internet Web Server and Domain Configuration Tutorial: http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html
* r : read ⇒ lecture
 
* w : write ⇒ écriture
 
* x : execute ⇒ exécution
 
* X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir [[Linux#Exemple d'application en traitant de façon différentiée les répertoires et les fichiers (récursivement)|plus bas]] dans la partie des traitements récursifs l'intérêt du X.
 
  
chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
+
https://en.wikiversity.org/wiki/Linux_server_administration#A_curriculum_for_the_first_6_months_of_using_Linux
chmod <options> ug+rw fichier3
 
chmod <options> a-rx fichier3
 
chmod -R a-rX directorio
 
  
===En octal===
+
http://brajeshwar.com/2008/top-free-linux-online-courses/
* r = 4
 
* w = 2
 
* x = 1
 
* - = 0
 
  
Par exemple:
+
https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0
* Pour rwx, on aura : 4+2+1 = 7
 
* Pour rw-, on aura : 4+2+0 = 6
 
* Pour r--, on aura : 4+0+0 = 4
 
  
  rwx        r-x        ---
+
http://study.com/articles/10_Sites_Offering_Free_Linux_Courses_Online.html
7(4+2+1)  5(4+0+1)  0(0+0+0)
 
  
===Ajustar permisología recursivamente===
+
==Red Hat==
chmod -R 750 Documents
+
He creado una cuenta for the Red Hat Developer Program (email y clave habitual), lo cual me permite descargar una versión gratis de Red Hat:
  
====Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers====
+
http://developers.redhat.com/
  
=====A traves del permiso X=====
+
http://developers.redhat.com/products/rhel/download/
X representa el permiso de ejecución en repertorios y en fichiers qui ont un x quelque part. Esto permite tratar separadamente el permiso de ejecución en directorios y en archivos. Veamos algunos ejemplos:
 
  
'''Application 1 :'''
+
http://developers.redhat.com/products/rhel/get-started/
  
Soit un répertoire monrep, contenant des sous-répertoires et des fichiers. Les droits sont drwx------ (700) pour les répertoires et -rw------- (600) pour les fichiers.
+
%%%%%%%%
  
On veut ajouter récursivement les mêmes droits (resp. rwx et rw) pour le groupe. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
+
Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:
  
Si on lance chmod -R 770 monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
+
Hi Adelo,
  
Si on lance chmod -R 660 monrep : les répertoires n'auront plus les droits d'exécution → catastrophique :-(
+
I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:
  
Si on lance chmod -R g+rwx monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
+
* Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found [http://developers.redhat.com/products here].
 +
* Highlighted and new content: For ease we will have that on our [http://developers.redhat.com homepage] and will be adding material multiple times a week.
 +
* You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found [http://developers.redhat.com/community/contributor/ here]. And did I mention contributing gets you swag?
  
Si on lance '''chmod -R g+rwX monrep''' : seuls les répertoires (et les fichiers déjà exécutables) auront les droits d'exécution → bon :-)
+
Again, welcome to Red Hat Developers.
  
 +
Andréa
  
'''Application 2 :'''
+
%%%%%%%%
  
Imaginons que précédemment on ait lancé la commande chmod -R 770 monrep. La situation est la suivante : les droits sont drwxrwx--- (770) pour les répertoires et -rwxrwx--- (770) pour les fichiers.
+
Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat  https://access.redhat.com/products/red-hat-enterprise-linux/evaluation
  
On désire supprimer les droits d'exécution uniquement sur les fichiers. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
+
Para crear el bootable usb: https://access.redhat.com/articles/142303
  
Comme chmod s'applique à la fois aux fichiers et répertoires, nous allons jongler avec x et X. Il faut enlever x puis ajouter X.
+
===All certifications and exams===
 +
https://www.redhat.com/en/services/all-certifications-exams
  
Si on lance chmod -R u-x+X,g-x+X monrep cela n'aura aucun effet car X concerne à la fois les répertoires ET les fichiers qui ont un x quelque part. Donc si u-x enlève le premier x (ce qui donne -rw-rwx---), la suite +X va aussitôt remettre un x car il reste un x (celui du groupe !).
+
https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification
  
Donc il faut d'abord enlever tous les x : u-x,g-x avant de les remettre (sera fait uniquement pour les répertoires cette fois) ce qui donne finalement :
+
====Red Hat Certified System Administrator (RHCSA) exam====
 +
https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam
  
chmod -R u-x,g-x,u+X,g+X monrep
+
===All training courses and exams===
 +
https://www.redhat.com/en/services/training/all-courses-exams
  
=====A través del comando find=====
+
====Red Hat System Administration I====
Como vimos, X permite tratar separadamente el permiso de ejecución en directorios y en archivos. Ahora, si queremos asignar una configuración de derechos a los directorios y otra muy distinta a los archivos, lo podemos hacer a través del comando find de la siguiente forma:
+
https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i
  
http://askubuntu.com/questions/58467/chmod-files-only-in-all-subdirectories/58470
+
====Red Hat System Administration II with RHCSA exam====
 +
https://www.redhat.com/en/services/training/rh135-red-hat-system-administration-ii-rhcsa-exam
  
Para los directorios:
+
====Combines Red Hat System Administration I and II at a rapid pace====
find <directorio> -type d -exec chmod 755 {} +
+
https://www.redhat.com/en/services/training/rh200-rhcsa-rapid-track-course-rhcsa-exam
  
Para los archivos:
+
===Documentación gratis===
find <directorio> -type f -exec chmod 664 {} +
+
Creo que esta guía para RedHad está bastante buena:
 +
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/
  
===Permisología por defecto===
+
En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more:
En Ubuntu, al crear un directorio, la configuración de los permisos por defecto será:
+
https://www.certdepot.net/
'''drwxrwxr-x  (775)'''
+
 
Me parece mejor la permisología:
+
===Instalación===
<span style="background:DarkKhaki">'''drwxr-xr-x  (755)'''  (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
+
Short guide: https://developers.redhat.com/products/rhel/hello-world/
Grupo y otros podrán acceder (x) a los directorio y ver (r) su contenido (listar todos los archivos que en él se encuentran); pero no podrán realizar cambios en el directorio (w) (no se podrán crear archivos en el directorio).
 
  
Y para los archivos:
+
Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html
'''-rw-rw-r--  (664)'''
 
Para los archivos podría ser más conveniente de esta forma:
 
<span style="background:DarkKhaki">'''-rw-r--r--  (644)'''  (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
 
O incluso así:
 
'''-rw-r-----  (640)'''
 
  
====Cambiar la permisologia por defecto====
+
====System Requirements====
Cambiar la permisologia base/por defecto (umask)
 
  
https://es.wikipedia.org/wiki/Umask
+
The requirements for your physical system are:
  
umask (abreviatura de user mask, máscara de usuario) es una orden y una función en entornos POSIX que establece los permisos por defecto para los nuevos archivos y directorios creados por el proceso actual.
+
a 64-bit x86 machine.
  
Los sistemas Unix modernos permiten que las máscaras se especifiquen de dos modos:
+
4 GB of RAM
* Un permiso por defecto, también llamado máscara simbólica. Por ejemplo, u=rwx,g=rwx,o=
 
* Un número en octal que controla qué permisos se enmascararán (no se establecerán) para cualquier nuevo archivo, por ejemplo, 007.
 
  
En ambos casos debe tenerse en cuenta que la mayoría de los sistemas Unix no permiten que nuevos archivos sean creados con permisos de ejecución activados, independientemente de la máscara.
+
20 GB of available disk space.
  
Ejemplo de máscara simbólica:
+
For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html
  $ umask u=rwx,g=rwx,o=
 
  $ mkdir foo
 
  $ touch bar
 
  $ ls -l
 
  drwxrwx--- 2 dave 512 Sep  1 20:59 foo
 
  -rw-rw---- 1 dave  0 Sep  1 20:59 bar
 
  
  
Ejemplos de máscara en octal:
+
====Software selection====
  $ umask 0174
 
  $ mkdir foo
 
  $ touch bar
 
  $ ls -l
 
  drw-----wx 2 dave 512 Sep  1 20:59 foo
 
  -rw-----w- 1 dave  0 Sep  1 20:59 bar
 
  
'''Configurar el valor de umask permanentemente:''' para un usuario en concreto hay que añadir en el fichero ''.bashrc'' el comando '''umask u=rwx,g=rx,o=rx'''. También se puede modificar el valor de umask en el fichero global ''/etc/profile'' para que el cambio sea efectivo para todos los usuarios. http://www.websecurity.es/como-utilizar-umask-establecer-los-permisos-predeterminados
+
The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.
  
 +
Click Software selection.
  
Ahora, a través del umask no se pueden ajustar separadamente los permisos de los directorios y de los archivos, debido a que umash afecta tanto a los archivos como a los directorio. No he encontrado una orden que permita hacer distinción entre los permisos bases de los directorios y los de los archivos. Sin embargo, en el siguiente post se propone una forma de hacer esto:
+
On the next screen, under Software selection, in the Base environment list on the left, select '''Server with GUI'''.
  
http://stackoverflow.com/questions/12445527/set-different-umask-for-files-and-folders
+
In the list Add-ons for selected environment on the right, select Development tools.
  
Interesting requirement. Currently (at least in bash), umask is a global setting and you cannot set it based on object type.
 
  
One solution that comes to mind would be to set the umask to the file variant and then intercept calls to mkdir (such as with a user-created mkdir script earlier in the path) to do:
+
====Installation destination====
 +
to specify which disk or partition(s) to use for Red Hat Enterprise Linux. Note: It is important that you understand the choices that you are making in this section to avoid accidental data loss. It is strongly recommended that you read the Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html
  
umask 0701 ; /path/to/real/mkdir $1 ; umask 0604
 
  
That way, assuming all your directory creations are done with mkdir, you can ensure they use a different umask setting.
+
=====Particionamiento=====
 +
Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos seleccionar la opción "I will configure particioning". Lo cual nos llevará a la ventana "Manual Particioning"
  
Note that the script should probably be a little more robust such as restoring the previous umask rather than forcing it to 0604, and adding some better error checking and possibly the ability to handle multiple arguments.
+
El programa de instalación de Red Hat permite intalar el SO una partición previamente creada o crear una nueva partición a partir de espacio libre en el disco.
  
But that's all detail, the framework above should be enough to get you started.
+
Para crear una nueva partición debemos especificar el tipo de partición en "New mount points will use the following partitioning scheme":
 +
* LVM (Logical Volume Manager).
 +
* ,
 +
y luego hacer clic en + para crear la partición.
  
==fdisk==
+
Sin embargo, el programa de particionamiento no es muy amigable, y no permite especificar la posición de la partición y creo que tampoco permite general un esquema complejo de particiones. Por ejemplo, crear una partición extendida y dentro un conjunto de particiones lógicas en las posiciones deseadas.
n => Create new Partition (Then create what you need)
 
  
t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)
+
Por tanto, me parece mucho más apropiado crear las particiones (con Gparted) antes de iniciar la instalación de Red Had.
  
w => Write the changes to disk and exit
+
==Grub2==
 +
The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.
  
===Crear una partición con fdisk===
+
En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0
sudo fdisk /dev/sdb
 
Welcome to fdisk (util-linux 2.27.1).
 
Changes will remain in memory only, until you decide to write them.
 
Be careful before using the write command.
 
  
Command (m for help): n
+
===Installing - Reinstalling Grub2===
Partition type
+
https://help.ubuntu.com/community/Grub2/Installing
  p  primary (0 primary, 0 extended, 4 free)
 
  e  extended (container for logical partitions)
 
Select (default p): p
 
Partition number (1-4, default 1): 1
 
First sector (2048-4028415, default 2048):
 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415):  
 
  
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
+
====Reinstalling GRUB 2 from a Working System====
  
Command (m for help): w
+
If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal.
The partition table has been altered.
 
Calling ioctl() to re-read partition table.
 
Syncing disks.
 
  
==Mostrar barra de progreso al Copiar, mover y borrar archivos==
+
X is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.
  
===gcp===
+
sudo grub-install /dev/sdX  # Example: sudo grub-install /dev/sda
Comando para copiar mostrando una barra de progreso y velocidad.
 
  
gcp -r origen/archivo /destino
+
This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running
  
==Hard and symbolic (soft) links==
+
sudo update-grub after the install will ensure GRUB 2's menu is up-to-date.
http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link
 
  
Underneath the file system files are represented by inodes (or is it multiple inodes not sure)
+
====If a system has become unbootable====
 +
There are various methods for reinstalling GRUB 2. The simplest is listed first, followed by more complicated methods.
  
A file in the file system is basically a link to an inode.
+
=====Via Boot-Repair Graphical Tool=====
A hard link then just creates another file with a link to the same underlying inode.
+
https://help.ubuntu.com/community/Boot-Repair
  
When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
+
=====Via GRUB2 Rescue mode=====
 +
GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot.
 +
https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode
  
A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.
+
=====Via the LiveCD terminal=====
 +
Este método se encuentra explicado aquí: https://help.ubuntu.com/community/Grub2/Installing
  
Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
+
y aquí: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
  
Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.
+
Creo que en el segundo link se encuentra una mejor explicación, la cual resumo a continuación:
  
 +
======How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB======
 +
Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.
  
'''Let's create hard and soft links:'''
+
Warning
 +
Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.
  
Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:
+
Terminal Commands
ln blah1 blah1-hard  (hard link not allowed for directory)
 
  
ln -s blah2 blah2-soft
+
Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.
  
Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.
+
sudo mount /dev/sdXY /mnt
  
If blah1 is deleted, blah1-hard still holds the contents.
+
Now bind the directories that grub needs access to to detect other operating systems, like so.
  
If blah2 is deleted, blah2-soft is just a link to a non-existing file.
+
sudo mount --bind /dev /mnt/dev &&
 +
sudo mount --bind /dev/pts /mnt/dev/pts &&
 +
sudo mount --bind /proc /mnt/proc &&
 +
sudo mount --bind /sys /mnt/sys
  
===What's the difference between a hard link and a copy?===
+
Now we jump into that using chroot.
https://bbs.archlinux.org/viewtopic.php?id=53484
 
  
Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).
+
sudo chroot /mnt
  
Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.
 
  
No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.
+
Now install, check, and update grub.
  
Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:
+
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.
cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)
 
  
Si se quieren preservar los softlinks debemos entonces usar también la opción -d
+
grub-install /dev/sdX
  cp -rlpd
 
  
==tar and zip==
+
grub-install --recheck /dev/sdX
===tar===
 
De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/
 
tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos
 
  
De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)
+
  update-grub
  tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .
 
  
===zip===
+
Now grub is back, all that is left is to exit the chrooted system and unmount everything.
unzip file.zip -d destination_folder
 
  
==Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep==
+
exit &&
  find . -type f -print | xargs grep "palabra"
+
sudo umount /mnt/sys &&
 +
sudo umount /mnt/proc &&
 +
sudo umount /mnt/dev/pts &&
 +
sudo umount /mnt/dev &&
 +
  sudo umount /mnt
  
 +
Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
  
'''Y para buscar una linea que contenga dos palabras especificas:'''
+
You may want to update grub or re-install burg however you like it.
 +
Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!
  
find . -type f -print | xargs grep "palabra1" | grep "palabra2"
+
You can now reboot your computer.
  
 +
===Notas===
 +
Instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Esto lo resolví reinstalando grub2 desde Ubuntu como se muestra en [[Linux#Reinstalling GRUB 2 from a Working System]]
  
'''O también:'''
+
==GIMP==
find . -exec egrep palagra '{}' +
 
  
 +
===How can I put multiple images side by side to make one image===
 +
https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/
  
'''Otra forma:'''
+
Unir/Conbinar varias imágenes:
 +
* Open one of the pictures in GIMP
 +
* Go to File > Open As Layers and select the other two pictures
 +
* Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
 +
* Select the different layers one at a time and move them to where you want:
 +
: Crl PgUp / PgDn to change layer.
 +
* Finally go to Image > Fit Canvas to Layers
  
egrep -r palabra *
+
==vim==
 +
« vi » puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar « vim »
  
==Alias==
+
Guardar y cerrar:
http://www.computerhope.com/unix/ualias.htm
+
:qw
  
Aliases are used to customize the shell session interface:
+
Cerrar sin guardar los cambios:
  alias ls='ls --color=auto'
+
  :q!
  
alias ll='ls -la'
+
==KATE==
 +
kate color scheme
  
alias .....='cd ../../../../'
+
==Sublime Text==
 +
Sublime Text is a sophisticated text editor for code, markup and prose.
  
Éste lo he adicionado a mi .bashrc:
+
https://www.sublimetext.com/
alias 'la=ls -AX'
 
  
==Para saber las características del hardware y del SO==
+
===Instalación===
 +
Install Sublime Text 3 en Ubuntu: https://tecadmin.net/install-sublime-text-editor-on-ubuntu/
  
===Caracteristicas del harware (marcas/fabricantes, modelos, etc)===
+
$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
{{#lst:Mi_computadora|product_name}}
+
$ sudo apt-get update
====Startup Menu====
+
$ sudo apt-get install sublime-text-installer
Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.
 
  
====dmidecode====
+
===Keyboard shortcut to comment lines in Sublime Text 3===
sudo dmidecode | more
+
http://stackoverflow.com/questions/17742781/keyboard-shortcut-to-comment-lines-in-sublime-text-3
  
Este comando despliega las características detalladas de todos los componentes del hardware:
+
https://forum.sublimetext.com/t/st3-3012-toggle-comments-broken/8930/8
* System Information,
 
* BIOS Information,
 
* Processor Information, etc.
 
  
Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):
+
As a workaround, go to Preferences->Key Bindings - User and add these keybindings (if you're using Linux):
  
  sudo dmidecode | grep -A 9 "System Information"
+
  { "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
 +
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
  
También se puede utilizar este comando empleando ciertos String a través de la opción -s:
+
===Indentation===
 +
https://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-to-indent-two-spaces-per-tab
  
sudo dmidecode -s String_keyword
+
If you want it for all files, go to Preferences -> Settings - Default/User. But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose.
  
sudo dmidecode -s system-product-name
+
To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -> More -> Syntax Specific -> User. This should open a settings window named Ruby.sublime-settings
sudo dmidecode -s bios-release-date
 
sudo dmidecode -s baseboard-product-name
 
sudo dmidecode -s baseboard-manufacturer
 
  
====sysinfo/lshw====
+
Save these settings:
sudo apt-get install sysinfo
 
  
'''Para crear un archivo html con todas las características del hardware:'''
+
<syntaxhighlight lang="php">
 +
{
 +
  "tab_size": 2,
 +
  "translate_tabs_to_spaces": true,
 +
  "detect_indentation": false
 +
}
 +
</syntaxhighlight>
  
sudo lshw -html > mySpecs.html
+
===Crear un proyecto en Sublime Text===
 +
# Abrimos una nueva ventana: File > New Window
 +
# Add folder to project
 +
# Save project as: es apropiado guardarlo en el mismo directorio en donde fue creado el proyecto.
  
then check the html file.
+
Esto creará dos archivos:
 +
* nombre-111.sublime-project
 +
* nombre-111.sublime-workspace : Este es el que debemos abrir para ingresar al proyecto.
  
===Desplegar el SO instalado (detallando la versión)===
+
==GParted==
lsb_release -a
+
A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning
  
http://askubuntu.com/questions/55609/how-do-i-check-system-specifications
+
Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o monta: no sé si se usa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.
  
===Para saber si el SO instalado es 32 o 64bit===
+
A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.
uname -a
 
  
Result for 32-bit Ubuntu:
+
Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.
  
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
+
==Latex==
 +
sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)
 +
 +
===Kile===
  
whereas the 64-bit Ubuntu will show:
+
==LibreOffice/OpenOffice==
 +
===Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice===
 +
http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/
  
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
+
sudo apt-get install myspell-es
 +
sudo apt-get install myspell-fr myspell-fr-gut
 +
sudo apt-get install myspell-*
  
 +
===No mostrar número de página y nombre de la página en Excel LibreOffice===
 +
How NOT to print sheet name and page number in OpenOffice.org Calc: https://superuser.com/questions/200056/how-not-to-print-sheet-name-and-page-number-in-openoffice-org-calc
  
O a través del comando:
+
Go to: Format > Page: Header/Footer y desactivar ambos
  
getconf LONG_BIT
+
==Adobe Reader (Acroread)==
 +
Adobe has recently removed the Linux support from its official download page. Therefore Adobe Reader for Linux is no longer available for download from Adobe website.
  
===Para ver las particiones y dispositivos montados===
+
Antes, la versión para Linux podía encontrarse en la página oficial de Adobe:
Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]]. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):
+
https://get.adobe.com/fr/reader/otherversions/
sudo parted /dev/sda then type print
 
sudo parted -l
 
  
 +
Todavía se puede instalar de dos formas:
  
Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:
+
===From the old Canonical Partners repository===
lsblk -fm
+
http://ubuntuhandbook.org/index.php/2014/10/install-adobe-reader-ubuntu-14-10/
  
 +
We can still install Adobe Reader (Acroread) 9 in Ubuntu 14.10 through the old Canonical Partners repository.
  
Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):
+
sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
  sudo fdisk -l
+
sudo apt-get update
 +
  sudo apt-get install acroread
  
 +
After properly installed Adobe Reader, don’t forget to remove the Canonical Partners repository for Precise:
  
A través del comando mount podemos saber el tipo de sistemas de archivos de particiones/dispositivos montados (check filesystem type):
+
sudo add-apt-repository -r "deb http://archive.canonical.com/ precise partner"
  mount
+
sudo apt-get update
Al parecer el tipo fuseblk se refiere a una partición ntfs ver http://ubuntuforums.org/showthread.php?t=1096841
 
  
 +
===From the latest official package for Linux, que Adobe incluyó en su sitio de descargas===
 +
Actually the latest official package (AdbeRdr9.5.5-1_i386linux_enu.deb) is still available en algunos sitios, but it might be removed in near future.
  
Para saber el '''UUID''' de una partición:
+
wget -c http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
sudo blkid
 
  
 +
Install Gdebi to handle the DEB package:
  
Muestra información sólo de particiones/dispositivos montados:
+
  sudo apt-get install gdebi
  df -h
 
  
====Tamaños de la partición: Different partition sizes reported by df and parted====
+
Now install the package via Gdebi. It’ll also install the dependencies:
http://ubuntuforums.org/showthread.php?t=1575190
 
  
http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html
+
sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb
  
===Para saber la memoria RAM y Swap (total y en uso)===
+
If Adobe Reader is still missing libraries after installation. Run the command below to install them:
free -m
 
  
O graficamente en System > Administration > System monitor
+
sudo apt-get install libgtk2.0-0:i386 libnss3-1d:i386 libnspr4-0d:i386 lib32nss-mdns* libxml2:i386 libxslt1.1:i386 libstdc++6:i386
  
Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/
+
===How to Set Adobe Reader as default PDF reader===
 +
'''Método 1:'''
  
===Información del procesador del sistema: núcleos, velocidad, fabricante, arquitectura, 32 o 64bit===
+
  sudo gedit /etc/gnome/defaults.list
  lscpu
 
  
==Formatear una unidad Flash USB==
+
When the file opens, do:
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
 
  
===Usando el terminal===
+
*Find out and change the line
Para mostrar los distintos dispositivos y particiones en el sistema:
 
lsblk -fm
 
  
Antes de formatear una device debemos desmontarla:
+
application/pdf=evince.desktop
  
umount /dev/sdb*
+
into:
  
Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver [[Linux#Nota_sdb|Nota sdb]]
+
application/pdf=acroread.desktop
  
$ sudo mkfs.vfat -I /dev/sdb
+
*Add below line into the end:
  
http://tecadmin.net/format-usb-in-linux/#
+
application/fdf=acroread.desktop
 +
application/xdp=acroread.desktop
 +
application/xfdf=acroread.desktop
 +
application/pdx=acroread.desktop
  
https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/
+
Finally save the file and restart nautilus (run command nautilus -q in terminal) to apply changes.
  
$ sudo umount /dev/sdc1
 
  
$ sudo umount /dev/sdb*
+
'''Método 2:'''
  
Format with vFat FileSystem
+
mimeopen -d *.pdf
  
  $ sudo mkfs.vfat /dev/sdc1
+
===To remove Adobe Reader===
 +
  sudo apt-get remove acroread; sudo apt-get autoremove
  
Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:
+
===Ver también===
 +
En el siguiente post también se encuentra buena información sobre como instalar Adobe Reader:  
 +
http://askubuntu.com/questions/455135/how-do-i-install-adobe-acrobat-reader-from-the-repository
  
/dev/sdb is entire device, not just one partition.
+
==Skype==
  Refusing to make a filesystem here!
+
  sudo apt-get install skype
  
Por eso tuve que crear una partición en la device antes de formatear --> [[Linux#Crear una partición con fdisk|Crear una partición con fdisk]]
+
==Seismic Unix==
 +
Instalación del SU
  
  $ sudo mkfs.ntfs /dev/sdc1
+
==Scilab==
 +
  sudo apt-get install scilab
  
Format with EXT4 FileSystem
+
==Crear y borrar usuarios==
 +
How to Add (create) and Delete Users on Ubuntu 16.04
 +
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
  
  $ sudo mkfs.ext4 /dev/sdc1
+
  adduser newuser
  
===Interfaz gráfica===
+
You can delete the user itself, without deleting any of their files, by typing this as root:
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
+
deluser newuser
  
==Screenshot Tool in Ubuntu==
+
If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:
Aplicación para imprimir pantalla
+
deluser --remove-home newuser
  
===Gnome Screenshot===
+
==apt-get==
https://doc.ubuntu-fr.org/gnome-screenshot
 
  
Gnome Screenshot est déjà installé par défaut sur Ubuntu
+
Desinstalar un programa:
  
Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran.
+
Uninstall the program and all configuration files:
Ou encore depuis un terminal avec la commande suivante:
+
sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*)
  
gnome-screenshot -i
 
  
À l'aide de raccourcis:
+
También se podría:
La convinación de tecla normal no me funciona, la siguiente sí:
+
sudo apt-get autoremove eclipse*
 +
 +
Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.
  
[ALT]+[FN]+[IMPR] → Capturer la fenêtre active.
 
  
En la página Web se pueden ver las otras convinaciones de tecla disponibles
+
También podría ser necesario:
 +
rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)
  
===Shutter===
 
https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images
 
  
Shutter es un buen programa para imprimir pantallas.
+
Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:
 +
sudo apt-get remove <programname>
  
También permite editar imágenes: crear flechas y etiquetas de una forma fácil.
+
==Which==
 +
Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:
 +
adelo@adelo-laptop:~$ which python
 +
/usr/bin/python
 +
 +
==source==
 +
The source command can be used to load any functions file into the current shell script or a command prompt.
  
==Programas para realizar respaldos (Backup)==
+
The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.
  
===rsync===
+
Uno de los usos más comunes es para reload your .bashrc without re-login or restart.
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
+
source .bashrc
 +
. .bashrc
  
http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/
+
==ls==
  
'''<span style="background:Thistle">One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file.</span> <span style="background:PaleGoldenrod">De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.</span>'''
+
===Listar sólo archivos o sólo directorios===
 +
Listar solo directorios:
 +
ls -lah | grep -v "^-"
  
  rsync -azvu --delete --progress Source/ Destination/
+
Listar solo archivos:
 +
  ls -lah | grep -v "^d"
  
Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.
+
==Listar archivos con su ruta absoluta==
 +
List files with their absolute path in linux:
  
  rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
+
  readlink -f *
  
: '''-a''', --archive, archive mode; equals '''-rlptgoD''' (no -H,-A,-X). This option does the following:
+
==Listar archivos modificados antes, después, o en una cierta fecha==
:: '''-l''', --links copy symlinks as symlinks (Preserves symbolic links)
+
https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/
:: '''-p''', --perms preserve permissions
 
:: '''-t''', --times preserve modification times (Preserves timestamp)
 
:: '''-g''', --group preserve group
 
:: '''-o''', --owner preserve owner (super-user only)
 
:: '''-D''' same as --devices --specials
 
::: '''--devices''' preserve device files (super-user only)
 
::: '''--specials''' preserve special files
 
::; -r, --recursive (ayuda from man rsync):
 
::: This tells rsync to copy directories recursively.  See also --dirs (-d).
 
  
::: Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed.  This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer.  It is also only  possible when both ends of the transfer are at least version 3.0.0.
+
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:
  
::: Some options  require  rsync  to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and  --delay-updates.   Because  of  this,  the default  delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0  (use  --del  or  --delete-during  to  request  this  improved  deletion  mode explicitly).  See  also  the --delete-delay option that is a better choice than using --delete-after.
+
  find . -mtime -1 -print
  
::: Incremental recursion can be disabled using the '''--no-inc-recursive''' option or its shorter --no-i-r alias.
+
To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:
  
: '''-z''' is to enable compression
+
find /directory_path -type f -mtime -1 -print
  
: '''-v''' verbose
+
To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:
  
: '''-u :''' Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
+
touch -t `date +%m%d0000` /tmp/$$
 +
find /tmefndr/oravl01 -type f -newer /tmp/$$
 +
rm /tmp/$$
  
: '''--delete''' it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
+
==Contar archivos en un directorio==
 +
https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/
  
: '''--progress :''' View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
+
'''Con find'''
  
: '''--exclude''' is to exclude files or directories while doing synchronization. Ver [http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/ 6 rsync Examples to Exclude Multiple Files and Directories]
+
'''La cuenta es mas exacta con find, por ejemplo:'''
  
:'''--delete-after :''' No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
+
find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo
  
:; -H, --hard-links (ayuda from man rsync):
+
find . -type f | wc -l # Contar archivos de forma recursiva ilimitada
:: This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
 
  
:: This  option  does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source. Cases in which the destination may end up with extra hard links include the following:
+
find . -type d | wc -l # Contar directorios de forma recursiva ilimitada
  
::* If the destination contains extraneous hard-links (more linking than what is  present  in  the  source  file list), the copying algorithm will not break them explicitly. However, if one or more of the paths have content differences, the normal file-update process will break those extra links  (unless  you  are  using  the --inplace option).
+
find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada
  
::* If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due  to  the --link-dest associations.
+
find . | wc -l #Contar archivos y carpetas de forma recursiva
  
:: Note that rsync can only detect hard links between files that are inside the transfer set. If rsync updates a file that has extra hard-link connections to files outside the transfer, that  linkage  will  be  broken.   If  you  are tempted  to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes  happen  due  to  lingering  hard  links  (and  see  the --inplace option for more caveats).
+
find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada
  
:: If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy.  This does not affect the  accuracy  of  the transfer  (i.e.  which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member  of  the  hard-linked set of files).  One way to avoid this inefficiency is to disable incremental recursion using the '''--no-inc-recursive''' option.
 
  
:; --partial (ayuda from man rsync):
+
'''Con ls'''
:: By default, rsync will delete any partially transferred file if the transfer is interrupted. In some  circumstances it  is  more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
 
  
::; --partial-dir=DIR
+
Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.
::: A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial  data  (instead of writing it out to the destination file).  On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
 
  
::: Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file  that  is  being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
+
ls | wc -l
  
::: Rsync  will create the DIR if it is missing (just the last dir -- not the whole path).  This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in  the  destination file’s directory when needed, and then remove it again when the partial file is deleted.
+
Para incluir los archivos ocultos:
  
::: If  the  partial-dir  value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes.  This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent  the  untimely  deletion  of  partial-dir items on the receiving side.  An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
+
ls -A | wc -l
  
::: If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule  for  the  partial-dir  because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice.  For instance, if you want to make rsync clean-up any left-over partial-dirs  that may  be lying around, you should specify --delete-after and add a "risk" filter rule, e.g.  -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
+
El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..
  
::: IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk.  E.g. AVOID "/tmp".
+
==du==
 +
Para incluir archivos ocultos:
  
::: You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable.  Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial  is  specified. For  instance,  instead  of  using  --partial-dir=.rsync-tmp  along  with  --progress, you  could  set  RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of  the  .rsync-tmp  dirfor  partial  transfers. The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
+
* La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
  
::: For the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial. This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a  partial transfer, while still allowing the safer idiom provided by --partial-dir.
+
* Para listar sólo los archivos ocultos:
 +
  du -hs .[^.]*
  
: '''-P :''' same as --partial --progress.
+
* Si queremos listar ocultos y normales:
 +
du -hs $(ls -A)
  
: '''--no-inc-recursive :''' Ver comentarios en las opciones '''-r''' y '''-H'''.
+
* Si queremos ordenar los archivos por tamaño:
 +
du -s $(ls -A) | sort -rn 
  
 +
Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.
  
Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el...
+
* Ahora si queremos listar en una unidad en particular:
Al parecer, la solución a este problema se encuentra explicada aquí:
+
sudo du -csh --block-size=1M $(ls -A) | sort -rn  (--block-size=1G)
https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/
+
Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.
  
http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
+
* Si queremos excluir algún archivo o directorio:
 +
du -s --exclude=Directorio $(ls -A) | sort -rn
  
http://javier.io/blog/en/2014/08/06/rsync-rename-move.html
+
==chown==
 +
chown command changes the user and/or group ownership of for given file. The syntax is:
  
* Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.
+
chown owner-user file
 +
chown options owner-user:owner-group file
  
====Mis sincronizaciones====
+
chown adelo:adelo prueba.txt
  rsync -azvu --delete-after --progress /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos-dde/
+
  chown -R adelo:adelo directorio
  
rsync -azvu --delete --progress --exclude '/home/adelo/toshiba_ext/1-mis_archivos/stockage' /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos/
+
==chmod==
 +
https://doc.ubuntu-fr.org/permissions
  
=== ===
+
===En gerant chaque droit separement===
http://askubuntu.com/questions/2596/comparison-of-backup-tools
+
À qui s'applique le changement:
 +
* u (user, utilisateur) représente la catégorie "propriétaire" ;
 +
* g (group, groupe) représente la catégorie "groupe propriétaire" ;
 +
* o (others, autres) représente la catégorie "reste du monde" ;
 +
* a (all, tous) représente l'ensemble des trois catégories.
 +
   
 +
La modification que l'on veut faire:
 +
* + : ajouter
 +
* - : supprimer
 +
* = : affectation
  
http://www.thegeekstuff.com/2012/05/backup-ubuntu-desktop/
+
Le droit que l'on veut modifier
 +
* r : read ⇒ lecture
 +
* w : write ⇒ écriture
 +
* x : execute ⇒ exécution
 +
* X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir [[Linux#Exemple d'application en traitant de façon différentiée les répertoires et les fichiers (récursivement)|plus bas]] dans la partie des traitements récursifs l'intérêt du X.
  
deja-dup
+
chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
 +
chmod <options> ug+rw fichier3
 +
chmod <options> a-rx fichier3
 +
chmod -R a-rX directorio
  
==Nautilus==
+
===En octal===
 +
* r = 4
 +
* w = 2
 +
* x = 1
 +
* - = 0
  
===Cambiar el icono de una carpeta===
+
Par exemple:
https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/
+
* Pour rwx, on aura : 4+2+1 = 7
 +
* Pour rw-, on aura : 4+2+0 = 6
 +
* Pour r--, on aura : 4+0+0 = 4
  
===Folder color: cambia el color de todas tus carpetas en Ubuntu===
+
  rwx        r-x        ---
https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/
+
7(4+2+1)  5(4+0+1)  0(0+0+0)
  
Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.
+
===Ajustar permisología recursivamente===
 +
chmod -R 750 Documents
  
sudo add-apt-repository ppa:costales/folder-color
+
====Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers====
sudo apt-get update
 
sudo apt-get install folder-color
 
  
==Convert==
+
=====A traves del permiso X=====
===Convinar o unir imágenes===
+
X representa el permiso de ejecución en repertorios y en fichiers qui ont un x quelque part. Esto permite tratar separadamente el permiso de ejecución en directorios y en archivos. Veamos algunos ejemplos:
http://imagemagick.org/Usage/layers/#append
 
  
Horizontal:
+
'''Application 1 :'''
convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png
 
  
Vertical:
+
Soit un répertoire monrep, contenant des sous-répertoires et des fichiers. Les droits sont drwx------ (700) pour les répertoires et -rw------- (600) pour les fichiers.
convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png
 
  
convert  -background none -append .png
+
On veut ajouter récursivement les mêmes droits (resp. rwx et rw) pour le groupe. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
  
==Three ways to hide Files and Directories in Linux==
+
Si on lance chmod -R 770 monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
Archivos ocultos
 
  
http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html
+
Si on lance chmod -R 660 monrep : les répertoires n'auront plus les droits d'exécution → catastrophique :-(
  
# Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
+
Si on lance chmod -R g+rwx monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
# Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
 
# Rename the file and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.
 
  
==Cambiar la ruta del escritorio, Download, Documents, etc - How to set $HOME/Desktop==
+
Si on lance '''chmod -R g+rwX monrep''' : seuls les répertoires (et les fichiers déjà exécutables) auront les droits d'exécution → bon :-)
http://askubuntu.com/questions/116276/how-to-set-the-desktop-to-home-desktop
 
  
Edit the file ~/.config/user-dirs.dirs
 
  
<syntaxhighlight lang="sh">
+
'''Application 2 :'''
# This file is written by xdg-user-dirs-update
 
# If you want to change or add directories, just edit the line you're
 
# interested in. All local changes will be retained on the next run
 
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
 
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
 
# absolute path. No other format is supported.
 
#
 
 
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 
# usados por el sistema
 
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 
# /usr/share/icons/Humanity/places/64/folder-download.svg
 
  
XDG_DESKTOP_DIR="$HOME/1-system/desktop"
+
Imaginons que précédemment on ait lancé la commande chmod -R 770 monrep. La situation est la suivante : les droits sont drwxrwx--- (770) pour les répertoires et -rwxrwx--- (770) pour les fichiers.
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
 
XDG_TEMPLATES_DIR="$HOME/"
 
XDG_PUBLICSHARE_DIR="$HOME/"
 
XDG_DOCUMENTS_DIR="$HOME/"
 
XDG_MUSIC_DIR="$HOME/"
 
XDG_PICTURES_DIR="$HOME/"
 
XDG_VIDEOS_DIR="$HOME/"
 
</syntaxhighlight>
 
  
==Recording scren - Screencast==
+
On désire supprimer les droits d'exécution uniquement sur les fichiers. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
Hacer un video de la pantalla.
 
  
En esta página se muestran varias opciones. Byzanz permite hacer gif:
+
Comme chmod s'applique à la fois aux fichiers et répertoires, nous allons jongler avec x et X. Il faut enlever x puis ajouter X.
https://wiki.ubuntu.com/CreatingScreencasts
 
  
sudo add-apt-repository ppa:fossfreedom/byzanz
+
Si on lance chmod -R u-x+X,g-x+X monrep cela n'aura aucun effet car X concerne à la fois les répertoires ET les fichiers qui ont un x quelque part. Donc si u-x enlève le premier x (ce qui donne -rw-rwx---), la suite +X va aussitôt remettre un x car il reste un x (celui du groupe !).
sudo apt-get update && sudo apt-get install byzanz
 
  
Para hacer un video .avi podemos usar:
+
Donc il faut d'abord enlever tous les x : u-x,g-x avant de les remettre (sera fait uniquement pour les répertoires cette fois) ce qui donne finalement :  
avconv -f alsa -i pulse -f x11grab -r 10 -s 1024x800 -i :0.0 -vcodec wmv1 -acodec pcm_s16le -q 7 b4.avi
 
Si queremos desactivar el audio agregamos la opción: -an
 
  
==Gnome==
+
chmod -R u-x,g-x,u+X,g+X monrep
===How to Move the Unity Desktop’s Launcher===
 
https://www.howtogeek.com/251616/how-to-move-the-unity-desktops-launcher-to-the-bottom-of-your-screen-on-ubuntu-16.04/
 
Para cambiar la posición de la sidebar donde se encuentran los programas en el escritorio por defecto de Ubuntu:
 
  
How to Move the Unity Desktop’s Launcher to the Bottom of Your Screen on Ubuntu 16.04:
+
=====A través del comando find=====
gsettings set com.canonical.Unity.Launcher launcher-position Bottom
+
Como vimos, X permite tratar separadamente el permiso de ejecución en directorios y en archivos. Ahora, si queremos asignar una configuración de derechos a los directorios y otra muy distinta a los archivos, lo podemos hacer a través del comando find de la siguiente forma:
gsettings set com.canonical.Unity.Launcher launcher-position Left
 
  
==Redimensionar imagen - PDF==
+
http://askubuntu.com/questions/58467/chmod-files-only-in-all-subdirectories/58470
[redimensionar / resize | comprimir / compress]
 
  
  sudo apt-get install imagemagick
+
Para los directorios:
 +
  find <directorio> -type d -exec chmod 755 {} +
  
Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:
+
Para los archivos:
  mogrify -resize 50% *.jpg
+
  find <directorio> -type f -exec chmod 664 {} +
  
Si queremos darle un tamaño determinado:
+
===Permisología por defecto===
  mogrify -resize 1024x768 imagen.jpg
+
En Ubuntu, al crear un directorio, la configuración de los permisos por defecto será:
 +
  '''drwxrwxr-x  (775)'''
 +
Me parece mejor la permisología:
 +
<span style="background:DarkKhaki">'''drwxr-xr-x  (755)'''  (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
 +
Grupo y otros podrán acceder (x) a los directorio y ver (r) su contenido (listar todos los archivos que en él se encuentran); pero no podrán realizar cambios en el directorio (w) (no se podrán crear archivos en el directorio).
  
===Comprimir un PDF===
+
Y para los archivos:
Paso 1: Trasformar pdf a ps
+
'''-rw-rw-r--  (664)'''
  pdf2ps Original.pdf Medio.ps
+
Para los archivos podría ser más conveniente de esta forma:
 +
<span style="background:DarkKhaki">'''-rw-r--r--  (644)'''  (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
 +
O incluso así:
 +
  '''-rw-r-----  (640)'''
  
Paso 2: Trasformar ps a pdf
+
====Cambiar la permisologia por defecto====
ps2pdf Medio.ps Salida.pdf
+
Cambiar la permisologia base/por defecto (umask)
  
==Cortar pdf==
+
https://es.wikipedia.org/wiki/Umask
https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files
+
 
 +
umask (abreviatura de user mask, máscara de usuario) es una orden y una función en entornos POSIX que establece los permisos por defecto para los nuevos archivos y directorios creados por el proceso actual.
  
pdfcrop --margins '0 0 0 0' input.pdf output.pdf
+
Los sistemas Unix modernos permiten que las máscaras se especifiquen de dos modos:
 +
* Un permiso por defecto, también llamado máscara simbólica. Por ejemplo, u=rwx,g=rwx,o=
 +
* Un número en octal que controla qué permisos se enmascararán (no se establecerán) para cualquier nuevo archivo, por ejemplo, 007.
  
Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos
+
En ambos casos debe tenerse en cuenta que la mayoría de los sistemas Unix no permiten que nuevos archivos sean creados con permisos de ejecución activados, independientemente de la máscara.
  
  pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf
+
Ejemplo de máscara simbólica:
 +
  $ umask u=rwx,g=rwx,o=
 +
  $ mkdir foo
 +
  $ touch bar
 +
  $ ls -l
 +
  drwxrwx--- 2 dave 512 Sep 1 20:59 foo
 +
  -rw-rw---- 1 dave  0 Sep  1 20:59 bar
  
  
El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:
+
Ejemplos de máscara en octal:
 +
  $ umask 0174
 +
  $ mkdir foo
 +
  $ touch bar
 +
  $ ls -l
 +
  drw-----wx 2 dave 512 Sep  1 20:59 foo
 +
  -rw-----w- 1 dave  0 Sep  1 20:59 bar
  
<syntaxhighlight lang="sh">
+
'''Configurar el valor de umask permanentemente:''' para un usuario en concreto hay que añadir en el fichero ''.bashrc'' el comando '''umask u=rwx,g=rx,o=rx'''. También se puede modificar el valor de umask en el fichero global ''/etc/profile'' para que el cambio sea efectivo para todos los usuarios. http://www.websecurity.es/como-utilizar-umask-establecer-los-permisos-predeterminados
#!/bin/bash
 
  
for i in {1..11}
 
do
 
        pdftk library.pdf cat $i output pag$i.pdf
 
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
 
        echo "$i "
 
done
 
</syntaxhighlight>
 
Este ejemplo se puede probar con este archivo: [[Media:Library.pdf]]
 
  
==La papelera - Trash==
+
Ahora, a través del umask no se pueden ajustar separadamente los permisos de los directorios y de los archivos, debido a que umash afecta tanto a los archivos como a los directorio. No he encontrado una orden que permita hacer distinción entre los permisos bases de los directorios y los de los archivos. Sin embargo, en el siguiente post se propone una forma de hacer esto:
En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash
 
  
===Mover archivos a la papelera desde el terminal===
+
http://stackoverflow.com/questions/12445527/set-different-umask-for-files-and-folders
http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal
 
  
You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:
+
Interesting requirement. Currently (at least in bash), umask is a global setting and you cannot set it based on object type.
sudo apt-get install gvfs-bin
 
  
Move file to trash:
+
One solution that comes to mind would be to set the umask to the file variant and then intercept calls to mkdir (such as with a user-created mkdir script earlier in the path) to do:
  
  gvfs-trash filename
+
  umask 0701 ; /path/to/real/mkdir $1 ; umask 0604
  
See the content of the trash:
+
That way, assuming all your directory creations are done with mkdir, you can ensure they use a different umask setting.
  
gvfs-ls trash://
+
Note that the script should probably be a little more robust such as restoring the previous umask rather than forcing it to 0604, and adding some better error checking and possibly the ability to handle multiple arguments.
  
Empty the trash:
+
But that's all detail, the framework above should be enough to get you started.
  
gvfs-trash --empty
+
==fdisk==
 +
n => Create new Partition (Then create what you need)
  
 +
t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)
  
http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash
+
w => Write the changes to disk and exit
  
As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:
+
===Crear una partición con fdisk===
 +
sudo fdisk /dev/sdb
 +
Welcome to fdisk (util-linux 2.27.1).
 +
Changes will remain in memory only, until you decide to write them.
 +
Be careful before using the write command.
  
* The program would need to understand/handle all of rm's options and act accordingly
+
Command (m for help): n
* It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems
+
Partition type
 +
  p  primary (0 primary, 0 extended, 4 free)
 +
  e  extended (container for logical partitions)
 +
Select (default p): p
 +
Partition number (1-4, default 1): 1
 +
First sector (2048-4028415, default 2048):
 +
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415):
  
<section begin=alias_gvfs-trash />
+
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
<syntaxhighlight lang="bash">
 
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 
alias del=gvfs-trash
 
</syntaxhighlight>
 
<section end=alias_gvfs-trash />
 
  
==Virtual Machines==
+
Command (m for help): w
 +
The partition table has been altered.
 +
Calling ioctl() to re-read partition table.
 +
Syncing disks.
  
===Popular virtual machine applications===
+
==Mostrar barra de progreso al Copiar, mover y borrar archivos==
https://help.ubuntu.com/community/VirtualMachines
+
 
 +
===gcp===
 +
Comando para copiar mostrando una barra de progreso y velocidad.  
  
====Xen====
+
gcp -r origen/archivo /destino
Xen is a popular, open-source virtual machine application that is officially supported by Ubuntu. It provides high performance, but only supports a small number of host and guest operating systems. Ubuntu is supported as both a host and guest operating system, and Xen is available in the universe software channel.
 
  
====VirtualBox====
+
==Hard and symbolic (soft) links==
VirtualBox - Open-source virtual machine from Oracle. Easy to install and use and not to mention very popular.
+
http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link
  
====VMWare====
+
Underneath the file system files are represented by inodes (or is it multiple inodes not sure)
VMware is a non-free virtual machine application, which supports Ubuntu as both a host and guest operating system. Several versions of VMware are available at no cost and can be installed on Ubuntu. One, vmware-player, is available from the multiverse software channel in Ubuntu. VMWare is the virtual machine solution that has been in use the longest and is the most widely used.
 
  
====Qemu====
+
A file in the file system is basically a link to an inode.
Qemu is a processor emulator and virtual machine. Qemu supports Ubuntu as both a host and guest operating system, and is capable of emulating arm, powerpc, sparc and x86 processors. Qemu is available from the universe software channel in Ubuntu as the package qemu.
+
A hard link then just creates another file with a link to the same underlying inode.
  
====Microsoft Virtual PC====
+
When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
Microsoft Virtual PC is a proprietary virtual machine application for Microsoft Windows. It is capable of running Ubuntu as a guest operating system.
 
  
====Parallels====
+
A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.
Parallels - Commercial virtual machine for Macintosh computers.
 
  
==Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu==
+
Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
  
===Install Genymotion Android Emulator in Ubuntu 14.04===
+
Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.
https://www.youtube.com/watch?v=MHmMDEzsJEY
 
  
====Instalar VirtualBox====
 
* Se puede descargar de la página e instalar manualmente:
 
** Descargargamos el archivo en https://www.virtualbox.org/wiki/Linux_Downloads
 
** Ejecutamos:
 
dpkg -i ./virtualbox-4.3...deb
 
  
* O a partir de los repositorios:
+
'''Let's create hard and soft links:'''
sudo apt-get install virtualbox
 
  
====Instalar GenyMotion====
+
Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:
* Crear una cuenta y descargarlo en la página oficial https://www.genymotion.com/
+
  ln blah1 blah1-hard  (hard link not allowed for directory)
* Ejecutamos:
 
  bash genymotion-2.2...bin
 
  
* Luego entramos en el directorio genymotion e iniciamos el programa:
+
  ln -s blah2 blah2-soft
  ./genymotion
 
  
* Agregamos una Virtual device:
+
Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.  
** Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
 
** Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device.  The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
 
  
:: Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.
+
If blah1 is deleted, blah1-hard still holds the contents.
  
====Instalar WhatsApp====
+
If blah2 is deleted, blah2-soft is just a link to a non-existing file.
Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/
 
  
Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse
+
===What's the difference between a hard link and a copy?===
 +
https://bbs.archlinux.org/viewtopic.php?id=53484
  
===Las aplicaciones Android llegan a Chrome vía extensión===
+
Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).
  
==Importar música a un Ipod==
+
Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.
https://help.ubuntu.com/community/PortableDevices/iPod
 
  
For this you can use Rhythmbox, Banshee, Amarok or gtkpod. Banshee and Amarok are full music management applications that work with the iPod (much like iTunes), whereas gtkpod is a simpler application used only to sync with the iPod.
+
No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.
  
==Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu==
+
Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:
https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
+
cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)
  
http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
+
Si se quieren preservar los softlinks debemos entonces usar también la opción -d
 +
  cp -rlpd
  
Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.
+
==tar and zip==
 +
===tar===
 +
De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/
 +
tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos
  
Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.
+
De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)
 +
tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .
  
Luego si intento montar la partición, se produce el siguiente error:
+
===zip===
 +
unzip file.zip -d destination_folder
  
adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
+
==Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep==
  [sudo] password for adelo:
+
  find . -type f -print | xargs grep "palabra"
The disk contains an unclean file system (0, 0).
 
Metadata kept in Windows cache, refused to mount.
 
Failed to mount '/dev/sda2': Operation not permitted
 
The NTFS partition is in an unsafe state. Please resume and shutdown
 
Windows fully (no hibernation or fast restarting), or mount the volume
 
read-only with the 'ro' mount option.
 
  
El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called '''Fast Startup'''
 
  
In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.
+
'''Y para buscar una linea que contenga dos palabras especificas:'''
  
Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
+
find . -type f -print | xargs grep "palabra1" | grep "palabra2"
  
  
'''El problema se puede resuelver haciendo:''' http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
+
'''O también:'''
 +
find . -exec egrep palagra '{}' +
  
sudo ntfsfix /dev/sda2
 
  
Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.
+
'''Otra forma:'''
  
'''Permanent Solution:''' Disable Fast Startup in Windows 8 and Windows 10.
+
egrep -r palabra *
  
Use the following path to disable fast startup:
+
==Alias==
 +
http://www.computerhope.com/unix/ualias.htm
  
Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
+
Aliases are used to customize the shell session interface:
 +
alias ls='ls --color=auto'
  
==Instalación de Ubuntu==
+
alias ll='ls -la'
  
===Creating a bootable USB flash drive===
+
alias .....='cd ../../../../'
  
====Creating a bootable Ubuntu USB flash drive from Ubuntu a través de usb-creator====
+
Éste lo he adicionado a mi .bashrc:
<span style="color:#FFFFFF; background:#483D8B">
+
alias 'la=ls -AX'
'''Me ha generado muchos problemas últimamente. Recomiendo usar el método por terminal a través del comando dd; método que además parece funcionar en otras distribuciones.'''
 
</span>
 
  
https://help.ubuntu.com/community/Installation/FromUSBStick
+
==Para saber las características del hardware y del SO==
  
Startup Disk Creator alias usb-creator viene instalado por defecto. Para iniciarlo desde el terminal:
+
===Caracteristicas del harware (marcas/fabricantes, modelos, etc)===
usb-creator-gtk
+
{{#lst:Mi_computadora|product_name}}
usb-creator-kde
+
====Startup Menu====
 +
Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.
  
Luego:
+
====dmidecode====
# Insert and mount the USB drive.
+
sudo dmidecode | more
# Start usb-creator.
 
  
El sistema de archivos del USB drive debe ser FAT o creo que también EXT. No puede ser ntfs. Si el pendrive está en ntfs u otro filesystem inadecuado, el programa usb-creator dirá que no hay suficiente espacio en el dispositivo. Podemos en este caso utilizar la opción «Erase Disk» que formatea el dispositivo en FAT32. Luego de esto el dispositivo debería de estar disponible y habilitada la opción «Make Startup Disk» que permite iniciar la creación del bootable USB. También podemos formatear el dispositivo en FAT32 antes de iniciar el programa usb-creator. [[Linux#Formatear una unidad Flash USB|Formatear una unidad Flash USB]]
+
Este comando despliega las características detalladas de todos los componentes del hardware:
 +
* System Information,
 +
* BIOS Information,
 +
* Processor Information, etc.
  
Cuando intenté crear el USB bootable en Ubuntu 14.04, el programa daba un error al final del proceso. Decía que no podía instalar el arranque. Luego intenté hacerlo en una versión antigua de Ubuntu que tenía instalada y el programa usb-creator ejecutaba el proceso de creación con éxito; sin embargo cuando intentaba bootear desde el dispositivo USB creado, se detenía el arranque y se mostraba un mensaje que decía:
+
Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):
  
  Missing parameter in configuration file.
+
  sudo dmidecode | grep -A 9 "System Information"
  
Luego encontré en un forum que dicho problema se solucionaba haciendo Tab, escribiendo live y Enter. Esto funcionó perfectamente y Ubuntu inició normalmente desde la memoria USB. http://askubuntu.com/questions/544414/missing-parameter-in-configuration-file-keyword-path
+
También se puede utilizar este comando empleando ciertos String a través de la opción -s:
  
Al parecer también se puede crear a bootable Ubuntu USB flash drive usando: UnetBootin, LiliUSB or Universal USB Installer
+
sudo dmidecode -s String_keyword
https://help.ubuntu.com/community/Boot-Repair
 
  
En la siguiente página se explica como podemos crear el bootable Ubuntu USB flash drive desde la línea de comandos. Sin embargo, no pude crearlo con éxito. Cuando arranqué desde el disco USB que creé, el SO no cargó correctamente.
+
sudo dmidecode -s system-product-name
Cuando intenté crear el bootable USB encontré el siguiente error:
+
sudo dmidecode -s bios-release-date
 +
sudo dmidecode -s baseboard-product-name
 +
sudo dmidecode -s baseboard-manufacturer
  
  cp: no se puede crear el enlace simbólico «/media/adelo/D853-0856/./dists/stable»: Operación no permitida
+
====sysinfo/lshw====
 +
  sudo apt-get install sysinfo
  
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
+
'''Para crear un archivo html con todas las características del hardware:'''
  
====Creating a bootable CentOS-Ubuntu USB flash drive desde el terminal a través de dd====
+
sudo lshw -html > mySpecs.html
  
Creo que la forma de crearlo para/en  Ubuntu o CentOS es la misma. Sin embargo aquí hay dos forums:
+
then check the html file.
  
'''Estos son para CentOS:'''
+
===Desplegar el SO instalado (detallando la versión)===
 +
lsb_release -a
  
Starting with CentOS 6.5, one can install from USB keys by simply transferring the desired ISO using dd https://wiki.centos.org/HowTos/InstallFromUSBkey
+
http://askubuntu.com/questions/55609/how-do-i-check-system-specifications
  
https://wiki.centos.org/HowTos/InstallFromUSBkey
+
===Para saber si el SO instalado es 32 o 64bit===
 +
uname -a
  
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
+
Result for 32-bit Ubuntu:
  
https://www.centos.org/forums/viewtopic.php?t=56578
+
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
  
'''En este se trata el caso de Linux en general:'''
+
whereas the 64-bit Ubuntu will show:
  
http://superuser.com/questions/591234/how-to-create-a-bootable-usb-from-a-bootable-iso-with-the-command-line-on-linux
+
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
  
  
Como se puede ver, parece ser el mismo procedimiento. Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15 desde Ubuntu 15, otro de CentOS 7 desde Ubuntu 15, y ambos funcionaron correctamente.
+
O a través del comando:
  
* Antes de crear el bootable drive es apropiado [[Linux#Formatear una unidad Flash USB|formatear]] el dispositivo en Fat32 (vFat).
+
getconf LONG_BIT
  
* Debemos desmontar el dispositivos antes de ejecutar el comando dd:
+
===Para ver las particiones y dispositivos montados===
 +
Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]]. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):
 +
sudo parted /dev/sda then type print
 +
sudo parted -l
  
umount /dev/sdb*
 
  
* Creación del bootable USB flash a través de dd:
+
Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:
 +
lsblk -fm
  
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
 
  
<div id="Nota_sdb">Nota_sdb</div>Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb  drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.
+
Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):
 +
sudo fdisk -l
  
Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:
 
  
sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
+
A través del comando mount podemos saber el tipo de sistemas de archivos de particiones/dispositivos montados (check filesystem type):
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
+
  mount
└─sdb2 vfat    ANACONDA        C522-73DA
+
Al parecer el tipo fuseblk se refiere a una partición ntfs ver http://ubuntuforums.org/showthread.php?t=1096841
  
====How can I create a Windows bootable USB stick with Ubuntu:====
 
=====winusb=====
 
http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
 
  
http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu
+
Para saber el '''UUID''' de una partición:
 +
sudo blkid
  
Esto lo había realizado con éxito a través del comando '''winusb''' en Ubuntu 14; instalándolo a partir de los repositorios:
 
sudo add-apt-repository ppa:colingille/freshlight
 
sudo apt-get update
 
sudo apt-get install winusb
 
  
Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.
+
Muestra información sólo de particiones/dispositivos montados:
 +
df -h
 +
 
 +
====Tamaños de la partición: Different partition sizes reported by df and parted====
 +
http://ubuntuforums.org/showthread.php?t=1575190
  
En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
+
http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html
  
'''Install WinUSB in Ubuntu 16.04'''
+
===Para saber la memoria RAM y Swap (total y en uso)===
 +
free -m
  
Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.
+
O graficamente en System > Administration > System monitor
  
Before you begin to install WinUSB, run the command given below to install the dependencies:
+
Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/
  
  sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev
+
===Información del procesador del sistema: núcleos, velocidad, fabricante, arquitectura, 32 o 64bit===
 +
  lscpu
  
Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:
+
==Formatear una unidad Flash USB==
 +
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
  
wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
+
===Usando el terminal===
tar zxf winusb-1.0.11.tar.gz
+
Para mostrar los distintos dispositivos y particiones en el sistema:
cd winusb*/src
+
  lsblk -fm
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
 
  sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp
 
  
Now it’s time to compile winusb-1.0.11 bu running the commands given below:
+
Antes de formatear una device debemos desmontarla:
  
  cd ..
+
  umount /dev/sdb*
./configure
 
make
 
sudo make install
 
cd ..
 
rm -rf winusb-1.0.11
 
  
'''Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).'''
+
Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver [[Linux#Nota_sdb|Nota sdb]]
  
'''Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.'''
+
$ sudo mkfs.vfat -I /dev/sdb
  
Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.
+
http://tecadmin.net/format-usb-in-linux/#
  
=====A través de dd=====
+
https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/
Lo intenté hacer desde la línea de comando a través del comando ''dd'' y no resultó.
 
  
=====unetbootin=====
+
$ sudo umount /dev/sdc1
También utilicé otro programa creado para este fin: '''unetbootin''', y no pude crearlo correctamente.
 
  
https://www.youtube.com/watch?v=uivN0yLxir8
+
$ sudo umount /dev/sdb*
  
http://askubuntu.com/questions/707159/how-can-i-create-a-windows-10-boot-usb-from-ubuntu
+
Format with vFat FileSystem
  
===Proceso de instalación===
+
$ sudo mkfs.vfat /dev/sdc1
En el proceso de instalación de Ubuntu 15.10 se propone de una vez la instalación de "Third-party sortwares" (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.
 
  
====Creación y elección de la partición donde será instalado el SO====
+
Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:
Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
 
  
La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.
+
/dev/sdb is entire device, not just one partition.
 +
Refusing to make a filesystem here!
  
Los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas. https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco
+
Por eso tuve que crear una partición en la device antes de formatear --> [[Linux#Crear una partición con fdisk|Crear una partición con fdisk]]
 +
 
 +
$ sudo mkfs.ntfs /dev/sdc1
 +
 
 +
Format with EXT4 FileSystem
  
Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa [[Linux#GParted|GParted]]
+
$ sudo mkfs.ext4 /dev/sdc1
  
Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.
+
===Interfaz gráfica===
 +
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
  
GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.
+
==Screenshot Tool in Ubuntu==
 +
Aplicación para imprimir pantalla
  
Para instalar Linux tenemos que crear por lo menos dos particiones '''(Indispensables)''':
+
===Gnome Screenshot===
 +
https://doc.ubuntu-fr.org/gnome-screenshot
  
'''La partición Swap :''' Puede ser Primaria o Lógica -- [[Linux#Donde colocar la partición Swap|Se puede crear en cualquier posición]] -- Filesystem: Swap -- [[Linux#Que tamaño debe tener la partición swap|Tamaño]] -- [[Linux#Utilidad|Utilidad]].
+
Gnome Screenshot est déjà installé par défaut sur Ubuntu
  
'''La particion root / :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go.
+
Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran.
 +
Ou encore depuis un terminal avec la commande suivante:
  
 +
gnome-screenshot -i
  
En muchos forums se propone también la creación de las siguientes particiones '''(Opcionales)''':
+
À l'aide de raccourcis:
 +
La convinación de tecla normal no me funciona, la siguiente sí:
  
'''/boot :''' [[Linux#Utilidad de la partición boot|Ésta podría ser indispensable]] -- Creo que debe ser primaria -- [[Linux#Utilidad de la partición boot|Se debe crear al inicio del disco]] -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- [[Linux#Utilidad de la partición boot|Utilidad]] -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
+
[ALT]+[FN]+[IMPR] → Capturer la fenêtre active.
  
'''/home :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- [[Linux#Utilidad de la partición home|Utilidad]] -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
+
En la página Web se pueden ver las otras convinaciones de tecla disponibles
 
También he visto que podría ser ventajoso crear particiones para:
 
/tmp
 
/var
 
/usr
 
 
Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.
 
  
En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales
+
===Shutter===
https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
+
https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images
  
====La partición swap====
+
Shutter es un buen programa para imprimir pantallas.
What is swap?
 
  
Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq
+
También permite editar imágenes: crear flechas y etiquetas de una forma fácil.
  
=====Utilidad=====
+
==Programas para realizar respaldos (Backup)==
Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
=====Que tamaño debe tener la partición swap=====
+
===rsync===
How much swap do I need?
+
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
  
For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM
+
http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/
  
For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq
+
'''<span style="background:Thistle">One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file.</span> <span style="background:PaleGoldenrod">De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.</span>'''
  
 +
rsync -azvu --delete --progress Source/ Destination/
  
'''I have 16GB RAM. Do I need 32GB swap?'''
+
Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.
  
It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap
+
rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
  
Here's a very good recommendation from RedHat:
+
: '''-a''', --archive, archive mode; equals '''-rlptgoD''' (no -H,-A,-X). This option does the following:
 +
:: '''-l''', --links copy symlinks as symlinks (Preserves symbolic links)
 +
:: '''-p''', --perms preserve permissions
 +
:: '''-t''', --times preserve modification times (Preserves timestamp)
 +
:: '''-g''', --group preserve group
 +
:: '''-o''', --owner preserve owner (super-user only)
 +
:: '''-D''' same as --devices --specials
 +
::: '''--devices''' preserve device files (super-user only)
 +
::: '''--specials''' preserve special files
 +
::; -r, --recursive (ayuda from man rsync):
 +
::: This tells rsync to copy directories recursively.  See also --dirs (-d).
  
In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following tablehttps://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007
+
::: Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed. This incremental scan only affects our recursion algorithm, and does not change a non-recursive transferIt is also only  possible when both ends of the transfer are at least version 3.0.0.
  
  Amount of RAM in the system  Recommended swap space        Recommended swap space
+
::: Some options  require  rsync  to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and  --delay-updates.   Because  of  this,  the default  delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0  (use  --del  or  --delete-during  to  request  this  improved  deletion  mode explicitly).   See  also  the --delete-delay option that is a better choice than using --delete-after.
                                                              if allowing for hibernation
 
---------------------------  ----------------------------   ---------------------------
 
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
 
2GB to 8GB of RAM            Equal to the amount of RAM    2 times the amount of RAM
 
8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
 
64GB of RAM or more          4GB of swap space              No extra space needed
 
  
=====Donde colocar la partición Swap=====
+
::: Incremental recursion can be disabled using the '''--no-inc-recursive''' option or its shorter --no-i-r alias.
Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final.
 
It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).
 
  
====Utilidad de la partición boot====
+
: '''-z''' is to enable compression
Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des [http://forum.ubuntu-fr.org/viewtopic.php?pid=13576521#p13576521 problèmes], aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
====Utilidad de la partición home====
+
: '''-v''' verbose
Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter [https://doc.ubuntu-fr.org/tutoriel/deplacer_home#public ce comparatif] pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.
+
: '''-u :''' Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
  
http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/
+
: '''--delete''' it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
  
====Partición para los datos====
+
: '''--progress :''' View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.
 
  
Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.
+
: '''--exclude''' is to exclude files or directories while doing synchronization. Ver [http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/ 6 rsync Examples to Exclude Multiple Files and Directories]
  
====Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?====
+
:'''--delete-after :''' No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
  
=====chmod y chown en particiones ntfs=====
+
:; -H, --hard-links (ayuda from man rsync):
Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:
+
:: This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
  
* https://forum.ubuntu-fr.org/viewtopic.php?id=370751
+
:: This  option does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source. Cases in which the destination may end up with extra hard links include the following:
: Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
 
  
* http://ubuntuforums.org/showthread.php?t=1446788
+
::* If the destination contains extraneous hard-links (more linking than what is  present  in  the  source  file list), the copying algorithm will not break them explicitly. However, if one or more of the paths have content differences, the normal file-update process will break those extra links  (unless  you  are  using  the --inplace option).
  
 +
::* If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due  to  the --link-dest associations.
  
Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.
+
:: Note that rsync can only detect hard links between files that are inside the transfer set.  If rsync updates a file that has extra hard-link connections to files outside the transfer, that  linkage  will  be  broken.  If  you  are tempted  to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes  happen  due  to  lingering  hard  links  (and  see  the --inplace option for more caveats).
  
En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:
+
:: If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy.  This does not affect the  accuracy  of  the transfer  (i.e. which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member  of  the  hard-linked set of files).  One way to avoid this inefficiency is to disable incremental recursion using the '''--no-inc-recursive''' option.
* http://askubuntu.com/questions/342791/file-permissions-wont-change/343154#343154
 
* http://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/91054#91054
 
  
Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:
+
:; --partial (ayuda from man rsync):
 +
:: By default, rsync will delete any partially transferred file if the transfer is interrupted. In some  circumstances it  is  more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
  
Para particiones internas:
+
::; --partial-dir=DIR
<pre>
+
::: A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial  data  (instead of writing it out to the destination file). On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
# <file system>          <mount point>                <type>    <options>                          <dump> <pass>
 
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions        0      0
 
</pre>
 
  
=====Can't be put in the trash. Do you want to delete it immediately?=====
+
::: Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file  that  is  being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error. Cuando quería borrar un archivo desde directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus), el archivo no podíaser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba.
 
  
El problema que estoy teniendo es exáctamente el descrito en este Forum:
+
::: Rsync  will create the DIR if it is missing (just the last dir -- not the whole path).  This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in  the  destination file’s directory when needed, and then remove it again when the partial file is deleted.
  
Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder
+
::: If  the  partial-dir  value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes.  This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent  the  untimely  deletion  of  partial-dir items on the receiving side.  An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
  
http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti
+
::: If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule  for  the  partial-dir  because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice. For instance, if you want to make rsync clean-up any left-over partial-dirs  that may  be lying around, you should specify --delete-after and add a "risk" filter rule, e.g.  -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
  
Since a few days, I cannot send files to trash anymore from some folders.
+
::: IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk.  E.g. AVOID "/tmp".
  
That worked perfectly for years :(
+
::: You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable.  Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial  is  specified. For  instance,  instead  of  using  --partial-dir=.rsync-tmp  along  with  --progress,  you  could  set  RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of  the  .rsync-tmp  dirfor  partial  transfers.  The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
  
In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:
+
::: For  the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial.  This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a  partial transfer, while still allowing the safer idiom provided by --partial-dir.
  
Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/
+
: '''-P :''' same as --partial --progress.
  
Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.
+
: '''--no-inc-recursive :''' Ver comentarios en las opciones '''-r''' y '''-H'''.
  
  
 +
Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el...
 +
Al parecer, la solución a este problema se encuentra explicada aquí:
 +
https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/
  
Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~
+
http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
  
https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781
+
http://javier.io/blog/en/2014/08/06/rsync-rename-move.html
  
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112
+
* Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.
  
=====Para discos externos=====
+
====Mis sincronizaciones====
http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
+
rsync -azvu --delete-after --progress /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos-dde/
  
https://wiki.archlinux.org/index.php/Fstab#External_devices
+
rsync -azvu --delete --progress --exclude '/home/adelo/toshiba_ext/1-mis_archivos/stockage' /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos/
  
En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), si no se usa <nofail>, el sistema buscará la partición, al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.
+
=== ===
 +
http://askubuntu.com/questions/2596/comparison-of-backup-tools
  
The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
+
http://www.thegeekstuff.com/2012/05/backup-ubuntu-desktop/
  
En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.
+
deja-dup
  
<pre>
+
==Nautilus==
UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext      ntfs      auto,nofail,users,exec,permissions 0      0
 
</pre>
 
  
Para saber el '''UUID''' de la partición: sudo blkid
+
===Cambiar el icono de una carpeta===
 +
https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/
  
'''auto:''' will automatically mount the partition when you boot.
+
===Folder color: cambia el color de todas tus carpetas en Ubuntu===
 +
https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/
  
'''users:''' allows users to mount and umount.
+
Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.
  
'''exec:''' permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition
+
sudo add-apt-repository ppa:costales/folder-color
 +
sudo apt-get update
 +
sudo apt-get install folder-color
  
'''nofail:''' external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices
+
==Convert==
 +
===Convinar o unir imágenes===
 +
http://imagemagick.org/Usage/layers/#append
  
'''permissions:''' es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.
+
Horizontal:
 +
convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png
  
'''dump''' est utilisé pour les sauvegardes. (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
+
Vertical:
 +
convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png
  
'''pass''' pour l'ordre de vérification au démarrage: (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
+
convert  -background none -append .png
* 1 pour la racine
 
* 2 pour les autres partitions Linux
 
* 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).
 
  
Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
+
==Three ways to hide Files and Directories in Linux==
 +
Archivos ocultos
  
No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.
+
http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html
  
Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:
+
# Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
 +
# Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
 +
# Rename the file and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.
  
chown -R adelo:adelo /home/adelo/1-mis_archivos
+
==Cambiar la ruta del escritorio, Download, Documents, etc - How to set $HOME/Desktop==
 +
http://askubuntu.com/questions/116276/how-to-set-the-desktop-to-home-desktop
  
Para modificar los permisos de todos los archivos en la partición ver [[Linux#A través del comando find|aquí]]
+
Edit the file ~/.config/user-dirs.dirs
  
 +
<syntaxhighlight lang="sh">
 +
# This file is written by xdg-user-dirs-update
 +
# If you want to change or add directories, just edit the line you're
 +
# interested in. All local changes will be retained on the next run
 +
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
 +
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
 +
# absolute path. No other format is supported.
 +
#
 +
 +
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 +
# usados por el sistema
 +
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 +
# /usr/share/icons/Humanity/places/64/folder-download.svg
  
En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:
+
XDG_DESKTOP_DIR="$HOME/1-system/desktop"
* http://www.lunaticgeek.com/2011/08/como-conseguir-permisos-en-particiones.html
+
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
 +
XDG_TEMPLATES_DIR="$HOME/"
 +
XDG_PUBLICSHARE_DIR="$HOME/"
 +
XDG_DOCUMENTS_DIR="$HOME/"
 +
XDG_MUSIC_DIR="$HOME/"
 +
XDG_PICTURES_DIR="$HOME/"
 +
XDG_VIDEOS_DIR="$HOME/"
 +
</syntaxhighlight>
  
====Esquemas de particionamiento====
+
==Recording scren - Screencast==
Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.
+
Hacer un video de la pantalla.
  
Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
+
En esta página se muestran varias opciones. Byzanz permite hacer gif:
 +
https://wiki.ubuntu.com/CreatingScreencasts
  
'''En mi disco de 300G'''
+
sudo add-apt-repository ppa:fossfreedom/byzanz
 +
sudo apt-get update && sudo apt-get install byzanz
  
'''Opción 1:'''
+
Para hacer un video .avi podemos usar:
* Partición extendida de 200G al inicio del disco
+
avconv -f alsa -i pulse -f x11grab -r 10 -s 1024x800 -i :0.0 -vcodec wmv1 -acodec pcm_s16le -q 7 b4.avi
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
+
Si queremos desactivar el audio agregamos la opción: -an
** Particion Lógica ext4 de 196G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 
* Partición Primaria de 100G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
 
  
De Manera que me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.
+
==Gnome==
 +
===How to Move the Unity Desktop’s Launcher===
 +
https://www.howtogeek.com/251616/how-to-move-the-unity-desktops-launcher-to-the-bottom-of-your-screen-on-ubuntu-16.04/
 +
Para cambiar la posición de la sidebar donde se encuentran los programas en el escritorio por defecto de Ubuntu:
  
 +
How to Move the Unity Desktop’s Launcher to the Bottom of Your Screen on Ubuntu 16.04:
 +
gsettings set com.canonical.Unity.Launcher launcher-position Bottom
 +
gsettings set com.canonical.Unity.Launcher launcher-position Left
  
'''Opción 2:'''
+
==Redimensionar imagen - PDF==
* Partición extendida de 60G al inicio del disco
+
[redimensionar / resize | comprimir / compress]
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
 
** Particion Lógica ext4 de 56G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 
* Partición Primaria ntfs de 200G al inicio del espacio restante. Esta será la partición de almacenamiento de todos mis archivos.
 
* Partición Primaria de 40G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
 
  
En este esquema de particiones, todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados. Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos. Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.
+
sudo apt-get install imagemagick
  
<span style="color:#FFFFFF; background:#483D8B">
+
Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:
'''Nota: Me parece que la próxima vez debería dejar más espacio a la partición de Linux, porque en la distribución que voy a usar día a día debe estar en una partición de al menos 30G; por tanto, no me quedaría mucho espacio para instalar todas las distribuciones de Linux que necesito probar: Debian, RedHad, Centos, etc. Creo que cada distribución de prueba debe estar en una partición de al menos 10G.'''
+
mogrify -resize 50% *.jpg
</span>
 
  
==Mis configuraciones==
+
Si queremos darle un tamaño determinado:
===Directorios===
+
  mogrify -resize 1024x768 imagen.jpg
He creado el directorio:
 
  '''~/1-disco_local/.1-conf''' : donde pienso guardar todos mis archivos relacionados con configuraciones o archivos ocultos.
 
  
He creado los directorios:
+
===Comprimir un PDF===
'''~/1-disco_local/.archivos_programas''' : donde pienso guardar algunos archivos de programas. Más que todo archivos que quiera guardar aún después de la desinstalación de un programa. Ej: eclipse-workspace.
+
Paso 1: Trasformar pdf a ps
  '''~/1-disco_local/.archivos_programas/windows''' :
+
  pdf2ps Original.pdf Medio.ps
  
  '''~/.archivos_programas-ubuntu''' : donde pienso guardar los archivos de programas que demandan la creación de un directorio en ~ durante el proceso de instalación.
+
Paso 2: Trasformar ps a pdf
 +
  ps2pdf Medio.ps Salida.pdf
  
===Permisologia de archivos y directorios===
+
==Cortar pdf==
 +
https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files
  
====Ajustar la permisologia de todos los archivos y directorios====
+
pdfcrop --margins '0 0 0 0' input.pdf output.pdf
  
Ver:
+
Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos
  
[[Linux#Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers]]
+
pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf
  
[[Linux#A través del comando find]]
 
  
Ejecutar los siguientes comandos (3-cloud y 4-windows '''NO''' deben estar montados).
+
El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:
  
Para los directorios:
+
<syntaxhighlight lang="sh">
find 1-system -type d -exec chmod 755 {} +
+
#!/bin/bash
 +
 
 +
for i in {1..11}
 +
do
 +
        pdftk library.pdf cat $i output pag$i.pdf
 +
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
 +
        echo "$i "
 +
done
 +
</syntaxhighlight>
 +
Este ejemplo se puede probar con este archivo: [[Media:Library.pdf]]
  
Para los archivos:
+
==La papelera - Trash==
find 1-system -type f -exec chmod 664 {} +
+
En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash
  
====Ajustar la permisologia por defecto al crear un archivo o directorio====
+
===Mover archivos a la papelera desde el terminal===
Ver [[Linux#Permisología por defecto]]
+
http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal
  
Añadir la siguiente línea a .bashrc
+
You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:
 +
sudo apt-get install gvfs-bin
  
umask u=rwx,g=rx,o=rx
+
Move file to trash:
  
para que los directorios y archivos sean creados con permisología:
+
  gvfs-trash filename
  drwxr-xr-x  (755)
 
-rw-r--r--  (644)
 
  
===fstab===
+
See the content of the trash:
/etc/fstab
 
<syntaxhighlight lang="bash">
 
#===========================
 
# Cambios realizados por mi
 
#===========================
 
# Disco_local:
 
UUID=0B8D61386C315368 /home/adelo/1-system/1-disco_local ntfs auto,users,exec,permissions 0 0
 
  
# Disco externo - TOSHIBA EXT:
+
gvfs-ls trash://
UUID=3C9A5D379A5CEF40 /home/adelo/1-system/2-disco_ext ntfs auto,nofail,users,permissions 0 0
 
</syntaxhighlight>
 
  
===.bashrc (home)===
+
Empty the trash:
/home/adelo/.bashrc
 
  
<syntaxhighlight lang="bash">
+
gvfs-trash --empty
#===========================
 
# Cambios realizados por mi
 
#===========================
 
  
# Para la instalación del Seismic Unix:
 
export CWPROOT=/home/adelo/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-geofisica-procesamiento-modelado_sismico/seismic_unix/instalacion_seismic_unix
 
  
 +
http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash
  
PATH=$PATH:$CWPROOT/bin
+
As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:
export PATH
 
  
 +
* The program would need to understand/handle all of rm's options and act accordingly
 +
* It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems
  
# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
+
<section begin=alias_gvfs-trash />
PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/eclipse/java-photon/eclipse:
+
<syntaxhighlight lang="bash">
 +
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 +
alias del=gvfs-trash
 +
</syntaxhighlight>
 +
<section end=alias_gvfs-trash />
  
# Después de la instalación de NetBeans, para adicionar el ejecutable a la lista de comandos:
+
==Virtual Machines==
# PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin:
 
# Otra forma de hacerlo es a trav'es de un soft link (claro que es necesario colocarlo en el .bashrc):
 
# ln -s /home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin/netbeans /usr/local/bin/netbeans8.2
 
  
 +
===Popular virtual machine applications===
 +
https://help.ubuntu.com/community/VirtualMachines
  
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
+
====Xen====
umask u=rwx,g=rx,o=rx
+
Xen is a popular, open-source virtual machine application that is officially supported by Ubuntu. It provides high performance, but only supports a small number of host and guest operating systems. Ubuntu is supported as both a host and guest operating system, and Xen is available in the universe software channel.
  
 +
====VirtualBox====
 +
VirtualBox - Open-source virtual machine from Oracle. Easy to install and use and not to mention very popular.
  
# -X : sort alphabetically by entry extension
+
====VMWare====
# -A : do not list implied . and ..
+
VMware is a non-free virtual machine application, which supports Ubuntu as both a host and guest operating system. Several versions of VMware are available at no cost and can be installed on Ubuntu. One, vmware-player, is available from the multiverse software channel in Ubuntu. VMWare is the virtual machine solution that has been in use the longest and is the most widely used.
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 
alias la='ls -AX'
 
  
 +
====Qemu====
 +
Qemu is a processor emulator and virtual machine. Qemu supports Ubuntu as both a host and guest operating system, and is capable of emulating arm, powerpc, sparc and x86 processors. Qemu is available from the universe software channel in Ubuntu as the package qemu.
  
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
+
====Microsoft Virtual PC====
alias ls='ls -v --color=auto'
+
Microsoft Virtual PC is a proprietary virtual machine application for Microsoft Windows. It is capable of running Ubuntu as a guest operating system.
  
 +
====Parallels====
 +
Parallels - Commercial virtual machine for Macintosh computers.
  
# He creado los comandos cdd y cdp para facilitar el acceso a 1-system y 1-pe:
+
==Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu==
function cds() {
 
  cd ~/1-system
 
}
 
cds
 
  
function cdp() {
+
===Install Genymotion Android Emulator in Ubuntu 14.04===
  cd ~/1-system/1-disco_local/1-mis_archivos/1-pe
+
https://www.youtube.com/watch?v=MHmMDEzsJEY
}
 
  
 +
====Instalar VirtualBox====
 +
* Se puede descargar de la página e instalar manualmente:
 +
** Descargargamos el archivo en https://www.virtualbox.org/wiki/Linux_Downloads
 +
** Ejecutamos:
 +
dpkg -i ./virtualbox-4.3...deb
  
# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
+
* O a partir de los repositorios:
# La siguiente función is to rename terminal tab title in gnome-terminal:
+
sudo apt-get install virtualbox
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
 
# # set-title my new tab title
 
function set-title() {
 
  if [[ -z "$ORIG" ]]; then
 
    ORIG=$PS1
 
  fi
 
  TITLE="\[\e]2;$*\a\]"
 
  PS1=${ORIG}${TITLE}
 
}
 
  
 +
====Instalar GenyMotion====
 +
* Crear una cuenta y descargarlo en la página oficial https://www.genymotion.com/
 +
* Ejecutamos:
 +
bash genymotion-2.2...bin
  
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
+
* Luego entramos en el directorio genymotion e iniciamos el programa:
alias del=gvfs-trash
+
./genymotion
 
 
  
# added by Anaconda3 installer
+
* Agregamos una Virtual device:
export PATH="/home/adelo/.anaconda3/bin:$PATH"
+
** Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
</syntaxhighlight>
+
** Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device.  The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
  
Ver [[Linux#Mover archivos a la papelera desde el terminal|Mover archivos a la papelera desde el terminal]] para más detalles del por qué se ha realizado la siguiente configuración: alias del=gvfs-trash
+
:: Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.
  
 +
====Instalar WhatsApp====
 +
Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/
  
===.bashrc (root)===
+
Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse
/root/.bashrc
 
  
<syntaxhighlight lang="bash">
+
===Las aplicaciones Android llegan a Chrome vía extensión===
#===========================
 
# Cambios realizados por mi
 
#===========================
 
  
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
+
==Importar música a un Ipod==
umask u=rwx,g=rx,o=rx
+
https://help.ubuntu.com/community/PortableDevices/iPod
  
 +
For this you can use Rhythmbox, Banshee, Amarok or gtkpod. Banshee and Amarok are full music management applications that work with the iPod (much like iTunes), whereas gtkpod is a simpler application used only to sync with the iPod.
  
# -X : sort alphabetically by entry extension
+
==Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu==
# -A : do not list implied . and ..
+
https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 
alias la='ls -AX'
 
  
 +
http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
  
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
+
Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.
alias ls='ls -v --color=auto'
 
  
 +
Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.
  
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
+
Luego si intento montar la partición, se produce el siguiente error:
alias del=gvfs-trash
 
  
 +
adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
 +
[sudo] password for adelo:
 +
The disk contains an unclean file system (0, 0).
 +
Metadata kept in Windows cache, refused to mount.
 +
Failed to mount '/dev/sda2': Operation not permitted
 +
The NTFS partition is in an unsafe state. Please resume and shutdown
 +
Windows fully (no hibernation or fast restarting), or mount the volume
 +
read-only with the 'ro' mount option.
  
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
+
El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called '''Fast Startup'''
umask u=rwx,g=rx,o=rx
 
</syntaxhighlight>
 
  
 +
In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.
  
/etc/bash.bashrc
+
Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
<syntaxhighlight lang="bash">
 
#===========================
 
# Cambios realizados por mi
 
#===========================
 
  
# -X : sort alphabetically by entry extension
 
# -A : do not list implied . and ..
 
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 
alias 'la=ls -AX'
 
</syntaxhighlight>
 
  
===user-dirs.dirs===
+
'''El problema se puede resuelver haciendo:''' http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
/home/adelo/.config/user-dirs.dirs
 
  
<syntaxhighlight lang="bash">
+
sudo ntfsfix /dev/sda2
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 
# usados por el sistema
 
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 
# /usr/share/icons/Humanity/places/64/folder-download.svg
 
  
XDG_DESKTOP_DIR="$HOME/1-system/desktop"
+
Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
 
XDG_TEMPLATES_DIR="$HOME/"
 
XDG_PUBLICSHARE_DIR="$HOME/"
 
XDG_DOCUMENTS_DIR="$HOME/"
 
XDG_MUSIC_DIR="$HOME/"
 
XDG_PICTURES_DIR="$HOME/"
 
XDG_VIDEOS_DIR="$HOME/"
 
</syntaxhighlight>
 
  
 +
'''Permanent Solution:''' Disable Fast Startup in Windows 8 and Windows 10.
  
'''Luego creé los siguientes soft links:'''
+
Use the following path to disable fast startup:
ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/desktop-dis/    /home/adelo/1-system/desktop
 
ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/downloads-dis/  /home/adelo/1-system/desktop/downloads
 
  
'''Luego cabié las imágenes de los íconos:'''
+
Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
/usr/share/icons/Humanity/places/128/user-desktop.svg
 
/usr/share/icons/Humanity/places/64/folder-download.svg
 

Revision as of 17:17, 1 September 2018

Contents

1 Instalación de Ubuntu

1.1 Creating a bootable USB flash drive

1.1.1 Creating a bootable Ubuntu USB flash drive from Ubuntu a través de usb-creator

Me ha generado muchos problemas últimamente. Recomiendo usar el método por terminal a través del comando dd; método que además parece funcionar en otras distribuciones.

https://help.ubuntu.com/community/Installation/FromUSBStick

Startup Disk Creator alias usb-creator viene instalado por defecto. Para iniciarlo desde el terminal:

usb-creator-gtk
usb-creator-kde

Luego:

  1. Insert and mount the USB drive.
  2. Start usb-creator.

El sistema de archivos del USB drive debe ser FAT o creo que también EXT. No puede ser ntfs. Si el pendrive está en ntfs u otro filesystem inadecuado, el programa usb-creator dirá que no hay suficiente espacio en el dispositivo. Podemos en este caso utilizar la opción «Erase Disk» que formatea el dispositivo en FAT32. Luego de esto el dispositivo debería de estar disponible y habilitada la opción «Make Startup Disk» que permite iniciar la creación del bootable USB. También podemos formatear el dispositivo en FAT32 antes de iniciar el programa usb-creator. Formatear una unidad Flash USB

Cuando intenté crear el USB bootable en Ubuntu 14.04, el programa daba un error al final del proceso. Decía que no podía instalar el arranque. Luego intenté hacerlo en una versión antigua de Ubuntu que tenía instalada y el programa usb-creator ejecutaba el proceso de creación con éxito; sin embargo cuando intentaba bootear desde el dispositivo USB creado, se detenía el arranque y se mostraba un mensaje que decía:

Missing parameter in configuration file.

Luego encontré en un forum que dicho problema se solucionaba haciendo Tab, escribiendo live y Enter. Esto funcionó perfectamente y Ubuntu inició normalmente desde la memoria USB. http://askubuntu.com/questions/544414/missing-parameter-in-configuration-file-keyword-path

Al parecer también se puede crear a bootable Ubuntu USB flash drive usando: UnetBootin, LiliUSB or Universal USB Installer https://help.ubuntu.com/community/Boot-Repair

En la siguiente página se explica como podemos crear el bootable Ubuntu USB flash drive desde la línea de comandos. Sin embargo, no pude crearlo con éxito. Cuando arranqué desde el disco USB que creé, el SO no cargó correctamente. Cuando intenté crear el bootable USB encontré el siguiente error:

cp: no se puede crear el enlace simbólico «/media/adelo/D853-0856/./dists/stable»: Operación no permitida

http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal

1.1.2 Creating a bootable CentOS-Ubuntu USB flash drive desde el terminal a través de dd

Creo que la forma de crearlo para/en Ubuntu o CentOS es la misma. Sin embargo aquí hay dos forums:

Estos son para CentOS:

Starting with CentOS 6.5, one can install from USB keys by simply transferring the desired ISO using dd https://wiki.centos.org/HowTos/InstallFromUSBkey

https://wiki.centos.org/HowTos/InstallFromUSBkey

http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal

https://www.centos.org/forums/viewtopic.php?t=56578

En este se trata el caso de Linux en general:

http://superuser.com/questions/591234/how-to-create-a-bootable-usb-from-a-bootable-iso-with-the-command-line-on-linux


Como se puede ver, parece ser el mismo procedimiento. Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15 desde Ubuntu 15, otro de CentOS 7 desde Ubuntu 15, y ambos funcionaron correctamente.

  • Antes de crear el bootable drive es apropiado formatear el dispositivo en Fat32 (vFat).
  • Debemos desmontar el dispositivos antes de ejecutar el comando dd:
umount /dev/sdb*
  • Creación del bootable USB flash a través de dd:
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
Nota_sdb

Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.

Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:

sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
└─sdb2 vfat    ANACONDA        C522-73DA

1.1.3 How can I create a Windows bootable USB stick with Ubuntu:

1.1.3.1 winusb

http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/

http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu

Esto lo había realizado con éxito a través del comando winusb en Ubuntu 14; instalándolo a partir de los repositorios:

sudo add-apt-repository ppa:colingille/freshlight
sudo apt-get update
sudo apt-get install winusb

Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.

En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/

Install WinUSB in Ubuntu 16.04

Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.

Before you begin to install WinUSB, run the command given below to install the dependencies:

sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev

Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:

wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
tar zxf winusb-1.0.11.tar.gz
cd winusb*/src
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp

Now it’s time to compile winusb-1.0.11 bu running the commands given below:

cd ..
./configure
make
sudo make install
cd ..
rm -rf winusb-1.0.11

Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).

Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.

Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.

1.1.3.2 A través de dd

Lo intenté hacer desde la línea de comando a través del comando dd y no resultó.

1.1.3.3 unetbootin

También utilicé otro programa creado para este fin: unetbootin, y no pude crearlo correctamente.

https://www.youtube.com/watch?v=uivN0yLxir8

http://askubuntu.com/questions/707159/how-can-i-create-a-windows-10-boot-usb-from-ubuntu

1.2 Proceso de instalación

En el proceso de instalación de Ubuntu 15.10 se propone de una vez la instalación de "Third-party sortwares" (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.

1.2.1 Creación y elección de la partición donde será instalado el SO

Ver nota sobre el Tamaño de la partición.

La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.

Los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas. https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco

Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa GParted

Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.

GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.

Para instalar Linux tenemos que crear por lo menos dos particiones (Indispensables):

La partición Swap : Puede ser Primaria o Lógica -- Se puede crear en cualquier posición -- Filesystem: Swap -- Tamaño -- Utilidad.
La particion root / : Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go. 


En muchos forums se propone también la creación de las siguientes particiones (Opcionales):

/boot : Ésta podría ser indispensable -- Creo que debe ser primaria -- Se debe crear al inicio del disco -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- Utilidad -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
/home : Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- Utilidad -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

También he visto que podría ser ventajoso crear particiones para:

/tmp 
/var
/usr

Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.

En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

1.2.2 La partición swap

What is swap?

Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq

1.2.2.1 Utilidad

Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

1.2.2.2 Que tamaño debe tener la partición swap

How much swap do I need?

For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM

For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq


I have 16GB RAM. Do I need 32GB swap?

It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap

Here's a very good recommendation from RedHat:

In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following table. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007

Amount of RAM in the system   Recommended swap space         Recommended swap space 
                                                             if allowing for hibernation
---------------------------   ----------------------------   ---------------------------
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
2GB to 8GB of RAM             Equal to the amount of RAM     2 times the amount of RAM
8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
64GB of RAM or more           4GB of swap space              No extra space needed
1.2.2.3 Donde colocar la partición Swap

Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final. It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).

1.2.3 Utilidad de la partición boot

Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des problèmes, aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

1.2.4 Utilidad de la partición home

Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter ce comparatif pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.

http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/

1.2.5 Partición para los datos

Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.

Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.

1.2.6 Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?

1.2.6.1 chmod y chown en particiones ntfs

Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:

Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation mount_fstab


Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.

En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:

Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:

Para particiones internas:

# <file system>          <mount point>                 <type>    <options>                           <dump>  <pass>
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions         0       0
1.2.6.2 Can't be put in the trash. Do you want to delete it immediately?

Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error. Cuando quería borrar un archivo desde directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus), el archivo no podíaser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba.

El problema que estoy teniendo es exáctamente el descrito en este Forum:

Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder

http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti

Since a few days, I cannot send files to trash anymore from some folders.

That worked perfectly for years :(

In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:

Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/

Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.


Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~

https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112

1.2.6.3 Para discos externos

http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in

https://wiki.archlinux.org/index.php/Fstab#External_devices

En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), si no se usa <nofail>, el sistema buscará la partición, al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.

The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in

En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.

UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext       ntfs      auto,nofail,users,exec,permissions	0       0

Para saber el UUID de la partición: sudo blkid

auto: will automatically mount the partition when you boot.

users: allows users to mount and umount.

exec: permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition

nofail: external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices

permissions: es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.

dump est utilisé pour les sauvegardes. (Ver mount_fstab)

pass pour l'ordre de vérification au démarrage: (Ver mount_fstab)

  • 1 pour la racine
  • 2 pour les autres partitions Linux
  • 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).

Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en mount_fstab

No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.

Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:

chown -R adelo:adelo /home/adelo/1-mis_archivos

Para modificar los permisos de todos los archivos en la partición ver aquí


En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:

1.2.7 Esquemas de particionamiento

Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.

Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el Tamaño de la partición.

En mi disco de 300G

Opción 1:

  • Partición extendida de 200G al inicio del disco
    • Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
    • Particion Lógica ext4 de 196G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
  • Partición Primaria de 100G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.

De Manera que me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.


Opción 2:

  • Partición extendida de 60G al inicio del disco
    • Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
    • Particion Lógica ext4 de 56G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
  • Partición Primaria ntfs de 200G al inicio del espacio restante. Esta será la partición de almacenamiento de todos mis archivos.
  • Partición Primaria de 40G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.

En este esquema de particiones, todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados. Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos. Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.

Nota: Me parece que la próxima vez debería dejar más espacio a la partición de Linux, porque en la distribución que voy a usar día a día debe estar en una partición de al menos 30G; por tanto, no me quedaría mucho espacio para instalar todas las distribuciones de Linux que necesito probar: Debian, RedHad, Centos, etc. Creo que cada distribución de prueba debe estar en una partición de al menos 10G.

2 Mis configuraciones

2.1 Directorios

He creado el directorio:

~/1-disco_local/.1-conf : donde pienso guardar todos mis archivos relacionados con configuraciones o archivos ocultos.

He creado los directorios:

~/1-disco_local/.archivos_programas : donde pienso guardar algunos archivos de programas. Más que todo archivos que quiera guardar aún después de la desinstalación de un programa. Ej: eclipse-workspace.
~/1-disco_local/.archivos_programas/windows :
~/.archivos_programas-ubuntu : donde pienso guardar los archivos de programas que demandan la creación de un directorio en ~ durante el proceso de instalación.

2.2 Permisologia de archivos y directorios

2.2.1 Ajustar la permisologia de todos los archivos y directorios

Ver:

Linux#Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers

Linux#A través del comando find

Ejecutar los siguientes comandos (3-cloud y 4-windows NO deben estar montados).

Para los directorios:

find 1-system -type d -exec chmod 755 {} +

Para los archivos:

find 1-system -type f -exec chmod 664 {} +

2.2.2 Ajustar la permisologia por defecto al crear un archivo o directorio

Ver Linux#Permisología por defecto

Añadir la siguiente línea a .bashrc

umask u=rwx,g=rx,o=rx

para que los directorios y archivos sean creados con permisología:

drwxr-xr-x  (755)
-rw-r--r--  (644)

2.3 fstab

/etc/fstab
#===========================
# Cambios realizados por mi
#===========================
# Disco_local:
UUID=0B8D61386C315368			/home/adelo/1-system/1-disco_local	ntfs	auto,users,exec,permissions	0	0

# Disco externo - TOSHIBA EXT:
UUID=3C9A5D379A5CEF40			/home/adelo/1-system/2-disco_ext	ntfs	auto,nofail,users,permissions	0	0

2.4 .bashrc (home)

/home/adelo/.bashrc
#===========================
# Cambios realizados por mi
#===========================

# Para la instalación del Seismic Unix:
export CWPROOT=/home/adelo/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-geofisica-procesamiento-modelado_sismico/seismic_unix/instalacion_seismic_unix


PATH=$PATH:$CWPROOT/bin
export PATH


# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/eclipse/java-photon/eclipse:

# Después de la instalación de NetBeans, para adicionar el ejecutable a la lista de comandos:
# PATH=$PATH:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin:
# Otra forma de hacerlo es a trav'es de un soft link (claro que es necesario colocarlo en el .bashrc):
# ln -s /home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/netbeans/netbeans-8.2/bin/netbeans /usr/local/bin/netbeans8.2


# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
umask u=rwx,g=rx,o=rx


# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias la='ls -AX'


# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
alias ls='ls -v --color=auto'


# He creado los comandos cdd y cdp para facilitar el acceso a 1-system y 1-pe:
function cds() {
  cd ~/1-system
}
cds

function cdp() {
  cd ~/1-system/1-disco_local/1-mis_archivos/1-pe
}


# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
# La siguiente función is to rename terminal tab title in gnome-terminal:
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
# # set-title my new tab title
function set-title() {
  if [[ -z "$ORIG" ]]; then
    ORIG=$PS1
  fi
  TITLE="\[\e]2;$*\a\]"
  PS1=${ORIG}${TITLE}
}


# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del=gvfs-trash


# added by Anaconda3 installer
export PATH="/home/adelo/.anaconda3/bin:$PATH"

Ver Mover archivos a la papelera desde el terminal para más detalles del por qué se ha realizado la siguiente configuración: alias del=gvfs-trash


2.5 .bashrc (root)

/root/.bashrc
#===========================
# Cambios realizados por mi
#===========================

# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
umask u=rwx,g=rx,o=rx


# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias la='ls -AX'


# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
alias ls='ls -v --color=auto'


# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del=gvfs-trash


# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
umask u=rwx,g=rx,o=rx


/etc/bash.bashrc
#===========================
# Cambios realizados por mi
#===========================

# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias 'la=ls -AX'

2.6 user-dirs.dirs

/home/adelo/.config/user-dirs.dirs
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
# usados por el sistema
# /usr/share/icons/Humanity/places/128/user-desktop.svg
# /usr/share/icons/Humanity/places/64/folder-download.svg

XDG_DESKTOP_DIR="$HOME/1-system/desktop"
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"


Luego creé los siguientes soft links:

ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/desktop-dis/    /home/adelo/1-system/desktop
ln -s 1-system/1-disco_local/1-mis_archivos/.stockage/downloads-dis/  /home/adelo/1-system/desktop/downloads

Luego cabié las imágenes de los íconos:

/usr/share/icons/Humanity/places/128/user-desktop.svg
/usr/share/icons/Humanity/places/64/folder-download.svg

3 Mount discs

Montar discos o particiones

sudo mount /dev/sda3 /home/adelo/1-system/4-windows/
sudo umount /dev/sda3

3.1 Montar discos permanentemente

http://doc.ubuntu-fr.org/mount_fstab

Para montar permanentemente mi disco_local y mi disco_ext, tuve que agregar las siguientes líneas en el archivo /etc/fstab

# Disco_local:
UUID=0B8D61386C315368			/home/adelo/1-system/1-disco_local	ntfs	auto,users,exec,permissions	0	0

# Disco externo - TOSHIBA EXT:
UUID=3C9A5D379A5CEF40			/home/adelo/1-system/2-disco_ext	ntfs	auto,nofail,users,permissions	0	0

3.2 Mount a remote filesystem in your local machine

https://stackoverflow.com/questions/32747819/remote-java-development-using-intellij-or-eclipse

https://serverfault.com/questions/306796/sshfs-problem-when-losing-connection

https://askubuntu.com/questions/358906/sshfs-messes-up-everything-if-i-lose-connection

https://askubuntu.com/questions/716612/sshfs-auto-reconnect

sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 visitor@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
sshfs -o allow_other root@sinfronteras.ws: /home/adelo/1-system/3-cloud


https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs

4 Free Up Space On Ubuntu

Liberar espacio

4.1 Clean up APT cache in Ubuntu

You can see the size of this cache with the command below:

sudo du -sh /var/cache/apt

Now, you have two options to handle the cache. Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary.

sudo apt-get autoclean

Or clean out the cache in its entirety (frees more disk space):

sudo apt-get clean

4.2 Clean the thumbnail cache

du -sh ~/.cache/thumbnails
rm -rf ~/.cache/thumbnails/*

4.3 Empty the Trash

Vaciar papeleras

Los directorios Trash* pueden ser borrados sin ningún problemas puesto que se crean automáticamente.

  • Papeleras en la partición donde se encuentra instalado Ubuntu:
/home/adelo/.local/share/Trash  (Estas rutas creo que deber ser comprobada como usuario y como '''root'''. Ver nota abajo)
/home/adelo/.Trash-*
/root/.local/share/Trash
link del ícono de la papelera

Nota: Por alguna razón que aún desconozco, al comparar los archivos en las dos rutas mostradas arriba con los archivos que se encueentran en la papelera al abrila a través del link del ícono de la papelera, se encuentran discrepancias. Es decir, hay archivos que se observan a través del link de la papelera que no se encuentran en las dos rutas mostradas arriba y viceversa. Por esta razón, debo también vaciar la papelera a través del link de la papelera.

  • Papeleras en disco_local (comprobar como usuario y como root):
/home/adelo/1-system/1-disco_local/.Trash-0
/home/adelo/1-system/1-disco_local/.Trash-1000
  • Papeleras en disco_ext (comprobar como usuario y como root):
/home/adelo/1-system/2-disco_ext/.Trash-0
/home/adelo/1-system/2-disco_ext/.Trash-1000
  • Papeleras en el cloud:
/root/.local/share/Trash
/root/.Trash-*

5 Filesystem Hierarchy Standard

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Directory Description
/
Primary hierarchy root and root directory of the entire file system hierarchy.
/bin
Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
/boot
Boot loader files, e.g., kernels, initrd.
/dev
Essential device files, e.g., /dev/null.
/etc
Host-specific system-wide configuration files

There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".

/home
Users' home directories, containing saved files, personal settings, etc.
/lib
Libraries essential for the binaries in /bin/ and /sbin/.
/media
Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
/mnt
Temporarily mounted filesystems.
/opt
Optional application software packages.
/proc
Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
/root
Home directory for the root user.
/run
Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
/sbin
Essential system binaries, e.g., fsck, init, route.
/srv
Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
/sys
Contains information about the devices connected to the computer.
/tmp
Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
/usr
Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
/var
Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.

6 Fonctionnalités notoires du shell

6.1 Historique

  • Flecha hacia arriba: remonter,
  • Flecha hacia abajo: redescendre dans l’historique;
  • Ctrl + R <chaine>: Chercher une commande dans l’historique contenant <chaine> ;
    • A nouveau Ctrl + R: cherche la commande précédente ;

Ctrl + G: interrompt la recherche.

7 Cursos de Linux online

https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server

Red Hat Enterprise Linux 7 System Administrator's Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/System_Administrators_Guide/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf

http://www.learnlinux.org.za

The Linux System Administrator's Guide: http://www.tldp.org/LDP/sag/html/index.html

13 Linux Network Configuration and Troubleshooting Commands: http://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/

Linux Internet Web Server and Domain Configuration Tutorial: http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html

https://en.wikiversity.org/wiki/Linux_server_administration#A_curriculum_for_the_first_6_months_of_using_Linux

http://brajeshwar.com/2008/top-free-linux-online-courses/

https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0

http://study.com/articles/10_Sites_Offering_Free_Linux_Courses_Online.html

8 Red Hat

He creado una cuenta for the Red Hat Developer Program (email y clave habitual), lo cual me permite descargar una versión gratis de Red Hat:

http://developers.redhat.com/

http://developers.redhat.com/products/rhel/download/

http://developers.redhat.com/products/rhel/get-started/

%%%%%%%%

Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:

Hi Adelo,

I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:

  • Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found here.
  • Highlighted and new content: For ease we will have that on our homepage and will be adding material multiple times a week.
  • You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found here. And did I mention contributing gets you swag?

Again, welcome to Red Hat Developers.

Andréa

%%%%%%%%

Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat https://access.redhat.com/products/red-hat-enterprise-linux/evaluation

Para crear el bootable usb: https://access.redhat.com/articles/142303

8.1 All certifications and exams

https://www.redhat.com/en/services/all-certifications-exams

https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification

8.1.1 Red Hat Certified System Administrator (RHCSA) exam

https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam

8.2 All training courses and exams

https://www.redhat.com/en/services/training/all-courses-exams

8.3 Documentación gratis

Creo que esta guía para RedHad está bastante buena: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/

En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more: https://www.certdepot.net/

8.4 Instalación

Short guide: https://developers.redhat.com/products/rhel/hello-world/

Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html

8.4.1 System Requirements

The requirements for your physical system are:

a 64-bit x86 machine.

4 GB of RAM

20 GB of available disk space.

For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html


8.4.2 Software selection

The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.

Click Software selection.

On the next screen, under Software selection, in the Base environment list on the left, select Server with GUI.

In the list Add-ons for selected environment on the right, select Development tools.


8.4.3 Installation destination

to specify which disk or partition(s) to use for Red Hat Enterprise Linux. Note: It is important that you understand the choices that you are making in this section to avoid accidental data loss. It is strongly recommended that you read the Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html


8.4.3.1 Particionamiento

Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos seleccionar la opción "I will configure particioning". Lo cual nos llevará a la ventana "Manual Particioning"

El programa de instalación de Red Hat permite intalar el SO una partición previamente creada o crear una nueva partición a partir de espacio libre en el disco.

Para crear una nueva partición debemos especificar el tipo de partición en "New mount points will use the following partitioning scheme":

  • LVM (Logical Volume Manager).
  • ,

y luego hacer clic en + para crear la partición.

Sin embargo, el programa de particionamiento no es muy amigable, y no permite especificar la posición de la partición y creo que tampoco permite general un esquema complejo de particiones. Por ejemplo, crear una partición extendida y dentro un conjunto de particiones lógicas en las posiciones deseadas.

Por tanto, me parece mucho más apropiado crear las particiones (con Gparted) antes de iniciar la instalación de Red Had.

9 Grub2

The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.

En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0

9.1 Installing - Reinstalling Grub2

https://help.ubuntu.com/community/Grub2/Installing

9.1.1 Reinstalling GRUB 2 from a Working System

If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal.

X is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.
sudo grub-install /dev/sdX  # Example: sudo grub-install /dev/sda

This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running

sudo update-grub after the install will ensure GRUB 2's menu is up-to-date. 

9.1.2 If a system has become unbootable

There are various methods for reinstalling GRUB 2. The simplest is listed first, followed by more complicated methods.

9.1.2.1 Via Boot-Repair Graphical Tool

https://help.ubuntu.com/community/Boot-Repair

9.1.2.2 Via GRUB2 Rescue mode

GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot. https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode

9.1.2.3 Via the LiveCD terminal

Este método se encuentra explicado aquí: https://help.ubuntu.com/community/Grub2/Installing

y aquí: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Creo que en el segundo link se encuentra una mejor explicación, la cual resumo a continuación:

9.1.2.3.1 How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.

Warning Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.

Terminal Commands

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.

sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so.

sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

Now we jump into that using chroot.

sudo chroot /mnt


Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

Shut down and turn your computer back on, and you will be met with the default Grub2 screen.

You may want to update grub or re-install burg however you like it. Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!

You can now reboot your computer.

9.2 Notas

Instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Esto lo resolví reinstalando grub2 desde Ubuntu como se muestra en Linux#Reinstalling GRUB 2 from a Working System

10 GIMP

10.1 How can I put multiple images side by side to make one image

https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/

Unir/Conbinar varias imágenes:

  • Open one of the pictures in GIMP
  • Go to File > Open As Layers and select the other two pictures
  • Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
  • Select the different layers one at a time and move them to where you want:
Crl PgUp / PgDn to change layer.
  • Finally go to Image > Fit Canvas to Layers

11 vim

« vi » puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar « vim »

Guardar y cerrar:

:qw

Cerrar sin guardar los cambios:

:q!

12 KATE

kate color scheme

13 Sublime Text

Sublime Text is a sophisticated text editor for code, markup and prose.

https://www.sublimetext.com/

13.1 Instalación

Install Sublime Text 3 en Ubuntu: https://tecadmin.net/install-sublime-text-editor-on-ubuntu/

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
$ sudo apt-get update
$ sudo apt-get install sublime-text-installer

13.2 Keyboard shortcut to comment lines in Sublime Text 3

http://stackoverflow.com/questions/17742781/keyboard-shortcut-to-comment-lines-in-sublime-text-3

https://forum.sublimetext.com/t/st3-3012-toggle-comments-broken/8930/8

As a workaround, go to Preferences->Key Bindings - User and add these keybindings (if you're using Linux):

{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }

13.3 Indentation

https://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-to-indent-two-spaces-per-tab

If you want it for all files, go to Preferences -> Settings - Default/User. But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose.

To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -> More -> Syntax Specific -> User. This should open a settings window named Ruby.sublime-settings

Save these settings:

{
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "detect_indentation": false
}

13.4 Crear un proyecto en Sublime Text

  1. Abrimos una nueva ventana: File > New Window
  2. Add folder to project
  3. Save project as: es apropiado guardarlo en el mismo directorio en donde fue creado el proyecto.

Esto creará dos archivos:

  • nombre-111.sublime-project
  • nombre-111.sublime-workspace : Este es el que debemos abrir para ingresar al proyecto.

14 GParted

A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning

Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o monta: no sé si se usa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.

A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.

Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.

15 Latex

sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)

15.1 Kile

16 LibreOffice/OpenOffice

16.1 Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice

http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/

sudo apt-get install myspell-es
sudo apt-get install myspell-fr myspell-fr-gut
sudo apt-get install myspell-*

16.2 No mostrar número de página y nombre de la página en Excel LibreOffice

How NOT to print sheet name and page number in OpenOffice.org Calc: https://superuser.com/questions/200056/how-not-to-print-sheet-name-and-page-number-in-openoffice-org-calc

Go to: Format > Page: Header/Footer y desactivar ambos

17 Adobe Reader (Acroread)

Adobe has recently removed the Linux support from its official download page. Therefore Adobe Reader for Linux is no longer available for download from Adobe website.

Antes, la versión para Linux podía encontrarse en la página oficial de Adobe: https://get.adobe.com/fr/reader/otherversions/

Todavía se puede instalar de dos formas:

17.1 From the old Canonical Partners repository

http://ubuntuhandbook.org/index.php/2014/10/install-adobe-reader-ubuntu-14-10/

We can still install Adobe Reader (Acroread) 9 in Ubuntu 14.10 through the old Canonical Partners repository.

sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
sudo apt-get update
sudo apt-get install acroread

After properly installed Adobe Reader, don’t forget to remove the Canonical Partners repository for Precise:

sudo add-apt-repository -r "deb http://archive.canonical.com/ precise partner"
sudo apt-get update

17.2 From the latest official package for Linux, que Adobe incluyó en su sitio de descargas

Actually the latest official package (AdbeRdr9.5.5-1_i386linux_enu.deb) is still available en algunos sitios, but it might be removed in near future.

wget -c http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb

Install Gdebi to handle the DEB package:

sudo apt-get install gdebi

Now install the package via Gdebi. It’ll also install the dependencies:

sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb

If Adobe Reader is still missing libraries after installation. Run the command below to install them:

sudo apt-get install libgtk2.0-0:i386 libnss3-1d:i386 libnspr4-0d:i386 lib32nss-mdns* libxml2:i386 libxslt1.1:i386 libstdc++6:i386

17.3 How to Set Adobe Reader as default PDF reader

Método 1:

sudo gedit /etc/gnome/defaults.list

When the file opens, do:

  • Find out and change the line
application/pdf=evince.desktop

into:

application/pdf=acroread.desktop
  • Add below line into the end:
application/fdf=acroread.desktop
application/xdp=acroread.desktop
application/xfdf=acroread.desktop
application/pdx=acroread.desktop 

Finally save the file and restart nautilus (run command nautilus -q in terminal) to apply changes.


Método 2:

mimeopen -d *.pdf

17.4 To remove Adobe Reader

sudo apt-get remove acroread; sudo apt-get autoremove

17.5 Ver también

En el siguiente post también se encuentra buena información sobre como instalar Adobe Reader: http://askubuntu.com/questions/455135/how-do-i-install-adobe-acrobat-reader-from-the-repository

18 Skype

sudo apt-get install skype

19 Seismic Unix

Instalación del SU

20 Scilab

sudo apt-get install scilab

21 Crear y borrar usuarios

How to Add (create) and Delete Users on Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04

adduser newuser

You can delete the user itself, without deleting any of their files, by typing this as root:

deluser newuser

If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:

deluser --remove-home newuser

22 apt-get

Desinstalar un programa:

Uninstall the program and all configuration files:

sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*) 


También se podría:

sudo apt-get autoremove eclipse*

Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.


También podría ser necesario:

rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)


Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:

sudo apt-get remove <programname>

23 Which

Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:

adelo@adelo-laptop:~$ which python
/usr/bin/python

24 source

The source command can be used to load any functions file into the current shell script or a command prompt.

The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.

Uno de los usos más comunes es para reload your .bashrc without re-login or restart.

source .bashrc
. .bashrc

25 ls

25.1 Listar sólo archivos o sólo directorios

Listar solo directorios:

ls -lah | grep -v "^-"

Listar solo archivos:

ls -lah | grep -v "^d"

26 Listar archivos con su ruta absoluta

List files with their absolute path in linux:

readlink -f *

27 Listar archivos modificados antes, después, o en una cierta fecha

https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/

To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:

find . -mtime -1 -print

To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:

find /directory_path -type f -mtime -1 -print

To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:

touch -t `date +%m%d0000` /tmp/$$
find /tmefndr/oravl01 -type f -newer /tmp/$$
rm /tmp/$$

28 Contar archivos en un directorio

https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/

Con find

La cuenta es mas exacta con find, por ejemplo:

find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo

find . -type f | wc -l # Contar archivos de forma recursiva ilimitada

find . -type d | wc -l # Contar directorios de forma recursiva ilimitada

find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada

find . | wc -l #Contar archivos y carpetas de forma recursiva

find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada


Con ls

Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.

ls | wc -l

Para incluir los archivos ocultos:

ls -A | wc -l

El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..

29 du

Para incluir archivos ocultos:

  • La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
  • Para listar sólo los archivos ocultos:
du -hs .[^.]*
  • Si queremos listar ocultos y normales:
du -hs $(ls -A)
  • Si queremos ordenar los archivos por tamaño:
du -s $(ls -A) | sort -rn  

Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.

  • Ahora si queremos listar en una unidad en particular:
sudo du -csh --block-size=1M $(ls -A) | sort -rn   (--block-size=1G)

Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.

  • Si queremos excluir algún archivo o directorio:
du -s --exclude=Directorio $(ls -A) | sort -rn 

30 chown

chown command changes the user and/or group ownership of for given file. The syntax is:

chown owner-user file
chown options owner-user:owner-group file
chown adelo:adelo prueba.txt
chown -R adelo:adelo directorio

31 chmod

https://doc.ubuntu-fr.org/permissions

31.1 En gerant chaque droit separement

À qui s'applique le changement:

  • u (user, utilisateur) représente la catégorie "propriétaire" ;
  • g (group, groupe) représente la catégorie "groupe propriétaire" ;
  • o (others, autres) représente la catégorie "reste du monde" ;
  • a (all, tous) représente l'ensemble des trois catégories.

La modification que l'on veut faire:

  • + : ajouter
  • - : supprimer
  • = : affectation

Le droit que l'on veut modifier

  • r : read ⇒ lecture
  • w : write ⇒ écriture
  • x : execute ⇒ exécution
  • X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir plus bas dans la partie des traitements récursifs l'intérêt du X.
chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
chmod <options> ug+rw fichier3
chmod <options> a-rx fichier3
chmod -R a-rX directorio

31.2 En octal

  • r = 4
  • w = 2
  • x = 1
  • - = 0

Par exemple:

  • Pour rwx, on aura : 4+2+1 = 7
  • Pour rw-, on aura : 4+2+0 = 6
  • Pour r--, on aura : 4+0+0 = 4
  rwx        r-x        ---
7(4+2+1)   5(4+0+1)   0(0+0+0)

31.3 Ajustar permisología recursivamente

chmod -R 750 Documents

31.3.1 Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers

31.3.1.1 A traves del permiso X

X representa el permiso de ejecución en repertorios y en fichiers qui ont un x quelque part. Esto permite tratar separadamente el permiso de ejecución en directorios y en archivos. Veamos algunos ejemplos:

Application 1 :

Soit un répertoire monrep, contenant des sous-répertoires et des fichiers. Les droits sont drwx------ (700) pour les répertoires et -rw------- (600) pour les fichiers.

On veut ajouter récursivement les mêmes droits (resp. rwx et rw) pour le groupe. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.

Si on lance chmod -R 770 monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(

Si on lance chmod -R 660 monrep : les répertoires n'auront plus les droits d'exécution → catastrophique :-(

Si on lance chmod -R g+rwx monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(

Si on lance chmod -R g+rwX monrep : seuls les répertoires (et les fichiers déjà exécutables) auront les droits d'exécution → bon :-)


Application 2 :

Imaginons que précédemment on ait lancé la commande chmod -R 770 monrep. La situation est la suivante : les droits sont drwxrwx--- (770) pour les répertoires et -rwxrwx--- (770) pour les fichiers.

On désire supprimer les droits d'exécution uniquement sur les fichiers. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.

Comme chmod s'applique à la fois aux fichiers et répertoires, nous allons jongler avec x et X. Il faut enlever x puis ajouter X.

Si on lance chmod -R u-x+X,g-x+X monrep cela n'aura aucun effet car X concerne à la fois les répertoires ET les fichiers qui ont un x quelque part. Donc si u-x enlève le premier x (ce qui donne -rw-rwx---), la suite +X va aussitôt remettre un x car il reste un x (celui du groupe !).

Donc il faut d'abord enlever tous les x : u-x,g-x avant de les remettre (sera fait uniquement pour les répertoires cette fois) ce qui donne finalement :

chmod -R u-x,g-x,u+X,g+X monrep
31.3.1.2 A través del comando find

Como vimos, X permite tratar separadamente el permiso de ejecución en directorios y en archivos. Ahora, si queremos asignar una configuración de derechos a los directorios y otra muy distinta a los archivos, lo podemos hacer a través del comando find de la siguiente forma:

http://askubuntu.com/questions/58467/chmod-files-only-in-all-subdirectories/58470

Para los directorios:

find <directorio> -type d -exec chmod 755 {} +

Para los archivos:

find <directorio> -type f -exec chmod 664 {} +

31.4 Permisología por defecto

En Ubuntu, al crear un directorio, la configuración de los permisos por defecto será:

drwxrwxr-x  (775)
Me parece mejor la permisología:
drwxr-xr-x  (755)   (umask u=rwx,g=rx,o=rx) (Ver aquí)
Grupo y otros podrán acceder (x) a los directorio y ver (r) su contenido (listar todos los archivos que en él se encuentran); pero no podrán realizar cambios en el directorio (w) (no se podrán crear archivos en el directorio).

Y para los archivos:

-rw-rw-r--  (664)
Para los archivos podría ser más conveniente de esta forma:
-rw-r--r--  (644)   (umask u=rwx,g=rx,o=rx) (Ver aquí)
O incluso así:
-rw-r-----  (640)

31.4.1 Cambiar la permisologia por defecto

Cambiar la permisologia base/por defecto (umask)

https://es.wikipedia.org/wiki/Umask

umask (abreviatura de user mask, máscara de usuario) es una orden y una función en entornos POSIX que establece los permisos por defecto para los nuevos archivos y directorios creados por el proceso actual.

Los sistemas Unix modernos permiten que las máscaras se especifiquen de dos modos:

  • Un permiso por defecto, también llamado máscara simbólica. Por ejemplo, u=rwx,g=rwx,o=
  • Un número en octal que controla qué permisos se enmascararán (no se establecerán) para cualquier nuevo archivo, por ejemplo, 007.

En ambos casos debe tenerse en cuenta que la mayoría de los sistemas Unix no permiten que nuevos archivos sean creados con permisos de ejecución activados, independientemente de la máscara.

Ejemplo de máscara simbólica:

 $ umask u=rwx,g=rwx,o=
 $ mkdir foo
 $ touch bar
 $ ls -l
 drwxrwx--- 2 dave 512 Sep  1 20:59 foo
 -rw-rw---- 1 dave   0 Sep  1 20:59 bar


Ejemplos de máscara en octal:

 $ umask 0174
 $ mkdir foo
 $ touch bar
 $ ls -l
 drw-----wx 2 dave 512 Sep  1 20:59 foo
 -rw-----w- 1 dave   0 Sep  1 20:59 bar

Configurar el valor de umask permanentemente: para un usuario en concreto hay que añadir en el fichero .bashrc el comando umask u=rwx,g=rx,o=rx. También se puede modificar el valor de umask en el fichero global /etc/profile para que el cambio sea efectivo para todos los usuarios. http://www.websecurity.es/como-utilizar-umask-establecer-los-permisos-predeterminados


Ahora, a través del umask no se pueden ajustar separadamente los permisos de los directorios y de los archivos, debido a que umash afecta tanto a los archivos como a los directorio. No he encontrado una orden que permita hacer distinción entre los permisos bases de los directorios y los de los archivos. Sin embargo, en el siguiente post se propone una forma de hacer esto:

http://stackoverflow.com/questions/12445527/set-different-umask-for-files-and-folders

Interesting requirement. Currently (at least in bash), umask is a global setting and you cannot set it based on object type.

One solution that comes to mind would be to set the umask to the file variant and then intercept calls to mkdir (such as with a user-created mkdir script earlier in the path) to do:

umask 0701 ; /path/to/real/mkdir $1 ; umask 0604

That way, assuming all your directory creations are done with mkdir, you can ensure they use a different umask setting.

Note that the script should probably be a little more robust such as restoring the previous umask rather than forcing it to 0604, and adding some better error checking and possibly the ability to handle multiple arguments.

But that's all detail, the framework above should be enough to get you started.

32 fdisk

n => Create new Partition (Then create what you need)

t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)

w => Write the changes to disk and exit

32.1 Crear una partición con fdisk

sudo fdisk /dev/sdb 
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
  p   primary (0 primary, 0 extended, 4 free)
  e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-4028415, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415): 
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

33 Mostrar barra de progreso al Copiar, mover y borrar archivos

33.1 gcp

Comando para copiar mostrando una barra de progreso y velocidad.

gcp -r origen/archivo /destino

34 Hard and symbolic (soft) links

http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link

Underneath the file system files are represented by inodes (or is it multiple inodes not sure)

A file in the file system is basically a link to an inode. A hard link then just creates another file with a link to the same underlying inode.

When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.

A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.

Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.

Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.


Let's create hard and soft links:

Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:

ln blah1 blah1-hard   (hard link not allowed for directory)
ln -s blah2 blah2-soft

Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.

If blah1 is deleted, blah1-hard still holds the contents.

If blah2 is deleted, blah2-soft is just a link to a non-existing file.

34.1 What's the difference between a hard link and a copy?

https://bbs.archlinux.org/viewtopic.php?id=53484

Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).

Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.

No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.

Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:

cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)

Si se quieren preservar los softlinks debemos entonces usar también la opción -d

 cp -rlpd

35 tar and zip

35.1 tar

De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/

tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos

De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)

tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .

35.2 zip

unzip file.zip -d destination_folder

36 Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep

find . -type f -print | xargs grep "palabra"


Y para buscar una linea que contenga dos palabras especificas:

find . -type f -print | xargs grep "palabra1" | grep "palabra2"


O también:

find . -exec egrep palagra '{}' +


Otra forma:

egrep -r palabra *

37 Alias

http://www.computerhope.com/unix/ualias.htm

Aliases are used to customize the shell session interface:

alias ls='ls --color=auto'
alias ll='ls -la'
alias .....='cd ../../../../'
Éste lo he adicionado a mi .bashrc:
alias 'la=ls -AX'

38 Para saber las características del hardware y del SO

38.1 Caracteristicas del harware (marcas/fabricantes, modelos, etc)

38.1.1 Startup Menu

Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.

38.1.2 dmidecode

sudo dmidecode | more

Este comando despliega las características detalladas de todos los componentes del hardware:

  • System Information,
  • BIOS Information,
  • Processor Information, etc.

Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):

sudo dmidecode | grep -A 9 "System Information"

También se puede utilizar este comando empleando ciertos String a través de la opción -s:

sudo dmidecode -s String_keyword
sudo dmidecode -s system-product-name
sudo dmidecode -s bios-release-date
sudo dmidecode -s baseboard-product-name
sudo dmidecode -s baseboard-manufacturer

38.1.3 sysinfo/lshw

sudo apt-get install sysinfo

Para crear un archivo html con todas las características del hardware:

sudo lshw -html > mySpecs.html

then check the html file.

38.2 Desplegar el SO instalado (detallando la versión)

lsb_release -a

http://askubuntu.com/questions/55609/how-do-i-check-system-specifications

38.3 Para saber si el SO instalado es 32 o 64bit

uname -a

Result for 32-bit Ubuntu:

   Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

whereas the 64-bit Ubuntu will show:

   Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


O a través del comando:

getconf LONG_BIT

38.4 Para ver las particiones y dispositivos montados

Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el Tamaño de la partición. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):

sudo parted /dev/sda then type print
sudo parted -l


Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:

lsblk -fm


Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):

sudo fdisk -l


A través del comando mount podemos saber el tipo de sistemas de archivos de particiones/dispositivos montados (check filesystem type):

 mount

Al parecer el tipo fuseblk se refiere a una partición ntfs ver http://ubuntuforums.org/showthread.php?t=1096841


Para saber el UUID de una partición:

sudo blkid


Muestra información sólo de particiones/dispositivos montados:

df -h

38.4.1 Tamaños de la partición: Different partition sizes reported by df and parted

http://ubuntuforums.org/showthread.php?t=1575190

http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html

38.5 Para saber la memoria RAM y Swap (total y en uso)

free -m

O graficamente en System > Administration > System monitor

Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/

38.6 Información del procesador del sistema: núcleos, velocidad, fabricante, arquitectura, 32 o 64bit

lscpu

39 Formatear una unidad Flash USB

https://askubuntu.com/questions/198065/how-to-format-a-usb-drive

39.1 Usando el terminal

Para mostrar los distintos dispositivos y particiones en el sistema:

lsblk -fm

Antes de formatear una device debemos desmontarla:

umount /dev/sdb*

Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver Nota sdb

$ sudo mkfs.vfat -I /dev/sdb

http://tecadmin.net/format-usb-in-linux/#

https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/

$ sudo umount /dev/sdc1
$ sudo umount /dev/sdb*

Format with vFat FileSystem

$ sudo mkfs.vfat /dev/sdc1

Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:

/dev/sdb is entire device, not just one partition.
Refusing to make a filesystem here!

Por eso tuve que crear una partición en la device antes de formatear --> Crear una partición con fdisk

$ sudo mkfs.ntfs /dev/sdc1

Format with EXT4 FileSystem

$ sudo mkfs.ext4 /dev/sdc1

39.2 Interfaz gráfica

https://askubuntu.com/questions/198065/how-to-format-a-usb-drive

40 Screenshot Tool in Ubuntu

Aplicación para imprimir pantalla

40.1 Gnome Screenshot

https://doc.ubuntu-fr.org/gnome-screenshot

Gnome Screenshot est déjà installé par défaut sur Ubuntu

Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran. Ou encore depuis un terminal avec la commande suivante:

gnome-screenshot -i

À l'aide de raccourcis: La convinación de tecla normal no me funciona, la siguiente sí:

[ALT]+[FN]+[IMPR] → Capturer la fenêtre active.

En la página Web se pueden ver las otras convinaciones de tecla disponibles

40.2 Shutter

https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images

Shutter es un buen programa para imprimir pantallas.

También permite editar imágenes: crear flechas y etiquetas de una forma fácil.

41 Programas para realizar respaldos (Backup)

41.1 rsync

http://www.thegeekstuff.com/2010/09/rsync-command-examples/

http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/

One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file. De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.

rsync -azvu --delete --progress Source/ Destination/

Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.

rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
-a, --archive, archive mode; equals -rlptgoD (no -H,-A,-X). This option does the following:
-l, --links copy symlinks as symlinks (Preserves symbolic links)
-p, --perms preserve permissions
-t, --times preserve modification times (Preserves timestamp)
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files
-r, --recursive (ayuda from man rsync)
This tells rsync to copy directories recursively. See also --dirs (-d).
Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed. This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer. It is also only possible when both ends of the transfer are at least version 3.0.0.
Some options require rsync to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and --delay-updates. Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0 (use --del or --delete-during to request this improved deletion mode explicitly). See also the --delete-delay option that is a better choice than using --delete-after.
Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias.
-z is to enable compression
-v verbose
-u : Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
--delete it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
--progress : View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
--exclude is to exclude files or directories while doing synchronization. Ver 6 rsync Examples to Exclude Multiple Files and Directories
--delete-after : No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
-H, --hard-links (ayuda from man rsync)
This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
This option does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source. Cases in which the destination may end up with extra hard links include the following:
  • If the destination contains extraneous hard-links (more linking than what is present in the source file list), the copying algorithm will not break them explicitly. However, if one or more of the paths have content differences, the normal file-update process will break those extra links (unless you are using the --inplace option).
  • If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due to the --link-dest associations.
Note that rsync can only detect hard links between files that are inside the transfer set. If rsync updates a file that has extra hard-link connections to files outside the transfer, that linkage will be broken. If you are tempted to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes happen due to lingering hard links (and see the --inplace option for more caveats).
If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy. This does not affect the accuracy of the transfer (i.e. which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member of the hard-linked set of files). One way to avoid this inefficiency is to disable incremental recursion using the --no-inc-recursive option.
--partial (ayuda from man rsync)
By default, rsync will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
--partial-dir=DIR
A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial data (instead of writing it out to the destination file). On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file that is being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
Rsync will create the DIR if it is missing (just the last dir -- not the whole path). This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in the destination file’s directory when needed, and then remove it again when the partial file is deleted.
If the partial-dir value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes. This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent the untimely deletion of partial-dir items on the receiving side. An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule for the partial-dir because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice. For instance, if you want to make rsync clean-up any left-over partial-dirs that may be lying around, you should specify --delete-after and add a "risk" filter rule, e.g. -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk. E.g. AVOID "/tmp".
You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable. Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial is specified. For instance, instead of using --partial-dir=.rsync-tmp along with --progress, you could set RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of the .rsync-tmp dirfor partial transfers. The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
For the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial. This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a partial transfer, while still allowing the safer idiom provided by --partial-dir.
-P : same as --partial --progress.
--no-inc-recursive : Ver comentarios en las opciones -r y -H.


Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el... Al parecer, la solución a este problema se encuentra explicada aquí: https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/

http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html

http://javier.io/blog/en/2014/08/06/rsync-rename-move.html

  • Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.

41.1.1 Mis sincronizaciones

rsync -azvu --delete-after --progress /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos-dde/
rsync -azvu --delete --progress --exclude '/home/adelo/toshiba_ext/1-mis_archivos/stockage' /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos/

41.2

http://askubuntu.com/questions/2596/comparison-of-backup-tools

http://www.thegeekstuff.com/2012/05/backup-ubuntu-desktop/

deja-dup

42 Nautilus

42.1 Cambiar el icono de una carpeta

https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/

42.2 Folder color: cambia el color de todas tus carpetas en Ubuntu

https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/

Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.

sudo add-apt-repository ppa:costales/folder-color
sudo apt-get update
sudo apt-get install folder-color

43 Convert

43.1 Convinar o unir imágenes

http://imagemagick.org/Usage/layers/#append

Horizontal:

convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png

Vertical:

convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png
convert   -background none -append .png

44 Three ways to hide Files and Directories in Linux

Archivos ocultos

http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html

  1. Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
  2. Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
  3. Rename the file and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.

45 Cambiar la ruta del escritorio, Download, Documents, etc - How to set $HOME/Desktop

http://askubuntu.com/questions/116276/how-to-set-the-desktop-to-home-desktop

Edit the file ~/.config/user-dirs.dirs

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
 
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
# usados por el sistema
# /usr/share/icons/Humanity/places/128/user-desktop.svg
# /usr/share/icons/Humanity/places/64/folder-download.svg

XDG_DESKTOP_DIR="$HOME/1-system/desktop"
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"

46 Recording scren - Screencast

Hacer un video de la pantalla.

En esta página se muestran varias opciones. Byzanz permite hacer gif: https://wiki.ubuntu.com/CreatingScreencasts

sudo add-apt-repository ppa:fossfreedom/byzanz
sudo apt-get update && sudo apt-get install byzanz

Para hacer un video .avi podemos usar:

avconv -f alsa -i pulse -f x11grab -r 10 -s 1024x800 -i :0.0 -vcodec wmv1 -acodec pcm_s16le -q 7 b4.avi
Si queremos desactivar el audio agregamos la opción: -an

47 Gnome

47.1 How to Move the Unity Desktop’s Launcher

https://www.howtogeek.com/251616/how-to-move-the-unity-desktops-launcher-to-the-bottom-of-your-screen-on-ubuntu-16.04/ Para cambiar la posición de la sidebar donde se encuentran los programas en el escritorio por defecto de Ubuntu:

How to Move the Unity Desktop’s Launcher to the Bottom of Your Screen on Ubuntu 16.04:

gsettings set com.canonical.Unity.Launcher launcher-position Bottom
gsettings set com.canonical.Unity.Launcher launcher-position Left

48 Redimensionar imagen - PDF

[redimensionar / resize | comprimir / compress]

sudo apt-get install imagemagick

Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:

mogrify -resize 50% *.jpg

Si queremos darle un tamaño determinado:

mogrify -resize 1024x768 imagen.jpg

48.1 Comprimir un PDF

Paso 1: Trasformar pdf a ps

pdf2ps Original.pdf Medio.ps

Paso 2: Trasformar ps a pdf

ps2pdf Medio.ps Salida.pdf

49 Cortar pdf

https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files

pdfcrop --margins '0 0 0 0' input.pdf output.pdf

Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos

pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf


El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:

#!/bin/bash

for i in {1..11}
do
        pdftk library.pdf cat $i output pag$i.pdf
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
        echo "$i "
done

Este ejemplo se puede probar con este archivo: Media:Library.pdf

50 La papelera - Trash

En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash

50.1 Mover archivos a la papelera desde el terminal

http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal

You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:

sudo apt-get install gvfs-bin

Move file to trash:

gvfs-trash filename

See the content of the trash:

gvfs-ls trash://

Empty the trash:

gvfs-trash --empty


http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash

As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:

  • The program would need to understand/handle all of rm's options and act accordingly
  • It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems


# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del=gvfs-trash


51 Virtual Machines

51.1 Popular virtual machine applications

https://help.ubuntu.com/community/VirtualMachines

51.1.1 Xen

Xen is a popular, open-source virtual machine application that is officially supported by Ubuntu. It provides high performance, but only supports a small number of host and guest operating systems. Ubuntu is supported as both a host and guest operating system, and Xen is available in the universe software channel.

51.1.2 VirtualBox

VirtualBox - Open-source virtual machine from Oracle. Easy to install and use and not to mention very popular.

51.1.3 VMWare

VMware is a non-free virtual machine application, which supports Ubuntu as both a host and guest operating system. Several versions of VMware are available at no cost and can be installed on Ubuntu. One, vmware-player, is available from the multiverse software channel in Ubuntu. VMWare is the virtual machine solution that has been in use the longest and is the most widely used.

51.1.4 Qemu

Qemu is a processor emulator and virtual machine. Qemu supports Ubuntu as both a host and guest operating system, and is capable of emulating arm, powerpc, sparc and x86 processors. Qemu is available from the universe software channel in Ubuntu as the package qemu.

51.1.5 Microsoft Virtual PC

Microsoft Virtual PC is a proprietary virtual machine application for Microsoft Windows. It is capable of running Ubuntu as a guest operating system.

51.1.6 Parallels

Parallels - Commercial virtual machine for Macintosh computers.

52 Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu

52.1 Install Genymotion Android Emulator in Ubuntu 14.04

https://www.youtube.com/watch?v=MHmMDEzsJEY

52.1.1 Instalar VirtualBox

dpkg -i ./virtualbox-4.3...deb
  • O a partir de los repositorios:
sudo apt-get install virtualbox

52.1.2 Instalar GenyMotion

bash genymotion-2.2...bin
  • Luego entramos en el directorio genymotion e iniciamos el programa:
./genymotion
  • Agregamos una Virtual device:
    • Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
    • Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device. The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.

52.1.3 Instalar WhatsApp

Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/

Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse

52.2 Las aplicaciones Android llegan a Chrome vía extensión

53 Importar música a un Ipod

https://help.ubuntu.com/community/PortableDevices/iPod

For this you can use Rhythmbox, Banshee, Amarok or gtkpod. Banshee and Amarok are full music management applications that work with the iPod (much like iTunes), whereas gtkpod is a simpler application used only to sync with the iPod.

54 Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu

https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/

http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation

Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.

Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.

Luego si intento montar la partición, se produce el siguiente error:

adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
[sudo] password for adelo: 
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda2': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.

El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called Fast Startup

In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.

Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/


El problema se puede resuelver haciendo: http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation

sudo ntfsfix /dev/sda2

Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.

Permanent Solution: Disable Fast Startup in Windows 8 and Windows 10.

Use the following path to disable fast startup:

Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/