52 lines
883 B
Bash
52 lines
883 B
Bash
# unset possible system-defined aliases.
|
|
unalias l ll lll llll la lla &> /dev/null
|
|
unset l ll lll llll la lla &> /dev/null
|
|
|
|
# list files in dir.
|
|
l()
|
|
{
|
|
ls -lhv --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list last modified files first.
|
|
ll()
|
|
{
|
|
ls -lhvtr --si "$@"
|
|
}
|
|
|
|
# list files in tree structure.
|
|
# usage: lll [DEPTH] [DIRS]
|
|
lll()
|
|
{
|
|
local IFS=$'\n'
|
|
local depth="${1}"
|
|
local target=("${@:2}")
|
|
|
|
[[ "${target}" = "" ]] && target="."
|
|
[[ "${depth}" = "" ]] && depth=666
|
|
[[ "${depth}" = "-" ]] && depth=666
|
|
|
|
tree -a -L "${depth}" -- "${target[@]}"
|
|
}
|
|
|
|
# list files recursively.
|
|
llll()
|
|
{
|
|
ls -RlAhv --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list all files in dir, incl. hidden files.
|
|
la()
|
|
{
|
|
ls -lAh --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list all files in dir, incl. hidden files, sorted by mtime.
|
|
lla()
|
|
{
|
|
ls -lAhtr --si "$@"
|
|
}
|
|
|
|
# export.
|
|
export -f l ll lll llll la lla
|