-
Notifications
You must be signed in to change notification settings - Fork 3
lfs
Most of time, lf or lfi will return multiple paths and you may need only one particular path from that returned list.
lfs
will help you when you want to pick just one particular path.
-
lfs
- Will list all the paths returned by previous call of
lf
orlfi
- Will list all the paths returned by previous call of
-
lfs [index]
- Will select a path denoted by [index] from the paths found by previous call of
lf
orlfi
- [index] starts from 0 not 1; Thus
lfs 0
will select the first path from the list - [index] can be a negative value
- e.g)
lfs -1
will select the last path from the list
- e.g)
- Will select a path denoted by [index] from the paths found by previous call of
-
lfs [index] +
- Same as
lfs [index]
except that the selected path will be copied to the system clipboard - This is useful when you want to use that selected path for another application such as a text editor or file explorer, etc.
- But ability to copy path to system clipboard requires you have installed system clipboard utility on your system in advance
- Read the section below for more detail
- Same as
-
lfs --help
- Will show help message
See also lff
lfs
(for the 3rd usage above) requires a clipboard command line utility to copy a selected path to the system clipboard.
Systems like OS X and Windows Cygwin have such utility shipped by default, so +
notation with lfs or lff
will work like a charm.
However, on some systems, especially Linux or Unix, you may need to manually install such utility.
Fortunately, popular tools such as xsel
and xclip
are easy to install.
Installing either of xsel
or xclip
is recommended in order for lfs
or lff to fully work on Linux or Unix.
Refer to this for further discussion.
$ lf --
files/empty.txt
files/folder 0/empty.txt
files/folder 0/folder 2/empty.txt
files/folder 0/foo.txt
files/folder 1/bar.txt
$ lfs
files/empty.txt
files/folder 0/empty.txt
files/folder 0/folder 2/empty.txt
files/folder 0/foo.txt
files/folder 1/bar.txt
$ lfs 0
files/empty.txt
$ lfs 2
files/folder 0/folder 2/empty.txt
$ lfs -1
files/folder 1/bar.txt
$ lfs 1 +
files/folder 0/empty.txt ## Now this path has been copied to the system clipboard...
- The current list can be printed out by simply executing
lfs
orlff
without a parameter - This list is shared only within the same shell session.
- Also the list is maintained only in memory; It's not persisted on disk storage.
- Everytime you run either of the following commands, the list will be overwritten.