Score:0

How to move a file to the desktop using the terminal?

kh flag

I want to add an image to the desktop to get information about it with exif, but I don't know how to add the image in desktop or how to copy it in a terminal.

I'm learning how to use the terminal and I've created an image folder using the terminal. Now I'm wondering how to add an image that I already have saved on my computer by using the terminal.

I'm wondering if I can add an image to the folder without having to go through finder.

Score:1
ng flag

You have a few options:

You can use the mv command to move files using the following syntax:

mv /path/to/source /path/to/destination

Replace /path/to/... with absolute or relative paths.

You can also use a tilde ~ at the beginning of the path as a shortcut to your user's home folder. So the destination directory for your Desktop is ~/Desktop:

mv /path/to/source ~/Desktop

So let's assume you have a file image.jpg in your current working directory and you want to move it to your user's desktop, you would use the following command:

mv image.jpg ~/Desktop

Unless you're writing a script, it's usually a better practice to copy with cp rather than move with mv. The reason is that when you move a file, the original file at the source path will be deleted. If you copy, you can make sure that everything is okay before you choose to delete the file at the source path.

hamidi fouad avatar
kh flag
but when i do that nothing happen, i must to cp image from for example the desktop the laptop to the desktop linux how i do that?
Nmath avatar
ng flag
I'm not sure what you're asking. Are you trying to transfer files between two different computers? If so, that's a very different question than the one you've asked. Can you be more specific about what you're trying to do?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.