SFTP - basic commands

By kimot, 24 December, 2022
df -h             Display disc usage
ls -Srl           List sorted by size descending                         
ls -Slr *.TXT     List sorted by size descending - only *TXT files
ls -trl           List sorted by timestamp descending 
get -Pr directory download the entire directory including perrmissins and access times

?                       Show help 

bye or exit or quit     Quit sftp 

cd path                 Change remote directory to 'path'

get [-afPpRr] remote [local]   Download file
get -a   Attempt to resume partial transfers of existing files
get -f   Fsync will be called after the file transfer has completed to flush the file to disk
get -P   Full file permissions and access times are copied too
get -p   Full file permissions and access times are copied too
get -r   Recursively
get -R   Recursively

 

ls [-1afhlnrSt] [path]  Display remote directory listing 
ls -1    List the output in a single column 
ls -a    Include files that start with a dot (β€œ.”) 
ls -f    Keep the list unsorted 
ls -h    Print sizes in human readable format (K/M/G) 
ls -l    Include additional file information such as permissions and ownership 
ls -n    Display a numerically-presented long listing that includes user and group information 
ls -r    Sort in reverse order 
ls -S    Use file size to sort the list 
ls -t    Use last modification time to sort the list
ls -l --time=atime Show last time when file was modified df [-hi] [path]                           Get information about the remote system’s disc usage