Open menu

Learn

SFTP LLS Command

The Secure File Transfer Protocol (SFTP) has become an essential tool for secure and efficient data exchange between computers in the age of digital information. One of the most versatile aspects of SFTP is its ability to handle a variety of commands, one of which is the lls command.

What is the LLS Command in SFTP?

The lls command, an acronym for 'local list', is an integral SFTP command that lets you view the directory list for your local machine, all from within the SFTP environment. The lls command works similarly to the ls command, which is used to list directory contents on the remote server. However, lls operates on the local machine, making it possible to view local directories without leaving the SFTP interface.

Using the LLS Command in SFTP

The basic syntax for the lls command is:
sftp> lls [ls_options] [path]
The 'ls_options' parameter is optional. It is where you can specify flags that are typically used with the ls command. For instance, -l can be used for a long listing format that provides more details (like file size, modification time, and permissions), and -a can be used to show all files, including hidden ones. The 'path' parameter refers to the local directory you wish to list. If you do not specify a path, lls will list the contents of the current local directory. For example, if you want to list all files including hidden ones in the local directory '/home/user/documents', you would run:
sftp> lls -a /home/user/documents
Executing this command successfully will yield a detailed list of all files and directories—including the hidden ones—in '/home/user/documents'.