Swiss File Knife
a command line
free external tools,
- download the free Swiss File Knife Base from Sourceforge. - open the Windows CMD command line, Mac OS X Terminal or Linux shell. - OS X : type mv sfk-mac-i686.exe sfk and chmod +x sfk then ./sfk - Linux: type mv sfk-linux.exe sfk and chmod +x sfk then ./sfk OS X and Linux syntax may differ, check the help within the tool.
sfk ftp host[:port] [options] [command [parms] The SFK Simple FTP Client. commands put x send a single file with name x get x receive a single file with name x mput x send multiple files of the current directory having x in their filename mput .ext send multiple files ending with .ext mget x receive multiple files from the ftp server having x in their filename mget .ext receive multiple files ending with .ext dir list the remote directory cd x change into remote directory x lcd x change into local directory x !mycmd execute local command mycmd run cmd run remote command (only with sfk ftp server) bye exit options -force continue transfer after errors. -verbose list the transmitted ftp commands and tell if SFK_FTP_USER/PW variable is used. helpful to get more infos in case of errors. -quiet disable progress indicator and other output. -noprog no progress indicator during transfers. -update or -up transmits only changed files. this option is experimental and may or may not work, depending on the server software, server settings (UTC vs. local time) and time zone. -new the same as -update. -user=x or -user x sends username x instead of anonymous. you may also set an environment variable like: set SFK_FTP_USER=myuser or set SFK_FTP_CUSER=myuser with the latter one being used only by the sfk ftp command, but not by sfk ftpserv. -pw=x or -pw x sends an authentication password x. you may also set an environment variable like: set SFK_FTP_PW=mypassword or set SFK_FTP_CPW=mypassword -noclone do not try to replicate time stamps on a file transmission from an sfk ftp server. -pres always preserve full file attributes, including readonly modes. default is to keep file writeable by file owner and to apply umask under linux. -verify extra verify by re-reading files after transfer and comparing against a transmitted md5 checksum. aliases sfk sft ... = the same as sfk ftp, but using port 2121. cput = same as "mput -update" (multi put changed). cget = same as "mget -update" (multi get changed). cget, cput have same experimental status as described under the -update option. automatic IP expansion if you are in the same subnet as the target host, you may supply only the IP number's last part(s), e.g.: sfk ftp 23 ... == sfk ftp 192.168.1.23 ... sfk ftp 2.23 ... == sfk ftp 192.168.2.23 ... this feature may or may not work, depending on your operating system and number of network interfaces. add option -showip to see what the expanded IP is. file attributes since SFK 1.6.7, if an SFK server speaks with SFK client, some linux file attributes are sent and written at the receiver. by default, rw for owner is always set, and the target system umask is applied. use option -pres(erve) to transfer attributes as is. when sending from linux to windows attributes like 'x' get lost. examples sfk ftp farpc put test.zip send test.zip to farpc sfk ftp -user=foo -pw=bar farpc put test.zip the same but with authentication sfk ftp 192.168.1.99:30199 get test.zip receive test.zip from 192.168.1.99 port 30199 sfk ftp farpc mput .cpp send all .cpp files of the local dir to farpc. subfolder contents are NOT included. sfk ftp farpc mget * receive all files from farpc's directory, overwriting everything in the local directory. sfk ftp hostname enter interactive mode, in which you can type the above commands directly. for example, !dir runs the command "dir" locally. sfk sel -today mydir .css .php +ftp farpc mput upload all .css and .php files changed today within the mydir folder to FTP server farpc. before doing so, make sure that farpc has the same folder structure (mydir at top level). sfk today mydir .css .php +ftp farpc cput similar as above, but checks also on farpc which of the selected files actually differ. IF connected with an sfk sft server: best practice is to run an sft (simple file transfer) server on the other PC or VM like: sfk sftserv -rw this will use port 2121, avoiding firewall and other restrictions that usually block use of ftp port 21. then the following can be used by an sfk client: sfk sft farpc get myfile.txt download myfile.txt instantly. if a local file exists with the same name then it is overwritten. sfk sft farpc mget myfile download all files having "myfile" in their name. sfk will show a "simulating" preview first. add -yes to really download the files. sfk sft farpc mput myfile send all files having "myfile" in their name. if files with same name exist at server then they are overwritten. sfk sft farpc get the\sub\dir\doc.txt by default, sfk sftserv allows deep direct access to files within folders. all required output dirs are created automatically. this deep access cannot be used with mget, mput and dir. sfk sel mydir .txt +sft farpc cput send all .txt files within mydir that changed since the last transmission to farpc. sfk filter filelist.txt +sft farpc mget mydir create a list with filenames, download the files listed therein from server farpc into a folder "mydir". sfk sft 192.168.1.100 cput .txt connect to server .100 and send all .txt files which are newer or were added in the local folder. sfk sft 2.100 cget .txt connect to a server like, for example, 192.168.2.100 and download all .txt files which are newer or were added in the remote folder. sfk sft farpc -pw mypw run "sh myscript.sh >tmp1.txt 2>&1" execute a command on the remote server, redirecting all output into a file tmp1.txt. requires an sfk sft server with option -run, AND -pw authentication on both sides. problems and solutions: - if running the ftp server just like "sfk ftpserv" then on Windows Vista, Windows 7 the firewall may stop sfk to sfk file transfer on port 21 with ECONNRESET or ECONNABORTED. therefore use a different port, like -port=2121 which is default with sftserv. read more under: sfk ftpserv -help see also sfk ftpserv -help web reference http://stahlworks.com/sfk-ftp NOTE: existing files are overwritten without asking back. Make sure that ftp server and client are running in the correct directories, especially before mput/mget.
sfk is a free open-source tool, running instantly without installation efforts. no DLL's,
no registry changes - just get sfk.exe from the zip package and use it (binaries for
windows, linux and mac are included).
read more about all sfk functions here.