Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

"n" days to learn Linux. Not just stupid copy pasting and breaking homelab and using LLM to get by...

Дата публикации: 05-10-2026 16:26:14



Основное содержимое страницы с новостью.

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 ./newname

Last 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
codes

The contents of the file named codes in ~/opt is shown here:

Code:

[~/opt]$ cat codes
goodbye

The change of directory to ~/tmp is shown here:

Code:

[~/opt]$ cd ../tmp

The listing of files in ~/tmp is shown here:

Code:

[~/tmp]$ ls
codes

The 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
hello

Using 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/codes

The ~/tmp directory no longer contains the file codes:

Code:

[~/tmp]$ ls

Changing directory to the ~/opt directory and listing the files is shown here:

Code:

[~/tmp]$ cd ../opt
[~/opt]$ ls
codes

The 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
hello

A 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

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1First 10 things to do after buying a new Linux VPS (beginner checklist)017.6905-10-2026
2I don't know Python01005-10-2026
3Here's what may throw Linux 7.3 off course, but might not014.3105-10-2026
4Linux still gets half-baked software, here is the proof021.6304-10-2026
5Кухня курса: как я собираю онлайн-курс на нейросетях — по шагам014.429-09-2026
6Как писать промпты для нейросети: метод с отладчиком07.6625-09-2026
7Some Networking Fixes Being Diverted To Linux 7.4, AI/LLM Activity Still Increasing07.0501-10-2026
8Deploying LLM Inference at Scale on Kubernetes08.4614-09-2026
9Running vLLM on NVIDIA DGX Spark with Docker: Zero-Compilation Guide for CUDA 1308.6921-06-2026
10Long-running agents beyond prompt engineering08.7931-08-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 8.01. Источник: www.linux.org.