These are some basic Linux commands and techniques for new to Linux users. More complete information can be found on the web or by using the man pages.

1. Automatic Login

1.1. Debian

Debian Stretch uses the Xfce desktop environment by default, with the lightDM display manager lightDM. To get automatic login with Stretch:

  • In a terminal, use the command:

$ /usr/sbin/lightdm --show-config
  • Make a note of the absolute path to the configuration file lightdm.conf.

  • Edit that file with a pure text editor (gedit, nano, etc), as root.

  • Find and uncomment the lines:

#autologin-user=
#autologin-user-timeout=0
  • Set autologin-user=your_user_name

  • Save and reboot.

1.2. Ubuntu

Al instalar LinuxCNC con el CD de Ubuntu por defecto se tiene que iniciar sesión cada vez que encienda el ordenador. Para activar autentificacion automática vaya a System > Administration > Login Window. Si se trata de una instalación nueva, la ventana de inicio de sesión puede tardar unos segundo en aparecer. Usted tiene que tener la contraseña que utilizo para la instalación para acceder a la ventana de configuración de inicio. En la pestaña seguridad marque Habilitar Acceso Automático y elija un nombre de usuario de la lista (seleccione su nombre de usuario).

2. Automatic Startup

To have LinuxCNC start automatically with your config after turning on the computer go to System > Preferences > Sessions > Startup Applications, click Add. Browse to your config and select the .ini file. When the file picker dialog closes, add linuxcnc and a space in front of the path to your .ini file.

Example:

linuxcnc /home/mill/linuxcnc/config/mill/mill.ini

The documentation refers to your respective .ini file as INI-file.

3. Terminal

Many things need to be done from the terminal like checking the kernel message buffer with dmesg. Ubuntu and Linux Mint have a keyboard shortcut Ctrl + Alt + t. Debian Stretch does not have any keyboard shortcuts defined. It can be easily created with the Configuration Manager. Most modern file managers support the right key to open a terminal just make sure your right clicking on a blank area or a directory not a file name. Most OS’s have the terminal as a menu item, usually in Accessories.

4. Man Pages

Una página de manual es una forma de documentación de software que se encuentra comúnmente en un sistema operativo UNIX o similar a UNIX, como Linux.

To view a man page open up a terminal to find out something about the find command in the terminal window type:

man find

Use the Page Up and Page Down keys to view the man page and the Q key to quit viewing.

Nota
Viewing the man page from the terminal may not get the expected man page. For example if you type in man abs you will get the C abs not the LinuxCNC abs. It is best to view the LinuxCNC man pages in the HTML documents.

5. List Modules

Sometimes when troubleshooting you need to get a list of modules that are loaded. In a terminal window type:

lsmod

If you want to send the output from lsmod to a text file in a terminal window type:

lsmod > mymod.txt

The resulting text file will be located in the home directory if you did not change directories when you opened up the terminal window and it will be named mymod.txt or what ever you named it.

6. Editing a Root File

Cuando abra el explorador de archivos y vea que el propietario del archivo es el usuario root, se tienen que hacer algunos pasos adicionales para modificar ese archivo. La edición de algunos archivos de root puede traer malos resultados, tenga cuidado al hacerlo; generalmente usted puede ver y abrir la mayoría de los archivos root, pero se abrirán en modo de solo lectura.

6.1. The Command Line Way

Abra una ventana de terminal teclee

sudo gedit

Open the file with File > Open > Edit

6.2. The GUI Way

  1. Right click on the desktop and select Create Launcher.

  2. Type a name in like sudo edit.

  3. Type gksudo "gnome-open %u" as the command and save the launcher to your desktop.

  4. Drag a file onto your launcher to open and edit.

6.3. Root Access

En Ubuntu puede convertirse en root tecleando "sudo -i" en una ventana de terminal y luego tecleando su contraseña. Tenga cuidado porque usted puede dañar su instalación si no sabe lo que esta haciendo.

7. Terminal Commands

7.1. Working Directory

To find out the path to the present working directory in the terminal window, type:

pwd

7.2. Changing Directories

To change the working directory to the one one level up, i.e., the parent directory, in the terminal window type:

cd ..

To move up two levels in the terminal window type:

cd ../..

To move directly to your home directory, in the terrminal window use the cd command with no arguments:

cd

To move down to the linuxcnc/configs subdirectory in the terminal window type:

cd linuxcnc/configs

7.3. Listing files in a directory

To view a list of all the files and subdirectories in the terminal window type:

dir

or

ls

7.4. Finding a File

El comando find puede ser un poco confuso para un usuario nuevo de Linux. La sintaxis básica es:

find starting-directory parameters actions

For example to find all the .ini files in your linuxcnc directory you first need to use the pwd command to find out the directory.

En una ventana de terminal teclee:

pwd

And pwd might return the following result:

/home/joe

With this information put the command together like this:

find /home/joe/linuxcnc -name \*.ini -print

The -name is the name of the file your looking for and the -print tells it to print out the result to the terminal window. The \*.ini tells find to return all files that have the .ini extension. The backslash is needed to escape the shell meta-characters. See the find man page for more information on find.

7.5. Searching for Text

grep -irl 'text to search for' *

This will find all the files that contain the text to search for in the current directory and all the subdirectories below it, while ignoring the case. The -i is for ignore case and the -r is for recursive (include all subdirectories in the search). The -l option will return a list of the file names, if you leave the -l off you will also get the text where each occurrence of the "text to search for" is found. The * is a wild card for search all files. See the grep man page for more information.

7.6. Diagnostic Messages

Para ver los mensajes de arranque usar "dmesg" en la ventana de comandos. Para guardar los mensajes de arranque en un archivo use el operador de redirección >, de esta manera:

dmesg > bootmsg.txt

The contents of this file can be copied and pasted on line to share with people trying to help you diagnose your problem.

To clear the message buffer type this:

sudo dmesg -c

This can be helpful to do just before launching LinuxCNC, so that there will only be a record of information related to the current launch of LinuxCNC.

To find the built in parallel port address use grep to filter the information out of dmesg.

After boot up open a terminal and type:

dmesg|grep parport

8. Convenience Items

8.1. Terminal Launcher

If you want to add a terminal launcher to the panel bar on top of the screen you typically can right click on the panel at the top of the screen and select "Add to Panel". Select Custom Application Launcher and Add. Give it a name and put gnome-terminal in the command box.

9. Hardware Problems

9.1. Hardware Info

Para encontrar que hardware está conectado a la placa base, en una ventana de terminal teclee:

lspci -v

9.2. Monitor Resolution

Durante la instalación, Ubuntu intentará detectar la configuración del monitor. Si esto no funciona el sistema se instalará con una resolución máxima de 800x600.

Instructions for fixing this are located here:

10. Paths

Relative Paths

Relative paths are based on the startup directory which is the directory containing the INI-file. Using relative paths can facilitate relocation of configurations but requires a good understanding of linux path specifiers.

./f0        is the same as f0, e.g., a file named f0 in the startup directory
../f1       refers to a file f1 in the parent directory
../../f2    refers to a file f2 in the parent of the parent directory
../../../f3 etc.