Content Preview
TB169 Rev1 Using Centroid Linux
Overview
This document covers some of the differences between Linux and DOS It also has a list of Linux commands
and Hot keys and how to use them
Differences between Linux & DOS commands
* Forward Slash
Linux paths use a forward slash '/' to separate directories instead of a backslash ''
* No drive letters
Linux does NOT use drive letters i e 'c ' Drive letters are emulated within CNC10 'c '
and 'a ' in CNC10 refer to Linux directories '/cncroot/c' and '/cncroot/a'
* CASE SENSITIVE
Linux is case sensitive whereas DOS is case insensitive Most Linux commands are
lowercase For instance typing 'LS' instead of 'ls' at the prompt in Linux will generate an error
* Poweroff
Like Windows Linux should be properly shutdown before turning off the power Turning off the
power before the operating system has properly shutdown can potentially create errors on the hardrive To
properly shutdown Linux type the command "poweroff" from the command line CNC10 can also properly
shutdown Linux from the F10 Shutdown menu in the main menu
Important CNC Linux commands
ls List directory
cd Change current working directory
cp Copy file s
mv Move file s
rm Remove file s
mkdir Create directory
rmdir Remove empty directory
rm r Remove directory and it's contents
less Display a text file
pwd Print current working directory
cnc10m4 Start CNC10 mill
cnc10t4 Start CNC10 lathe
cncedit Edit a text file
statplc Display status of plc executor
version Display CNC Linux version number
cnc10update Install update from floppy disk outside of CNC10
install cnc10 Install CNC10 Utilities and Config files
install config Only install CNC7 or CNC10 config files
7to10 Convert CNC7 config files to CNC10 config files
exit Close the command window xterm
help Displays CNC Linux help information
screenresolution Displays commands for changing screen resolution version 1 15
chattr Assigning file attributes to files version 1 15
addmouse/removemouse add or remove mouse drivers version 1 10
netgo Re initializing control network configuration version 1 20
install floppy/uninstall floppy Allows use to activate a floppy drive in v1 51 or deactivate version
1 51
CNC Linux hot keys
* Alt F6 Launch a command window xterm
* Alt Tab Switch between applications
* Tab Autocompletes file names at the command line
* Up/Down Arrow keys Browes command history
Â
List directory contents ls Â
ls [OPTIONS] [PATH]
* Type 'ls l' to display file attributes file modification time and file size
* Lists contents of current directory if a path is not given
Examples
> ls
List all files in current directory
> ls l
Display file attributes for all files in current directory
> ls /cncroot/a
List all files on floppy disk
> ls /cncroot/a/ncfiles/* cnc
List all * cnc files in ncfiles directory on floppy disk
Change current working directory cd
cd [PATH]
* If PATH is not specified changes to cnc10 directory
Examples
> cd
Change to cnc10 or cnc10t directory
> cd
Move to the parent directory
> cd /
Move to the root directory
> cd /cncroot/a
Move to the floppy disk
Copy File s cp
cp [OPTIONS] FILE S DESTINATION
* DESTINATION must be specified
* Option ' f' overwrites destination files without prompting
* If destination is current directory use ' ' as destination
Examples
> cp file1 txt file2 txt
Copy file1 txt to file2 txt
> cp file1 txt
ERROR Must specify a destination
> cp tmp/cnc10 cfg
Copy cnc10 cfg from tmp subdirectory to current directory
> cp cnc10 cfg cnc10 prm cnc10 plc
ERROR When copying multiple files last argument must be a directory
> cp cnc10 * /
Copy all cnc10 * files in current directory to parent directory
> cp /cncroot/a/ncfiles/* cnc
Copy all * cnc files from ncfiles dir on floppy disk to current dir
Copy subdirectories and files from ncfiles to USB device
> cp a /cncroot/c/cnc10/ncfiles/* /cncroot/a
Move File s mv
mv [OPTIONS] FILE S DESTINATION
* DESTINATION must be specified
* Option ' f' overwrites destination files without prompting
* If destination is current directory use ' ' as destination
Examples
> mv CNC7 PRM cnc10 prm
Rename CNC7 PRM to cnc10 prm
> mv cnc10 prm
ERROR Must specify a destination
> mv cnc10 * /
Move all cnc10 * files to parent directory
> mv cnc10 * mydir
Move all cnc10 * files to the subdirectory mydir
> mv * cnc /cncroot/a/ncfiles
Move all * cnc files to ncfiles directory on floppy disk
> mv /cncroot/a/cnc10 *
Move all cnc10 * files from floppy disk to current directory
Remove File s rm
rm [OPTIONS] FILE S
* Option ' f' deletes files without prompting
* Option ' R' deletes all files and subdirectories in the specified directory
Examples
> rm file1 txt
Delete file1 txt
> rm Rf tmp
Recursively delete all files & subdirectories in directory tmp and delete tmp directory
> rm cnc7 *
Delete all cnc7 * files in current directory
> rm /cncroot/a/cnc10 *
Remove all cnc10 * files on floppy disk
Create directory mkdir
mkdir DIRECTORY
Examples
> mkdir tmp
Create the subdirectory tmp
> mkdir /cncroot/a/ncfiles
Create ncfiles directory on floppy disk
Remove directory rmdir
rmdir DIRECTORY
* DIRECTORY cannot contain any files
Examples
> rmdir tmp
Delete the subdirectory tmp if it is empty
> rmdir /cncroot/a/ncfiles
Delete the empty directory ncfiles from floppy disk
Remove directory rm r
rm r DIRECTORY
* DIRECTORY can contain files or subdirectories
Examples
> rm r tmp
Delete the subdirectory tmp and all it's contents
> rm r /cncroot/a/ncfiles
Delete the directory ncfiles from floppy disk
Displaying text files less
less FILE
* While viewing a file in less PageUp PageDown Up and Down Arrow keys may be used to navigate up and
down in the file
* Pressing 'q' will exit less
* Type 'less help' for more information on less command
Examples
> less report txt
View the file report txt
> ls | less
Take the output of the ls command and display it using less
Print current working directory pwd
* Display the current working directory
Start CNC10 mill cnc10m4
Start CNC10 lathe cnc10t4
Edit a text file cncedit
cncedit [file]
Display plc executor status statplc
Display CNC Linux version number version
* Displays contents of /etc/linux version file
Install update from floppy disk outside of CNC10 cnc10update
* Must insert update disk in drive before executing command
* Useful for installing updates when CNC10 is not executing
* Use 'install cnc10' instead if CNC10 is not installed
Install CNC10 Utilities and Config files install cnc10
* Prompts for CNC10 update disk Utility update disk and disk containing CNC7 or CNC10 config files
Install CNC7 or CNC10 config files install config
install config [ mill] [ lathe]
* ' mill' will install config files in cnc10 directory
* ' lathe' will install config files in cnc10t directory
* Converts CNC7 config files to CNC10 config files
* Use 'cnc10update' instead if installing CNC10 config files from a disk containing a report zip file
Convert CNC7 config files to CNC10 config files 7to10
* Converts all files in current directory to lowercase and renames all cnc7* * files to cnc10* *
Close command window xterm exit
Display help for CNC Linux help
help [HELP TOPIC]
* If HELP TOPIC is not specified display main help page with list of help topics
* Help topics include all of the important CNC Linux commands
Change screen resolution screenresolution
setdisplayhigh changes screen resolution to 1024x768 and can be used on any control with a 15"
LCD
setdisplaylow changes screen resolution to 640x480 and must be used on 10 4/9 4" LCD's and
older monitors
Note control must be power cycled after executing one of these commands
Assigning file attributes chattr
help chattr diplays all available commands for chattr
chattr +i this will apply read only attributes to a file i e chattr +i test cnc
chattr i this will remove read only attributes from the specified file i e chattr i test cnc
Adding or removing mouse drivers addmouse/removemouse
Type addmouse poweroff control and plug in mouse Upon power up the control will allow you to
use a mouse for selecting options
Adding or removing Floppy drive install floppy/uninstall floppy
Type install floppy control will mount the floppy drive and you can start using right away Typing
uninstall floppy unmounts floppy drive so /cncroot/a is available for USB
Re initializing network configuration netgo
* After the cnc10 net file is configured typing netgo re initializes the network settings or you don't have to
power cycle after configuring
Launch a command window xterm Alt F6
* Pressing Alt F6 in any application unless the application uses Alt F6 will start a new command window i e
xterm
Switch between applications Alt Tab
Autocomplete file names at command line Tab
* Pressing Tab after typing the first few characters or a file or directory name will fill in the rest of the file or
directory name
Browsing the command line history Up/Down Arrows
* Pressing the Up arrow key once at the command line will display the last entered command Pressing Up
arrow again will display the command entered before this one After pressing the Up arrow at least once the
Down arrow may be used forward through the command history
Â
Document History
Rev1 Created on 2004 08 02