sftp command line linux

# Connexion to default port 22
sftp your_user@your_server_ip_or_remote_hostname
sftp> ? 			# help
# SFTP get local directory
sftp> lpwd
sftp> lls			# list of files in local directory
sftp> lcd mydir		# change local directory
# SFTP get remote directory
sftp> pwd
sftp> ls			# list of files in remote directory
sftp> cd mydir		# change remote directory
# put single file from local to remote directory
sftp> put myfile
# put multiple files from local to remote directory
sftp> mput *.txt
# get single file from remote to local directory
sftp> get myfile
# put multiple files from remote to local directory
sftp> mget *.txt

5
52
Lexia 125 points

                                    #################################
SFTP Command Line Syntax Commands
#################################
# Connexion to default port 22
sftp your_user@your_server_ip_or_remote_hostname
# If default port 22 use the -P option to specify the SFTP port
sftp -P custom_port remote_username@server_ip_or_hostname
# help
sftp> ?
# SFTP get local directory
sftp> lpwd
# list of files in local directory
sftp> lls
# change local directory
sftp> lcd mydir
# SFTP get remote directory
sftp> pwd
# list of files in remote directory
sftp> ls
# change remote directory
sftp> cd mydir
# put single file from local to remote directory
sftp> put myfile
# put multiple files from local to remote directory
sftp> mput *.txt
# get single file from remote to local directory
sftp> get myfile
# put multiple files from remote to local directory
sftp> mget *.txt

5 (5 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source