This documentation is no longer maintained. For documentation of the current version of emc2, please see http://www.linuxcnc.org/docview/html

Table of Contents

1 Linux FAQ

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.1 Automatic Login

When you install EMC2 with the Ubuntu LiveCD the default is to have to log in each time you turn the computer on. To enable automatic login go to System/Administration/Login Window. If it is a fresh install the Login Window might take a second or three to pop up. You will have to have your password that you used for the install to gain acess to the Login Window Preferences window. In the Security tab check off Enable Automatic Login and pick a user name from the list (that would be you).

1.2 Man Pages

Man pages are automatically generated manual pages in most cases. Man pages are usually available for most programs and commands in Linux.

To view a man page open up a terminal window by going to Applications, Accessories, Terminal. For example if you wanted 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.

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

1.4 Editing a Root File

When you open the file browser and you see the Owner of the file is root you must do extra steps to edit that file. Editing some root files can have bad results. Be careful when editing root files. You can open and view most root files normally but they will open in “read only” mode.

1.4.1 The Command Line Way

Open up Applications, Accessories, Terminal.

In the terminal window type:

sudo gedit

Open the file with File, Open then edit

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

1.5 Terminal Commands

1.5.1 Working Directory

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

pwd

1.5.2 Changing Directories

To move up one level in the terminal window type:

cd ..

To move up two levels in the terminal window type:

cd ../..

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

cd emc2/configs

1.5.3 Listing files in a directory

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

dir

or

ls

1.5.4 Finding a File

The find command can be a bit confusing to a new Linux user. The basic syntax is:

find starting-directory parameters actions

For example to find all the .ini files in your EMC2 directory you first need to use the pwd command to find out the directory. Open a new terminal window and type:

pwd

might return the following result

/home/joe

With this information put the command together like this:

find /home/joe/emc2 -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.

To find all the files in the directory named and all the subdirectories under that add the -L option to the find command like this:

find -L /home/joe/emc2 -name *.ini -print

1.5.5 Searching for Text

grep -i -r 'text to search for' * 

To find all the files that contain the 'text to search for' in the current directory and all the subdirectories below the current while ignoring the case. The -i is for ignore case and the -r is for recursive (include all subdirectories in the search). The * is a wild card for search all files.

1.6 Hardware Problems

1.6.1 Hardware Info

To find out what hardware is connected to your motherboard in a terminal window type:

lspci -v

1.6.2 Monitor Resolution

During installation Ubuntu attempts to detect the monitor settings. If this fails you are left with a generic monitor with a maximum resolution of 800x600.

Instructions for fixing this are located here:

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

Index