Computer Knowledge and Tutorials weblog, Computer knowledge, windows, linux, open source, programming, web apps

Useful SFTP Commands

SFTP is a method to let you transfer files between linux computers easily using SSH protocol. Here’s some important sftp commands that you could use:

cd path Changes remote directory to path.

lcd path Changes local directory to path.

chgrp grp path Changes group of file path to grp. grp must be a numeric GID.

chmod mode path Changes permisssion of file path to mode.

chown own path Changes owner of file path to own. own must be a numeric UID.

exit Quits sftp

get remote-path [local-path] Retrieves the remote-path and stores in on the local machine. If the local-path name is not specified, it is given the same name that it has on the remote machine.

help Displays help text.

lmkdir path Creates local directory specified by path.

ln oldpath newpath Creates a symbolic link from oldpath to newpath.

lpwd Prints local working directory.

ls [path] Displays remote directory listing of either path or current directory (if path is not specified).

mkdir path Creates remote directory in location specified by path.

put local-path [remote-path] Uploads local-path and stores it on the remote machine. If the remote-path name is not specified, it is given the same name as it has on the local machine.

pwd Displays remote working directory.

quit Quits sftp

rename oldpath newpath Renames remote file from oldpath to newpath.

rmdir path Removes remote directory specified by path.

rm path Deletes remote file specified by path.

symlink oldpath newpath Create a symbolic link from oldpath to newpath.

While the syntax for scp is:

scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 […] [[user@]host2:]file2

Tags: ,

????Ÿ?Ÿ?h-client.

  • To test, whether your computer already can be ssh-ed, execute # ssh localhost user@192.168.0.10
    Connecting to 192.168.0.107…
    vhazrati@192.168.0.10
    password: <enter the password>
    sftp>
  • To get the files, you could execute sftp> get file_name /home/user/documents
  • Tags: , , ,

    Google
     

    Leave a Reply

    163 views