43 lines
883 B
Bash
43 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.
|
|
function l() {
|
|
ls -lhv --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list last modified files first.
|
|
function ll() {
|
|
ls -lhvtr --si "$@"
|
|
}
|
|
|
|
# list files in tree structure.
|
|
# usage: lll [DEPTH] [DIRS]
|
|
function 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.
|
|
function llll() {
|
|
ls -RlAhv --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list all files in dir, incl. hidden files.
|
|
function la() {
|
|
ls -lAh --si --group-directories-first "$@"
|
|
}
|
|
|
|
# list all files in dir, incl. hidden files, sorted by mtime.
|
|
function lla() {
|
|
ls -lAhtr --si "$@"
|
|
}
|