i need to copy files from one folder to another folder using shell
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i need to copy files from one folder to another folder using shell
i need to copy files from a folder called output files to another folder called running but im not able to do it
i always get a stat error
can anyone please help me?
You need to use the full path if you are not running the command from inside one of those folders. And using directories with spaces in the names is silly. You have to use quotes around the directory name.
As Smoker said, don't use directory names with spaces in them. Can you rename the "output files" directory to output-files, or something like that?
From the directory where "output files" is located run:
Code:
mv output\ files/ output-files
Or just right-click on "output files" and choose rename if you are running a graphical desktop and not just a shell.
And what is the full file path to the files you want to copy? And what is the full file path to the directory that you want to copy them to?
Can you just move "output files" and "running" to your home directory to make this easier?
well that would be easier but this is part of my application so i need to move it automatically when i run the script . i suppose there isnt any otherway to copy
well that would be easier but this is part of my application so i need to move it automatically when i run the script . i suppose there isnt any otherway to copy
I don't understand what that means.
Application for what? And what script?
well my application needs to convert text to sound and sound back to text , i just want a script that will handle the necessary files ..and i changed the name from "output files" to outputfiles
If that's what I think it means in DOS/Windows, you should actually be using just "*", because Unix does not have file extensions.
Also, do not put spaces in filenames because bash will treat them like separate arguments.
That's odd, I have plenty of file.png and file.pl and file.rc
But considering it can't find the directory I don't think thats a problem.
If there were no files with an extension it wouldn't do anything, but it wouldn't return a stat error.
That's odd, I have plenty of file.png and file.pl and file.rc
But considering it can't find the directory I don't think thats a problem.
If there were no files with an extension it wouldn't do anything, but it wouldn't return a stat error.
I am not saying that "extensions" are not used, I am saying that the Unix operating system itself does not have such a concept (they are just used for user convenience, and some programs may require them), and that unlike Windows, Unix filenames are allowed not to have an extension, so *.* will not match all files.
I once tried to make a filename without an extension in Windows, but it still showed to have a ".txt" extension in the DOS prompt even though it didn't show in explorer (I had it set to show extensions)!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.