I assume you were trying to copy a file to a folder /opt/lib to create /opt/lib/file, but the directory didn't exists so you ended up creating a file called /opt/lib instead. If this guess is wrong, ignore this post.
I would be inclined to give the file its original name, create the directory and then move the file to the directory, like this:
Code:
mv /opt/lib /opt/file
mkdir /opt/lib
mv /opt/file /opt/lib/
although if the original file still exists, deleting the copy, making the directory and then copying would be OK too:
Code:
rm /opt/lib
mkdir /opt/lib
cp file /opt/lib/
Bookmarks