This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/bash/module/ls.sh

55 lines
892 B
Bash
Raw Normal View History

2023-08-08 16:24:15 +03:00
# unset possible system-defined aliases.
unalias l ll lll llll la laa &> /dev/null
unset l ll lll llll la laa &> /dev/null
# list files in dir.
l()
{
ls -lhvt --si --group-directories-first "$@"
}
# list all files in dir, incl. hidden files.
ll()
{
ls -lAhvt --si --group-directories-first "$@"
}
# list files in tree structure.
2023-10-30 03:49:10 +03:00
# usage: lll [DEPTH] [FILES]
2023-08-08 16:24:15 +03:00
lll()
{
2023-10-30 03:49:10 +03:00
local depth="${1}"
local target="${@:2}"
2023-08-08 16:24:15 +03:00
2023-10-30 03:49:10 +03:00
if [[ "${target}" = "" ]]; then
target="."
2023-08-08 16:24:15 +03:00
fi
2023-10-30 03:49:10 +03:00
if [[ "${depth}" = "" ]]; then
tree -a -- "${target}"
2023-08-08 16:24:15 +03:00
else
2023-10-30 03:49:10 +03:00
tree -a -L "${depth}" -- "${target}"
2023-08-08 16:24:15 +03:00
fi
}
# list files recursively.
llll()
{
ls -RlAhvt --si --group-directories-first "$@"
}
# list files alphabetically.
la()
{
ls -lh --si --group-directories-first "$@"
}
# list all files alphabetically.
laa()
{
ls -lAh --si --group-directories-first "$@"
}
# export.
2023-10-23 01:00:15 +03:00
export -f l ll lll llll la laa