Download files and directories using the get commandĭownload a single file from the remote to the local machine sftp> get file To upload a directory to the remote server, you have to create the destination directory on the remote server first, and then start the upload sftp> mkdir directorysftp> put -r directory/ 5. To upload multiple files use the following command sftp> mput file1 file2 file3 You can upload single or multiple files or directories from the local machine to the remote one. Upload files and directories using the put command For the remote server use sftp? cd directoryĪnd for the local server use sftp> lcd directory 4. You can easily change the working directory in SFTP. To find the current working directory on the local server use sftp> pwdRemote working directory: /home/userįor the local server, use the following command sftp> lpwdLocal working directory: / You can also list the files on the local system sftp> lls 3. Sftp> lsdirectory directory1 file file.txt file.zip The SFTP command to list all files is ls, so that you can list all files and directories in the current working directory, as shown below. We already mentioned that SFTP is using the same protocol as SSH, so if SSH is not listening on the default port 22, you can specify the port in the command sftp -oPort=2345 2345 is the port number you are using. You can also use a hostname instead of the IP address. You can connect to a remote server via SFTP using the following command sftp password:Connected to IP_Address. Download files and directories using the get command
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |