cd, ls, rm -rf all I know.
bash scripts, all I know.
ssh remote to local port forwarding i know.
But how does that entirety works in the TCP/IP protocol suite? How is that even possible that I write that ssh -N -L type of stupid stuffs and it helps me in this case.
I am in cafe->I can access my proxmox via SSH (via tailscale)-->Proxmox can access the VM inside it via SSH. Now voila, I write a SSH command at the laptop with me in the cafe and I can access the VM inside proxmox via ssh using tailscale semi-public IP.
For some reasons, mv cannot move folders if files are similar. For example...
I have /tmp/codes folder.
Then I have /opt/codes folder.
I want to ensure that codes in tmp overrides codes in opt. I for some reason cannot use mv. Why?
I have to use rsync with -ac flag.
These things are getting over my head linuxadmin folks. I feel like my brain has been neutralized by AI ceos.
if you want to merge to folders, mv cannot do that, mv is literally the rename(2) syscall, it doesnt touch data at all...here rsync is actually the correct tool you want to use
If you do it correctly, mv can also move files.
This is assuming that the file and folder permissions allow it.
Code:
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...Rename:
Code:
mv ./filename ./newnameLast edited: Yesterday at 6:44 PM
I can't say why you can't use mv to move files, but permissions is a likely suspect. However, you cannot use mv with files of the same name. I agree that rsync is the correct tool for the job. Hammers should only be used on nails, never on screws. And screwdrivers are useless on nails.
If you do it correctly, mv can also move files.
This is assuming that the file and folder permissions allow it.
yes, but wut i think he wants is to merge two dirs, mv cant do that..
most of the time when I'm trying to find an answer to something I'll just prompt a search engine. sometimes it takes a few attempts, refining the prompt as needed.
for this issue, I used:
"
I have /tmp/codes folder.
Then I have /opt/codes folder.
I want to ensure that codes in tmp overrides codes in opt. I for some reason cannot use mv. Why?
"
it points to mounting an overlay filesystem to merge the two directories. seems like a lot of work to do that but that's the answer. it may be that there's a better way.
I can't say why you can't use mv to move files, but permissions is a likely suspect. However, you cannot use mv with files of the same name. I agree that rsync is the correct tool for the job. Hammers should only be used on nails, never on screws. And screwdrivers are useless on nails.
It isn't clear to me what is meant by "you cannot use mv with files of the same name", but if it's a literal meaning then one might consider the following.
In the following example, the mv command is used with two files of the same name which results in a particular outcome which itself is useful in some contexts. To show the process, two directories have been created, ~/opt and ~/tmp, each containing a file of the same name.
The listing in opt is shown here:
Code:
[~/opt]$ ls
codesThe contents of the file named codes in ~/opt is shown here:
Code:
[~/opt]$ cat codes
goodbyeThe change of directory to ~/tmp is shown here:
Code:
[~/opt]$ cd ../tmpThe listing of files in ~/tmp is shown here:
Code:
[~/tmp]$ ls
codesThe files in ~/tmp and ~/opt have the same name of "codes".
The content of the file named codes in ~/tmp is shown here:
Code:
[~/tmp]$ cat codes
helloUsing the mv command to move the file named codes from the ~/tmp directory to the ~/opt directory is shown here:
Code:
[~/tmp]$ mv codes ../opt/codesThe ~/tmp directory no longer contains the file codes:
Code:
[~/tmp]$ lsChanging directory to the ~/opt directory and listing the files is shown here:
Code:
[~/tmp]$ cd ../opt
[~/opt]$ ls
codesThe file named codes exists in ~/opt, but its contents have now changed.
The contents of the file codes in ~/opt is shown here:
Code:
[~/opt]$ cat codes
helloA file with the same name, codes, has been moved to a file with the same name. The mv command has moved the file named codes from ~/tmp to ~/opt and overwritten the file named codes in ~/opt. The original file in ~/opt contained "goodbye", which after the mv command, contained "hello" which was the content of the moved file.
The above is a proof of concept that files with the same name can be moved to each other. The consequence is that one is overwritten.
If @balenshah in post #1 meant "overwrite" for "overrides", the above is perhaps relevant, otherwise @theLegionWithin post #7 seems relevant.
Last edited: Today at 10:32 AM
for this issue, I used:
"
I have /tmp/codes folder.
Then I have /opt/codes folder.
I want to ensure that codes in tmp overrides codes in opt. I for some reason cannot use mv. Why?
"
This would totally useless search prompt with 0 results 5 years ago when search engines didn't have AI in them.
I meant you can't mv files of the same name to the same place. I may have misunderstood exactly what the OP wanted to do. It is possible to move a file of the same name between directories, overwriting the original.
"You can't step in the same river twice"
I meant you can't mv files of the same name to the same place. I may have misunderstood exactly what the OP wanted to do. It is possible to move a file of the same name between directories, overwriting the original.
Its not entirely clear, but wut i think OP wants is - instead of overwriting, to merge them...which mv cant do but rsync can; which OP did use, was the right tool
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | First 10 things to do after buying a new Linux VPS (beginner checklist) | 0 | 17.69 | 05-10-2026 |
| 2 | I don't know Python | 0 | 10 | 05-10-2026 |
| 3 | Here's what may throw Linux 7.3 off course, but might not | 0 | 14.31 | 05-10-2026 |
| 4 | Linux still gets half-baked software, here is the proof | 0 | 21.63 | 04-10-2026 |
| 5 | Кухня курса: как я собираю онлайн-курс на нейросетях — по шагам | 0 | 14.4 | 29-09-2026 |
| 6 | Как писать промпты для нейросети: метод с отладчиком | 0 | 7.66 | 25-09-2026 |
| 7 | Some Networking Fixes Being Diverted To Linux 7.4, AI/LLM Activity Still Increasing | 0 | 7.05 | 01-10-2026 |
| 8 | Deploying LLM Inference at Scale on Kubernetes | 0 | 8.46 | 14-09-2026 |
| 9 | Running vLLM on NVIDIA DGX Spark with Docker: Zero-Compilation Guide for CUDA 13 | 0 | 8.69 | 21-06-2026 |
| 10 | Long-running agents beyond prompt engineering | 0 | 8.79 | 31-08-2026 |