I run this command on my local machine to delete a list of files contained in a text file.
xargs rm -r < deletion_list.txt It works as expected and deletes all of the files in the current working directory that are listed in deletion_list.txt.
I then use sftp to connect to a remote host and create a list of files on my local machine that I want to delete from the remote host.
While connected to the remote host, I enter these commands one by one:
Change local working directory:
lcd /home/user/files_to_delete Create a text file in my local working directory of files in the same directory matching the specified pattern:
!ls *.txt > deletion_list.txt This is supposed to delete files on the remote host based on the file names in deletion_list.txt which is in my local working directory, but it results in an "Invalid Command" error:
xargs rm -r < /home/user/files_to_delete/deletion_list.txt Why does this not work?
xargsas a command in thesftpsession?xargsis not a validsftpcommand (see thesftpmanual).sshortelnetconnection.!localshellcommand?