Troubleshooting Linux OpenFOAM Issue - Help Needed

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Linux openfoam
Click For Summary
The discussion centers on troubleshooting an error encountered while running OpenFOAM on Linux. The user is following a tutorial but receives an error when executing the command to copy a directory, indicating a missing destination file operand. The response clarifies that the cp command requires both a source and a destination. It highlights that the dot after the cp command in the tutorial signifies the current directory, which should be specified as the destination. The pwd command can be used to confirm the current directory, ensuring the user understands where the files will be copied.
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 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 member 428835
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

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