Skip to content

ayosec/autols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The autols tool

The autols program helps to browser the filesystem. Each time you enter into a directory the program will execute a ls on it. You can limit the number of files (to avoid a flooding when enter in a big directory), change the arguments to the ls and even use a different program.

Installation

Download the source code from git://github.com/ayosec/autols.git and run make

$ git clone https://github.com/ayosec/autols.git
$ cd autols
$ make
$ sudo make install

Shell configuration

When the autols command can be found via $PATH you have to load the configuration for your shell. In the /shell/ directory in the repository you can find the snippets the load autols in Bash and Zsh.

For Bash:

$ echo source $PWD/shell/bashrc >> ~/.bashrc

For Zsh:

$ echo source $PWD/shell/zsh >> ~/.zshrc

Now, reload your shell (or open a new one) and you will see a ls after every cd, pushd, popd or any other method that you use to change the current directory.

Options

The program recognizes three options. None of these options are required. You should be able to use autols with the default values with no problems.

-l number

If the number of non-hidden files in the directory is greater than the -l limit, the ls will not be executed. Instead, a one-line summary will be printed. Defaults to 40.

-m number

The header includes the directory name. If the name length is greater than the -m limit it will replace the middle with an ellipsis. Defaults to 60, and the min value is 10.

-c string

The command to execute when the -l limit is not exceeded. Defaults to ls --color=always -F

You can modify the arguments used to execute the autols with the env variable AUTOLS_OPTIONS. For example

$ cat >> ~/.bashrc <<END
AUTOLS_OPTIONS="-c 'ls -lF' -l 100"
END

Note for MacOS users: It seems that MacOS does not use the GNU ls, and its ls has no --color option. You should set AUTOLS_OPTIONS to remove --color. Try with AUTOLS_OPTIONS="-c 'ls -GF'". You can see the options in the manpage.

About

Launch ls command when the current directory is changed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published