ls_usage
This is an old revision of the document!
Table of Contents
sort ls output by filename length
ls --color=never --indicator-style=none | awk '{print length, $0}' | sort -n | cut -d" " -f2-
To see it in action, create some files
% touch a ab abc
and some directories
% mkdir d de def
Output of the normal ls command
% ls a ab abc d/ de/ def/
Output from the proposed command
% ls --color=never --indicator-style=none | awk '{print length, $0}' | sort -n | cut -d" " -f2- a d ab de abc def
Show file date in different date formats
tags | YYYY-MM-DD, YYYYMMDD, YYYYMMDD_HHMMSS
Use one of
--time-style='+%Y%m%d_%H%M%S' --time-style='+%Y-%m-%d' --time-style='+%Y%m%d'
For example
% ls -l --time-style='+%Y%m%d_%H%M%S' ~/.vimrc -rwx------ 1 rajulocal rajulocal 1112 20201017_141554 /home/rajulocal/.vimrc* % ls -l --time-style='+%Y-%m-%d' ~/.vimrc -rwx------ 1 rajulocal rajulocal 1112 2020-10-17 /home/rajulocal/.vimrc* % ls -l --time-style='+%Y%m%d' ~/.vimrc -rwx------ 1 rajulocal rajulocal 1112 20201017 /home/rajulocal/.vimrc*
indicators
“ls -F” appends indicators */=>@| to filenames.
- * means executable.
- / means directory.
- = means socket.
- > means door.
- @ means symbolic link (or that the file has extended attributes).
- | means named pipe.
Ref:- https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean
ls_usage.1658532458.txt.gz · Last modified: 2022/07/22 23:27 by raju