From Dos to Linux - Petewg/harbour-core GitHub Wiki

Common commands used at the MS-DOS prompt (Windows) and their counterparts in Linux

Command's Purpose MS-DOS Linux Basic Linux Example
Copies files copy cp cp thisfile.txt /home/thisdirectory
Moves files move mv mv thisfile.txt /home/thisdirectory
Lists files dir ls ls
Clears screen cls clear clear
Closes prompt window exit exit exit
Displays or sets date date date date
Deletes files del rm rm thisfile.txt
"Echoes" output on the screen echo echo echo this message
Edits files with simple text editor edit pico 1(#notes) pico thisfile.txt
Compares the contents of files fc diff diff file1 file2
Finds a string of text in a file find grep
Formats a diskette format a: (if diskette is in A:) mke2fs or mformat 2(#notes) /sbin/mke2fs/dev/fd0 (/dev/fd0 is the Linux equivalent of A:)
Displays command help command /? man 3(#notes) man command
Creates a directory mkdir mkdir mkdir directory
View a file more less 4(#notes) less thisfile.txt
Renames a file ren mv mv thisfile.txt thatfile.txt 5(#notes)
Displays your location in the file system chdir pwd pwd
Changes directories with a specified path (absolute path) cd pathname cd pathname cd /directory/directory
Changes directories with a relative path cd .. cd .. cd ..
Displays the time time date date
Shows amount of RAM and use mem free free

Notes:

  1. Pico is a simple text editor; other editors you can use in place of Pico include Emacs and vi.
  2. This formats a disk for the DOS filesystem.
  3. You can also use info for some commands.
  4. The more pager can also be used to page through a file a screen at a time.
  5. The mv command can both move a file and, if you want to rename a file in the same directory, you "move" that file to the same directory with a new name, as in the given example.

Compiler Warnings and Errors

The table below includes warnings and errors messages that indicated by compiler during compile-time.
(Should not be confused with run-time errors, which are emitted when a running application bumps into an erratic condition.)
Most of the messages are self-explanatory (so can be considered 'self-documented'); the few that are not, obviously have been left to experience, knowledge and imagination of the user, furthermore, this is one of the main purposes of existence of the various user-groups out there: to dissolve ambiguity and fill the gap of missing docs, particularly when programmer's skills are not always adequate to do it alone.

* WARNINGS
Warning Level Warning Description
1 Ambiguous reference '%s',
1 Ambiguous reference, assuming memvar '%s',
1 Duplicate variable '%s' in nested FOR loop,
1 Function '%s' does not end with RETURN statement,
1 Invalid variable '%s' for enumerator message,
1 Meaningless use of expression '%s',
1 Procedure returns value,
1 Redundant 'ANNOUNCE %s' statement ignored,
1 RETURN statement with no return value in function,
2 Codeblock parameter '%s' declared but not used in function '%s',
2 STATIC Function '%s' defined but never used
2 Unreachable code,
2 Variable '%s' declared but not used in function '%s',
3 Can't use array index with non-array,
3 Class '%s' not known in declaration of '%s',
3 Duplicate declaration of %s '%s',
3 Function '%s' conflicting with its declaration,
3 Incompatible operand type '%s', expected '%s',
3 Incompatible operand types '%s' and '%s',
3 Incompatible parameter '%s', expected '%s',
3 Incompatible return type '%s', expected '%s',
3 Incompatible type in assignment to '%s', expected '%s',
3 Incompatible type in assignment to declared array element expected '%s',
3 Invalid number of parameters %s, expected %s,
3 Message '%s' not known in class '%s',
3 Value of Variable '%s' never used,
3 Variable '%s' is assigned but not used in function '%s',
3 Variable '%s' is never assigned in function '%s',
3 Variable '%s' used but never initialized,
4 Suspicious operand type 'unknown', expected '%s',
4 Suspicious parameter '%s', expected '%s',
4 Suspicious return type '%s', expected '%s',
4 Suspicious type in assignment to '%s', expected '%s',
4 Suspicious type in assignment to declared array element expected '%s',
* ERRORS
  Statement not allowed outside of procedure or function
  Redefinition of procedure or function '%s'
  Duplicate variable declaration '%s'
  %s declaration follows executable statement
  Outer codeblock variable '%s' is out of reach
  Invalid numeric format '.'
  Unterminated string '%s'
  Redefinition of predefined function %s as '%s'
  Illegal variable '%s' initializer '%s'
  ENDIF does not match IF
  ENDDO does not match WHILE
  ENDCASE does not match DO CASE
  NEXT does not match FOR
  ELSE does not match IF
  ELSEIF does not match IF
  Syntax error '%s'
  Unclosed control structure '%s'
  %s statement with no loop in sight
  Syntax error '%s' in '%s'
  Incomplete statement or unbalanced delimiters
  Incorrect number of arguments in %s %s
  Invalid lvalue '%s'
  Invalid use of '@' (pass by reference) '%s'
  Formal parameters already declared
  Invalid %s from within of SEQUENCE code
  Unterminated array index
  Could not allocate %s byte(s)
  Could not reallocate %s byte(s)
  Freeing a NULL memory pointer
  Syntax error "%s at '%s'"
  Jump offset too long
  Can't create output file '%s'
  Can't create preprocessed output file '%s'
  Bad command-line option '%s'
  Bad command-line parameter '%s'
  Invalid filename '%s'
  Mayhem in CASE handler
  Operation not supported for data type '%s'
  Invalid alias expression '%s'
  Invalid array index expression '%s'
  Bound error '%s'
  Macro of declared symbol '%s'
  Invalid selector '%s' in send
  ANNOUNCEd procedure '%s' must be a public symbol
  Jump PCode not found
  CASE or OTHERWISE does not match DO CASE or SWITCH
  Code block contains both macro and declared symbol references '%s'
  GET contains complex macro
  Unterminated inline block in function '%s'
  Too many inline blocks %s
  Inline C requires C output generation, use -gc[n]
  Too many local variables [%s] or parameters [%s]
  Too many enumerate variables in FOR EACH loop
  Incorrect number of enumerate variables
  CASE requires either numeric or string constant
  String too long for SWITCH
  Invalid date constant '%s'
  Invalid timestamp constant '%s'
  Memory buffer overflow
  Memory corruption detected
  Implicit send operator with no WITH OBJECT in sight
  Input buffer overflow
  Unsupported output language option
  String too long
  Code block size too big
  %s not declared with variable number of parameters
  Can't find %s file
  Invalid ALWAYS after %s in RECOVER code
  File write error
  Duplicate case value
  ENDWITH does not match WITH OBJECT
  ENDSWITCH does not match SWITCH
  END SEQUENCE does not match BEGIN SEQUENCE
  Code block contains both macro and WITH OBJECT messages ':%s'
  * Some historical, funny sounding error messages from original CA-Cl*pper. They serve no purpose whatsoever. [vszakats] *
  END wreaks terrible vengeance on control stack
  Control level closure leaves gaping wound in control stack
  Ford Maverick error number
  Something terrible has happened"