I was trying to delete multiple files from FTP using Bash.
Then I found my answer here with using the prompt
command.
But I want to know what the tilde ~ does in:
ftp nobody@ftp.example.com
cd my_local_directory
prompt
mdelete *.txt~
I found this site which says that:
With some ftp servers, the "tilde" character, or ~ is used preceeding a username to bypass the need to specify the full path to the user's directory. For example,
my_university.edu/users/bob/welcome.html
might also be reached by specifying:
my_university.edu/~bob/welcome.html
But that's relevant to this use case.
Best Answer
The
~
character has no special meaning in FTP, and in your example it is simply part of the file name.Several text editors (including
gedit
) append~
to the name of a file when it is updated, so the~
copy becomes the previous version. Other text editors have different back-up naming schemes.