New answers tagged

-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
GrabbenD's user avatar
  • 126
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 ...
Alexandre Oberlin's user avatar
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 ...
Stéphane Chazelas's user avatar
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 ...
nneonneo's user avatar
  • 1,078
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 ...
Stéphane Chazelas's user avatar
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 && ...
raf's user avatar
  • 161
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 ...
xhienne's user avatar
  • 17.6k
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 ...
steeldriver's user avatar
  • 79.7k

Top 50 recent answers are included