Differences
This shows you the differences between the selected revisions of the page.
script_commands 2006-09-20 | script_commands (current) | ||
Line 1: | Line 1: | ||
- | ====== Script Commands ====== | ||
- | ===== call ===== | ||
- | Executes arbitrary [[remote_command|remote shell command]]. | ||
- | call <command> | ||
- | |||
- | If current session does not allow execution of arbitrary remote command separate [[shell session]] will be automatically opened. | ||
- | |||
- | The command must not require user input. | ||
- | |||
- | Alias: ''!'' | ||
- | |||
- | Example: | ||
- | <code winscp> | ||
- | call touch index.html | ||
- | </code> | ||
- | |||
- | ===== cd ===== | ||
- | Changes remote working directory for active session. | ||
- | |||
- | cd [ <directory> ] | ||
- | |||
- | If ''directory'' is not specified, changes to home directory. | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | cd /home/martin | ||
- | cd | ||
- | </code> | ||
- | |||
- | ===== chmod ===== | ||
- | [[task_properties|Changes permissions]] of one or more remote files. | ||
- | |||
- | chmod <mode> <file> [ <file2> ... ] | ||
- | |||
- | ''mode'' can be specified as three or four-digit octal number. | ||
- | |||
- | Filename can be replaced with [[file_mask|wildcard]] to select multiple files. | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | chmod 644 index.html about.html | ||
- | chmod 1700 /home/martin/public_html | ||
- | chmod 644 *.html | ||
- | </code> | ||
- | |||
- | ===== close ===== | ||
- | Closes session. | ||
- | |||
- | close [ <session> ] | ||
- | |||
- | Closes session specified by its number. When ''session'' is not specified, closes currently selected session. | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | close 1 | ||
- | close | ||
- | </code> | ||
- | |||
- | ===== exit ===== | ||
- | Closes all sessions and terminates the program. | ||
- | |||
- | exit | ||
- | |||
- | Alias: ''bye'' | ||
- | |||
- | ===== get ===== | ||
- | [[task_download|Downloads]] one or more files from remote directory to local directory. | ||
- | |||
- | get <file> [ [ <file2> ... ] <directory>\[ <newname> ] ] | ||
- | |||
- | Downloads one or more files from remote directory to local directory. If only one parameter is specified downloads the file to local working directory. If more parameters are specified, all except the last one specify set of files to download. The last parameter specifies target local directory and optionally [[operation_mask|operation mask]] to store file(s) under different name. Destination directory must end with backslash. Filename can be replaced with [[file_mask|wildcard]] to select multiple files. To download more files to current working directory use '.\' as the last parameter. | ||
- | |||
- | Use [[script_commands#option|option]] command to set [[transfer_settings|transfer options]]. | ||
- | |||
- | Alias: ''recv'' | ||
- | |||
- | Effective [[script_commands#option|options]]: transfer, confirm, exclude, include | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | get index.html | ||
- | get index.html about.html .\ | ||
- | get index.html about.html d:\www\ | ||
- | get public_html/index.html d:\www\about.* | ||
- | get *.html *.png d:\www\*.bak | ||
- | </code> | ||
- | |||
- | ===== help ===== | ||
- | Displays help for script commands. | ||
- | |||
- | help [ <command> [ <command2> ... ] ] | ||
- | |||
- | Displays list of commands when no parameters are specified. Displays help for each command when some are specified. | ||
- | |||
- | Alias: ''man'' | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | help ls | ||
- | help | ||
- | </code> | ||
- | |||
- | ===== keepuptodate ===== | ||
- | [[task_keep_up_to_date|Watches for changes]] in local directory and reflects them on remote one. | ||
- | |||
- | keepuptodate [ <local directory> [ <remote directory> ] ] | ||
- | |||
- | When directories are not specified, current working directories are synchronized. To stop watching for changes press ''Ctrl-C''. Obsolete files are deleted, if [[script_commands#option|option]] ''synchdelete'' is on. | ||
- | |||
- | Note: Overwrite confirmations are always off for the command. | ||
- | |||
- | Effective [[script_commands#option|options]]: transfer, synchdelete, exclude, include | ||
- | |||
- | Examples: | ||
- | <code winscp> | ||
- | keepuptodate d:\www /home/martin/public_html | ||
- | keepuptodate | ||
- | </code> | ||
- | |||
- | ===== lcd ===== | ||
- | Changes local working directory for all sessions. | ||
- | |||
- | lcd <directory> | ||
- | |||
- | Example: | ||
- | <code winscp> | ||
- | lcd d:\ | ||
- | </code> |