# - - # # - SFTP Commands - # https://www.simplified.guide/ssh/copy-file https://docs.oracle.com/cd/E26502_01/html/E29001/remotehowtoaccess-14.html https://www.computerhope.com/unix/sftp.htm https://www.bitvise.com/files/guides/sftpc-v736-commands.txt https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server ssh www.isdevelopment.us cd /home/Data3/Images/Programs/Linux.Img/BackupRecoverySystem.Img mkdir Tmp cd Tmp # - - # # - Remote login - # sftp 192.168.1.200 sftp is_derayo@192.168.1.200 sftp uServerVBox; dir # dir on sftpServer ls -la lls -la # dir on local cd # cd on sftpServer lcd # cd on local help pwd lpwd Ctrl+l # cls # - - # # - Important - # # - sftp - HDD commands - # df df -h df -hi df -hi cVandembergData/ get filename.zip # download file from sftpServer get filename.zip local_filename.zip get -r remote_directory get mydocs.zip /home/fred get mydocs.zip /home/fred/downloaded-docs.zip reget filename.zip # resume download mget *.xls put filename.zip # upload file to sftpServer put -r locale_directory reput filename.zip # resume upload put /home/fred/documents/documents.zip /home/fred/documents/mydoc.zip put /home/fred/images/image*.jpg /home/fred/images rename /home/fred/file.txt /home/fred/newfile.txt # - - # # - Download files from sftpServer - # sftp is_derayo@www.isdevelopment.us:/home/Data2/Documents/Downloads/nextcloud-16.0.4.zip sftp myname@files.myhost.com:documents/portfolio.zip sftp myname@files.myhost.com:documents/*.zip # - - # # - seved with different name - # sftp myname@files.myhost.com:documents/portfolio.zip /tmp/portfolio-new.zip # - - # # - Specified session start on sftpServer - # sftp myname@files.myhost.com:documents/budget/april/ # - - # # - Create file mybatch.txt - # cd images put image*.jpg sftp -b mybatch.txt myname@myhost.com mkdir dir_name rename file_name new_file_name rm file_name rmdir directory_name chmod 644 file_name chown user_id file_name chgrp group_id file_name quit bye sftp> ? Available commands: cd path Change remote directory to 'path' lcd path Change local directory to 'path' chgrp grp path Change group of file 'path' to 'grp' chmod mode path Change permissions of file 'path' to 'mode' chown own path Change owner of file 'path' to 'own' help Display this help text get remote-path [local-path] Download file lls [ls-options [path]] Display local directory listing ln oldpath newpath Symlink remote file lmkdir path Create local directory lpwd Print local working directory ls [path] Display remote directory listing lumask umask Set local umask to 'umask' mkdir path Create remote directory put local-path [remote-path] Upload file mput *.xls Upload many files pwd Display remote working directory exit Quit sftp quit Quit sftp rename oldpath newpath Rename remote file rmdir path Remove remote directory rm path Delete remote file symlink oldpath newpath Symlink remote file version Show SFTP version !command Execute 'command' in local shell ! Escape to local shell ? Synonym for help bye Quit sftp cd path Change remote directory to 'path' chgrp grp path Change group of file 'path' to 'grp' chmod mode path Change permissions of file 'path' to 'mode' chown own path Change owner of file 'path' to 'own' df [-hi] [path] Display statistics for current directory or filesystem containing 'path' exit Quit sftp get [-Ppr] remote [local] Download file help Display this help text lcd path Change local directory to 'path' cd /home/Data/Images/Programs/Linux(x32x64).Img/BackupRecoverySystem.Img/ dir # - - # # - Show remote working directory - # pwd Remote working directory: /home/Data/Images/Programs/Linux(x32x64).Img/BackupRecoverySystem.Img # - - # # - Show local working directory - # lpwd # - - # # - Copy file from remote connection - # get filename.zip get filename.zip local_filename.zip get Rescatux_cdrom_usb.iso # - - # # - Download a directory from the remote system -r - # get -r remote_directory # - - # # - Download many files - # mget *.xls # - - # # - If a file transfer fails or is interrupted, use reget - # reget filename.zip # - - # # - Copy a directory and all of its contents - # get -r someDirectory # - - # # - - # Maintain appropriate permissions & access times get -Pr someDirectory # - - # # - To upload a file from the local machine to the remote SFTP server - # put filename.zip # - - # # - Upload many files - # mput *.xls # - - # # - To resume an interrupted upload: - # reput filename.zip # - - # # - Copy entire local directory - # put -r localDirectory # - - # # - The “!” command drops us into a local shell - # # - Terminal access - local computer - # ! df -h ls -la; exit # - - # # - Get information about the remote system’s disk usage - # df df -h df -h cVandemberg\ # - - # # - Create a new directory on the remote server - # mkdir directory_name # - - # # - Rename a file on the remote server - # rename file_name new_file_name # - - # # - Delete a file on the remote server - # rm file_name # - - # # - Delete a directory on the remote server - # rmdir directory_name # - - # # - Change the permissions of a file on the remote system - # chmod 644 file_name # - - # # - Change the owner of a file on the remote system - # chown user_id file_name # - - # # - Change the group owner of a remote file with - # chgrp group_id file_name # - - # # - Change directory local system - # lcd sftpc - Bitvise SSH Client command-line SFTP client Session help for version 7.36 If you are using a newer version, consult the latest help in sftpc itself. For help with command line parameters, run: sftpc -? sftpc -? | more For help with session commands, connect to a server interactively, then run: help help ------------------------------------------------------------------------------ sftp> help Available commands: mkdir, md Create remote directory lmkdir, lmd Create local directory rmdir, rd Remove remote directory lrmdir, lrd Remove local directory cd Change remote directory lcd Change local directory pwd Print remote working directory lpwd Print local working directory dir, ls Display remote directory listing ldir, lls Display local directory listing type View or set default transfer mode get Download file put Upload file queue Manage background transfer queue move, mv Move remote file lmove, lmv Move local file lcopy, lcp Copy local file del, rm Delete remote file ldel, lrm Delete local file symlink Create symbolic link ln Create link chmod Change permissions of file chown Change owner of file chgrp Change group of file !command Execute 'command' in local shell ! Launch local shell version, ver Show SFTP client and protocol version help, ? Display SFTP client usage information exit, quit Exit SFTP client Type 'help ' for more information about a particular command. ------------------------------------------------------------------------------ sftp> help md USAGE: mkdir remote-path DESCRIPTION: Create remote directory. SYNONYM: md ------------------------------------------------------------------------------ sftp> help lmd USAGE: lmkdir local-path DESCRIPTION: Create local directory. SYNONYM: lmd ------------------------------------------------------------------------------ sftp> help rd USAGE: rmdir [remote-path] DESCRIPTION: Remove the specified remote directory. To remove whole directory trees, use 'del -s'. SYNONYM: rd ------------------------------------------------------------------------------ sftp> help lrd USAGE: lrmdir [local-path] DESCRIPTION: Remove local directory. SYNONYM: lrd ------------------------------------------------------------------------------ sftp> help cd USAGE: cd [remote-path] DESCRIPTION: Change remote directory to 'remote-path' or home directory. ------------------------------------------------------------------------------ sftp> help lcd USAGE: lcd local-path DESCRIPTION: Change local directory to 'local-path'. ------------------------------------------------------------------------------ sftp> help pwd USAGE: pwd DESCRIPTION: Display remote working directory. ------------------------------------------------------------------------------ sftp> help lpwd USAGE: lpwd DESCRIPTION: Display local working directory. ------------------------------------------------------------------------------ sftp> help ls USAGE: dir [remote-path] [-s] [-wild|-lit] DESCRIPTION: Display remote directory listing. PARAMETERS: -s Include subdirectories (recursive). -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). SYNONYM: ls ------------------------------------------------------------------------------ sftp> help lls USAGE: ldir [local-path] DESCRIPTION: Display local directory listing. SYNONYM: lls ------------------------------------------------------------------------------ sftp> help type USAGE: type [b | lf] DESCRIPTION: View or set default transfer mode. PARAMETERS: b Set binary as default transfer mode. All files are transferred without conversion. Best for use with Windows servers. This transfer mode is selected by default. lf Set auto detection as default transfer mode. When downloading, text files are converted internally if necessary. When uploading, text files are converted to Unix format, with LF as line delimiter. Binary files are unaffected. NOTES: - 'std' and 't' transfer mode options are also available when SFTP version 4 or higher is in use. ------------------------------------------------------------------------------ sftp> help get USAGE: get remote-path [local-path] [-bg | -fg] [-s] [-o] [-r] [-b | -lf] [-f] [-noTime] [-wild|-lit] DESCRIPTION: Download file. PARAMETERS: -bg Start (queue) download in background. -fg Start download in foreground. -s Include subdirectories (recursive). -r Force existing incomplete file to be resumed. -o Force existing file to be overwritten. -b Download all files as binary; no conversions. -lf Auto-detect text files and convert internally if necessary. -del Remove remote file after successful download. -f Assume remote-path is a file (not a directory). -noTime Do not synchronize file modification times. -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). NOTES: - If both '-r' and '-o' are specified, resume is tried first, and if that fails, overwrite is used. - '-std' and '-t' transfer mode options are also available when SFTP protocol version 4 or higher is in use. ------------------------------------------------------------------------------ sftp> help put USAGE: put local-path [remote-path] [-bg | -fg] [-s] [-o] [-r] [-b | -lf] [-f] [-noTime] [-m=mode] [-dm=mode] DESCRIPTION: Upload file. PARAMETERS: -bg Start (queue) upload in background. -fg Start upload in foreground. -s Include subdirectories (recursive). -r Force existing incomplete file to be resumed. -o Force existing file to be overwritten. -b Upload all files as binary; no conversions. -lf Use auto detection upload mode. Text files are uploaded in Unix format, with LF as the line delimiter. -del Remove local file after successful upload. -f Assume remote-path is a file (not a directory) -noTime Do not synchronize file modification times. -m=mode Set the access mode for remote files to 'mode'. -dm=mode Set the access mode for new remote directories to 'mode'. If directory already exists, access mode will not be changed. NOTES: - If both '-r' and '-o' are specified, resume is tried first, and if that fails, overwrite is used. - '-std' and '-t' transfer mode options are also available when SFTP version 4 or higher is in use. ------------------------------------------------------------------------------ sftp> help queue USAGE: queue queue-selection [queue-action [transfer-id | 'all']] DESCRIPTION: Manage background transfer queue. PARAMETERS: queue-selection Either 'download'/'get' or 'upload'/'put', depending on the queue desired. queue-action Use 'list'/'ls' to list the desired queue, or 'remove'/'rm' to remove transfer(s) from the queue. transfer-id When 'remove' is requested, this parameter can specify s transfer to be removed. If all transfers are to be removed, then 'all' keyword should be used instead. ------------------------------------------------------------------------------ sftp> help mv USAGE: move remote-source-path remote-destination-path [-d] [-f] [-wild|-lit] DESCRIPTION: Move the specified remote file. PARAMETERS: -d When using wildcards, move matching directories as well. -f Assume remote-destination-path is a file (not a directory). -wild Treat remote paths as a wildcard pattern. -lit Treat remote paths literally (not a wildcard pattern). SYNONYM: mv, rename, ren ------------------------------------------------------------------------------ sftp> help lmv USAGE: lmove local-source-path local-destination-path [-d] [-f] [-o] DESCRIPTION: Move the specified local file. PARAMETERS: -d When using wildcards, move matching directories as well. -f Assume local-destination-path is a file (not a directory). -o Force existing file to be overwritten. SYNONYM: lmv, lrename, lren ------------------------------------------------------------------------------ sftp> help lcp USAGE: lcopy local-source-path local-destination-path [-d] [-f] [-o] DESCRIPTION: Copy the specified local file or directory. PARAMETERS: -d When using wildcards, copy matching directories as well. -f Assume local-destination-path is a file (not a directory). -o Force existing file to be overwritten (valid only for files). SYNONYM: lcp ------------------------------------------------------------------------------ sftp> help rm USAGE: del remote-path [-s] [-wild|-lit] DESCRIPTION: Delete remote file. PARAMETERS: -s Include subdirectories (recursive). -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). SYNONYM: rm ------------------------------------------------------------------------------ sftp> help lrm USAGE: ldel local-path [-s] DESCRIPTION: Delete local file. PARAMETERS: -s Include subdirectories (recursive). SYNONYM: lrm ------------------------------------------------------------------------------ sftp> help symlink USAGE: symlink remote-target-path remote-link-path DESCRIPTION: Create a symbolic link for the specified remote target file. ------------------------------------------------------------------------------ sftp> help ln USAGE: ln remote-target-path remote-link-path [-s] DESCRIPTION: Create a link for the specified remote target file. If -s is specified, a symbolic link is created. Otherwise, the new link is a hard link. ------------------------------------------------------------------------------ sftp> help chmod USAGE: chmode mode remote-path [-s] [-wild|-lit] DESCRIPTION: Change the access mode for file 'remote-path' to 'mode'. PARAMETERS: -s Include subdirectories (recursive). -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). ------------------------------------------------------------------------------ sftp> help chown USAGE: chown owner-id[:group-id] remote-path [-s] [-wild|-lit] DESCRIPTION: Change the owner (and group, if preset) of file 'remote-path' to 'owner-id' (and 'group-id'). PARAMETERS: -s Include subdirectories (recursive). -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). NOTES: - The syntax of this command is different when SFTP version 4 or higher is in use. ------------------------------------------------------------------------------ sftp> help chgrp USAGE: chgrp group-id remote-path [-s] [-wild|-lit] DESCRIPTION: Change the group of file 'remote-path' to 'group-id'. PARAMETERS: -s Include subdirectories (recursive). -wild Treat remote-path as a wildcard pattern. -lit Treat remote-path literally (not a wildcard pattern). NOTES: - The syntax of this command is different when SFTP version 4 or higher is in use. ------------------------------------------------------------------------------ sftp> help !command USAGE: !command DESCRIPTION: Execute 'command' in the local shell. If only '!' is entered (no command), an instance of the local shell is launched - exit it to return to SFTP. ------------------------------------------------------------------------------ sftp> help ver USAGE: version DESCRIPTION: Display SFTP client and protocol version. SYNONYM: ver ------------------------------------------------------------------------------ sftp> help exit USAGE: exit DESCRIPTION: Exit SFTP client. SYNONYM: quit