For example:
sudo cp /etc/apt/sources.list /etc/apt/sources.list~
With this command I not see any changes.
What does the final tilde do?
For example:
sudo cp /etc/apt/sources.list /etc/apt/sources.list~
With this command I not see any changes.
What does the final tilde do?
The final tilde is just a part of the filename. This command should copy the file /etc/apt/sources.list to a new file with the name /etc/apt/sources.list~. However, if the second file existed before, it is possible that you don't see any changes.
/etc/apt/sources.list file to be able to revert to it later. But I don't know why such a name choice. I would rather use something like /etc/apt/sources.list.backup or /etc/apt/sources.list.save
– raj
Sep 12 '20 at 21:56
cp command used with -b or --backup parameter when the destination file already exists. Eg, if you run cp -b somefile.txt otherfile.txt and otherfile.txt already exists, the command will backup it to otherfile.txt~ before copying somefile.txt over it.
– raj
Sep 12 '20 at 22:12