ls

Display the results in an alphabetical order, independently of their case

Display the results in an alphabetical order, independently of their case I am using ls on MacOS 11.6.1. In the output, the Upper cases are displayed before the lower case. For example, I get the following output: $ ls Blabla.txt GAGAS.txt asdf.txt blabla.txt and would like to have instead: $ ls asdf.txt blabla.txt Blabla.txt GAGAS.txt …

Total answers: 1

Why is ls sorting Chinese filenames by length?

Why is ls sorting Chinese filenames by length? I’ve run into a bit of a weird behaviour that I don’t fully understand with ls and Chinese filenames. I’m running macOS 13.6.1 with SIP enabled (no core OS modifications), MacPorts installed, and US English as the primary language. First, run this little script in a blank …

Total answers: 2

Thunar and ls different file size

Thunar and ls different file size I have a complete android userdata partition image on disk and it shows 48.9 GiB on Thunar but only 3.8 GB in ls and Baobab. How is it possible ? Thanks Asked By: darkon11 || Source This might be a sparse file; i.e. a file that has "holes" where …

Total answers: 1

"ls" counterpart to "find" operator "-printf"?

"ls" counterpart to "find" operator "-printf"? The find command has a handy -printf operator that prints user-specified metadata for each found file/folder. Is there such an option for the ls command? As an alternative, I can feed the list of filenames of interest to find instead of ls, but it seems like using a sledgehammer …

Total answers: 1

Get total Git LFS size

Get total Git LFS size How can I get total size of Git LFS files? I can get a listing of LFS files with git lfs ls-files –size: b1d5dd29dd – file1.zip (1.42 GB) 27d3073f43 – file2.zip (120 MB) cacd6dbfe3 – folder/file3.zip (110.2 MB) 295442cd34 – "folder/(120 MB).zip" (110.2 MB) 680bb2ab19 * test.txt (5 B) Note: …

Total answers: 1

How does `ls` find hard links?

How does `ls` find hard links? Setup The following sequence of commands is setup for my question. root@cd330f76096d:/# cd root@cd330f76096d:~# ls root@cd330f76096d:~# mkdir -p my_dir/my_subdir root@cd330f76096d:~# ls -hAil total 12K 6175969 -rw-r–r– 1 root root 3.1K Oct 15 2021 .bashrc 6175970 -rw-r–r– 1 root root 161 Jul 9 2019 .profile 7382820 drwxr-xr-x 3 root root …

Total answers: 1

How do I reliably capture the output of `ls` in this script?

How do I reliably capture the output of `ls` in this script? The following script, play_movie.sh is meant to automatically select a movie if there is only one in the current directory and play it with ffplay. Otherwise it is meant to display a selection of films to the user and take input from them …

Total answers: 2

Is it now safe to parse the output of GNU ls?

Is it now safe to parse the output of GNU ls? The accepted wisdom for the past few decades has been that it is never a good idea to parse the output of ls ([1],[2]). For example, if I want to save a file’s modification date along with its name into a shell variable, this …

Total answers: 3

ubuntu command not working

Ubuntu commands aren't working My Ubuntu seems a bit weird. cd and mkdir work fine, but instructions other than ls and rm do not. I’m not sure what the problem is. Isn’t there another way to initialize this path? I have solved the problem where the terminal was not working before, but this time the …

Total answers: 2

Effect of dircolors

Effect of dircolors What does dircolors affect. Is it for the ls command only ? Should dircolors be called before defining alias ls=’ls –color’? Asked By: Hovlar || Source dircolors outputs code meant to be interpreted by a shell. Without option or with the -b option, that’s meant for Bourne-like shells such as ksh, zsh …

Total answers: 1

Copy the n-largest files from a certain directory to the current one

Copy the n-largest files from a certain directory to the current one I am trying to copy five largest files from a certain directory to my pwd. Using cp specific/directory$(ls -S specific/directory | head -n) ./ copies the first file and then proceeds to produce cannot stat errors for the rest of the files in …

Total answers: 4

ls -F/–classify marks every file as an executable

ls -F/–classify marks every file as an executable ls -F classifies ALL files on my mounted partitions as an executable (it appends an asterisk to the end of the file name). The same command performs correctly in other places like my home folder, so I have no idea what is making it misbehave. ~ ❯ …

Total answers: 1

Showing different file size when using ls and du command?

Why do `ls` and `du` commands show a different size for the same file? I am currently using Ubuntu 20.04. When I check a file’s size using the du command, I get the following output: ubuntu@ip-172-31-49-39:/myxfs$ du -h newquota 4.0K newquota With the ls -la command, I get the following: ubuntu@ip-172-31-49-39:/myxfs$ ls -la total 8 …

Total answers: 1

touch command not able to create file in write-permitted directory

touch command not able to create file in write-permitted directory This is my user $ id uid=1000(pzk) gid=1000(pzk) groups=1000(pzk) This is my directory structure $ ls -tlrh total 12K d-w–w–w- 2 root root 4.0K Apr 13 10:53 write-for-everyone dr–r–r– 2 root root 4.0K Apr 13 10:53 read-for-everyone d–x–x–x 2 root root 4.0K Apr 13 10:53 …

Total answers: 2

why ls show diffrent size for directories(not 4k)?

Why does ls show different size for some directories (not 4k)? While ls shows most directories having a size of 4.0K, some directories have different sizes, as shown in the output below: drwxr-xr-x 8 root root 4.0K Aug 13 2022 room drwxr-xr-x 2 root root 138 Jan 11 2021 room_old drwxr-xr-x 2 root root 4.0K …

Total answers: 1

Is there any way to control ls output format

Is there any way to control ls output format I have a directory contains some svg images among its contents. I list them with following ls command to save the output in a file: ls *200px.svg > animList.js The output file looks like: file1-200px.svg file2-200px.svg file3-200px.svg … fileX-200px.svg I need the file name to be …

Total answers: 2

test -r contradicts ls -l

test -r contradicts ls -l I’m struggling with files and directory permissions. ls -l is telling me something that test -w contradicts. $ ls -l total 1792 -rw-r–r– 1 root www-data 168 Jan 29 23:53 CODE_OF_CONDUCT.md -rw-r–r– 1 root www-data 19421 Jan 29 23:53 COPYING -rw-r–r– 1 root www-data 14547 Jan 29 23:53 CREDITS -rw-r–r– …

Total answers: 1