Linux

From Sinfronteras
Revision as of 11:08, 2 September 2018 by Adelo Vieira (talk | contribs) (Filesystem Hierarchy Standard)
Jump to: navigation, search

Contents

1 Instalación

1.1 Creating a bootable USB flash drive

1.1.1 Creating a bootable USB flash drive desde el terminal usando 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.2 Creating a bootable Ubuntu USB flash drive from Ubuntu a traves 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.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 Creating and selecting the partition where the SO will be installed

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

Directorios.png
/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu    
/home/adelo/1-system/1-disco_local/.1-conf-dl/2-archivos_programas 

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: Montar discos automáticamete

/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: Cambiar la ruta de Desktop y Download

/home/adelo/.config/user-dirs.dirs

Cambiar la ruta de Desktop, Download, Documents, etc - How to set $HOME/Desktop

# 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

2.7 Algunos links

2.7.1 Link hacia webdevelopment codes

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/1-programacion/1-webdevelopment/1-webdevelopment-codes/   /var/www/html/webdevelopment_codes

2.7.2 Links en el escritorio

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/1-programacion/2-python/   /home/adelo/1-system/desktop/python

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/1-programacion/3-java/   /home/adelo/1-system/desktop/java

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/1-programacion/1-webdevelopment/   /home/adelo/1-system/desktop/webdevelopment

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/3-linux   /home/adelo/1-system/desktop/linux

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-computacion/2-system_analysis_and_design   /home/adelo/1-system/desktop/system_analysis

ln -s /home/adelo/1-system/1-disco_local/1-mis_archivos/2-carrera/2-trabajo/   /home/adelo/1-system/desktop/trabajo

2.8 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/

3 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

3.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

3.1.1 Red Hat Certified System Administrator (RHCSA) exam

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

3.2 All training courses and exams

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

3.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/

3.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

3.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


3.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.


3.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


3.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.

4 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.

5 Fonctionnalités notoires du shell

5.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.

6 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

7 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

7.1 Installing - Reinstalling Grub2

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

7.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. 

7.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.

7.1.2.1 Via Boot-Repair Graphical Tool

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

7.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

7.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:

7.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.

7.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

8 Mount discs

Montar discos o particiones

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

8.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

8.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

9 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

10 Chmod

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

10.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

10.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)

10.3 Ajustar permisología recursivamente

chmod -R 750 Documents

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

10.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
10.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 {} +

10.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)

10.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.

11 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>

12 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.

12.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

13 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 *

14 ls

14.1 Listar sólo archivos o sólo directorios

Listar solo directorios:

ls -lah | grep -v "^-"

Listar solo archivos:

ls -lah | grep -v "^d"

15 Listar archivos con su ruta absoluta

List files with their absolute path in linux:

readlink -f *

16 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/$$

17 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 ..

18 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

19 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

20 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

21 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 

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

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

22.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.

22.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

22.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.

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

lsb_release -a

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

22.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

22.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

22.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

22.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/

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

lscpu

23 Tar and Zip

23.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 .

23.2 zip

unzip file.zip -d destination_folder

24 La papelera - Trash

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

24.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


25 Free Up Space On Ubuntu

Liberar espacio

25.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

25.2 Clean the thumbnail cache

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

25.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-*

26 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.

27 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

27.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.

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

28.1 gcp

Comando para copiar mostrando una barra de progreso y velocidad.

gcp -r origen/archivo /destino

29 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'

30 Formatear una unidad Flash USB

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

30.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

30.2 Interfaz gráfica

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

31 Programas para realizar respaldos (Backup)

31.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.

31.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/

31.2

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

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

deja-dup

32 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.

33 Convert

33.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

34 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

34.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

35 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

36 Gnome

36.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

37 Nautilus

37.1 Cambiar el icono de una carpeta

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

37.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

38 Screenshot Tool in Ubuntu

Aplicación para imprimir pantalla

38.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

38.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.

39 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

40 Latex

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

40.1 Kile

41 LibreOffice/OpenOffice

41.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-*

41.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

42 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:

42.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

42.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

42.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

42.4 To remove Adobe Reader

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

42.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

43 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!

44 GIMP

44.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

45 Scilab

sudo apt-get install scilab

46 Skype

sudo apt-get install skype

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

47.1 Install Genymotion Android Emulator in Ubuntu 14.04

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

47.1.1 Instalar VirtualBox

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

47.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.

47.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

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

48 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.