I have I bunch of files in a directory, named like this:
cat.10171.jpg cat.12421.jpg cat.3421.jpg
I want to move part of them to another directory using this from Colab notebook:
!mv cat.{0..499}.jpg /content/train
I have an error:
mv: cannot stat 'cat.{0..499}.jpg': No such file or directory
Any ideas how to do this and what is the reason?
Click on “Choose Files” then select and upload the file. Wait for the file to be 100% uploaded. You should see the name of the file once Colab has uploaded it. Finally, type in the following code to import it into a dataframe (make sure the filename matches the name of the uploaded file).
Working with Google SheetsColab allows you to save your work to Google Drive or even directly to your GitHub repository.
Colaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system.
This also worked for me:
shutil.move("path/to/current/file", "path/to/new/destination/for/file")
So:
shutil.move("/content/cat.10171.jpg", "/content/train")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With