Troubleshooting Linux OpenFOAM Issue - Help Needed

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Linux openfoam
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting an issue with running OpenFOAM on Linux, specifically related to a command that fails due to a missing destination operand. Participants are exploring the syntax of the cp command and its implications in the context of file copying within the OpenFOAM tutorial.

Discussion Character

  • Technical explanation

Main Points Raised

  • One participant describes an error encountered when executing a command in OpenFOAM, indicating confusion about the command's syntax.
  • Another participant points out that the cp command requires two arguments: a source and a destination, suggesting that the error arises from not providing a destination.
  • A further contribution highlights that the dot after the cp command in the tutorial indicates the current directory, implying that the user is trying to copy the directory into their current working location.
  • Another participant mentions using the pwd command to clarify the current directory, which can help understand where the dot refers to.
  • It is noted that using echo to display the current directory may not be effective in this context.

Areas of Agreement / Disagreement

Participants generally agree on the necessity of providing a destination for the cp command, but there is no consensus on the best way to clarify the user's current directory or the implications of the tutorial's instructions.

Contextual Notes

Participants have not resolved the specific issue of how to correctly execute the command, and there may be assumptions about the user's familiarity with Linux command-line operations.

member 428835
Hi PF!

I'm unsure if I'm in the right area, but I'm trying to run OpenFOAM on Linux. I'm following the tutorial here:

https://cfd.direct/openfoam/user-guide/v6-tutorials/
but when I type the 4th command: cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily
I receive the error: cp: missing destination file operand after '/opt/openfoam6/tutorials/incompressible.simpleFoam/pitzDaily'

Any help is very appreciated!
 
Technology news on Phys.org
joshmccraney said:
but when I type the 4th command: cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily
I receive the error: cp: missing destination file operand after '/opt/openfoam6/tutorials/incompressible.simpleFoam/pitzDaily'
Yes - you tell the system to copy a file from (the source you have given) to [nothing]. No wonder the copy function is confused!
 
Linux/UNIX cp syntax:
Code:
cp [option]  [path/]source destination
two arguments are required.
 
Notice that there is a dot after the cp command on the website you mentioned, which means 'here, at this location'. You are copying the directory 'pitzDaily' into the location where you currently are, which is the directory $FOAM_RUN, or actually the directory to which this alias refers to.
 
  • Like
Likes   Reactions: member 428835 and jim mcnamara
The pwd command shows what directory the "Dot" represents, if there is any confusion.
e.g.,
Code:
$> pwd
/home/jim
$>  echo .
.
$>
Using echo will not work for this.
 
  • Like
Likes   Reactions: member 428835

Similar threads

Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
18
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K