Linux command-- mv
The mv command is an abbreviation for move, which allows you to move and rename files! It is often used to rename files in * tests. In command execution vulnerabilities, we need to upload tools such as webshell or nc. If we directly wget, it is likely to be prevented or killed, so we need to first wget a text file or image file to a remote server, and then rename the file through mv to restore the file!
Basic use of syntax (mobile):
Mv source file destination directory root@kali:~/eth20/eth20# lstest1 test.txtroot@kali:~/eth20/eth20# lstest1root@kali:~/eth20/eth20# mv test.txt test1/root@kali:~/eth20/eth20# lstest1root@kali:~/eth20/eth20# lstest1 / test.txt
Basic syntax (rename):
File root@kali:~/eth20/eth20# lstest1 test1.txtroot@kali:~/eth20/eth20# mv test1.txt test.txtroot@kali:~/eth20/eth20# lstest1 test.txt after mv source file renaming
In addition, if there is a file with the same name, you need to add the-I parameter to remind you whether it needs to be overwritten, otherwise the file with the same name will be replaced by default, y is replaced, and n is skipped!
Root@kali:~/eth20/eth20# lstest1.txt test.txtroot@kali:~/eth20/eth20# mv-I test1.txt test.txtmv: whether to overwrite 'test.txt'? N
Secondly, we can use-b to add and rename files with the same name.
Root@kali:~/eth20/eth20# lstest1.txt test.txtroot@kali:~/eth20/eth20# mv-b test1.txt test.txtroot@kali:~/eth20/eth20# lstest.txt test.txt~