New answers tagged ls
-1
votes
combine ls -alt with readlink
Consider this approach:
ls | xargs realpath
ls $PWD | xargs realpath
See here why it works without -1: https://unix.stackexchange.com/a/410557/537347
1
vote
Why does "ls -all" show time for some files but only year for others?
To get full time for old files also, I personally use:
alias ls='ls --time-style=long-iso -Altr'
So I don’t have such issues locally. However it remains a problem using ftp. I am uploading old photos ...
1
vote
Accepted
Display the results in an alphabetical order, independently of their case
ls is required by POSIX to sort the file names in its output according to the collating sequence in the current locale.
If your system has no locale where the sort order ignores case at least in the ...
1
vote
Why is ls sorting Chinese filenames by length?
I found out where macOS stores locale files, in /usr/share/locale, and to my surprise this is how the zh_CN.UTF-8 locale is defined:
% ls -la /usr/share/locale/zh_CN.UTF-8
total 8
drwxr-xr-x 8 root ...
6
votes
Accepted
Why is ls sorting Chinese filenames by length?
You'll notice that among the strings of same length, there appears to be a relative order of those characters, so they're not totally treated as being equivalent. It's not like the 🧚🧛🧜 which have ...
1
vote
Is there any elegant way to find only symbolic links pointing to directories, not other files?
Disclaimer: I'm the current author of rawhide (rh) (see https://github.com/raforg/rawhide)
With rawhide (rh) you can do:
rh 'l && td'
Or, more verbosely/readably:
rh 'link && ...
0
votes
Accepted
Solve ugly color in ls command
Those "ugly" colors are caused by two things:
The use of ls's --color option
Uncommon permissions (mode bits) of the files/directories that are displayed
Remedies:
Adjust the colors to ...
6
votes
Accepted
"ls" counterpart to "find" operator "-printf"?
Not with the GNU implementation of ls¹ as far as I know, however it's possible with some implementations of stat.
For example stat from GNU Coreutils, stat --printf '%n\t%y\t%s\n' will give you the ...
Top 50 recent answers are included
Related Tags
ls × 1340bash × 212
linux × 158
files × 150
shell × 149
find × 131
directory × 106
command-line × 96
colors × 89
wildcards × 85
shell-script × 79
sort × 67
grep × 66
permissions × 54
filesystems × 47
macos × 47
filenames × 38
terminal × 37
symlink × 37
zsh × 34
disk-usage × 33
timestamps × 31
pipe × 26
awk × 24
xargs × 23