Questions tagged [ls]
The ls command lists the contents of a directory.
1,384 questions
0 votes
1 answer
65 views
How can I display the time in a "relative" format like "2 minutes ago" with ls, ncdu or similar tool when listing files in a folder in a Bash shell?
How can I display file timestamps in a relative format, such as "2 minutes ago", using ls, ncdu, tree or a similar tool when listing files in a folder in a Bash shell on Ubuntu?
4 votes
2 answers
488 views
recursive ls - Ignore files only in specific sub-directories
So, ls -R is a command I use a lot to quickly verify the file structure of my projects, or check for any leftover files, as it's simple enough to use and read, and is part of coreutils (which means I ...
0 votes
1 answer
62 views
find or ls -l recursive output in YYYY-MM-DD format on FreeBSD
I'm trying to list files recursively with this date format YYYY-MM-DD on a on FreeBSD. I tried the Linux commands I know but none of them worked : $ ls -lR --time-style=+'%Y-%m-%d %T' ls: unrecognized ...
-1 votes
1 answer
78 views
Added quotes on the name of the new created directory [duplicate]
I have the following situation: I'm creating a directory with an & at the end, something like this: inventory& But, when I run the command mkdir "inventory&" the linux system ...
0 votes
2 answers
185 views
How to apply an ls to a file name with spaces in a variable
This code my_file="/tmp/file_without_spaces" if [ -f "${my_file}" ]; then my_ls_aaaammgg_hhss="$(ls ${my_file} -l --time-style='+%Y%m%d_%H%M%S' | cut -d' ' -f6)" mv &...
9 votes
2 answers
1k views
How do I make `ls` sort the same way Thunar sorts files?
The title is a summary of what I'm trying to achieve, but I'll give an example to illustrate what my problem is and how I've been trying to solve it. Example folder Let's say I've got a folder on a ...
0 votes
0 answers
105 views
Linux ls shows some abnormal files with “?” No message of desired type
Help me understand the following problem - there is software that interacts with files in XML format. The software is wrapped in a docker container. When the software works with the file, the error &...
0 votes
1 answer
765 views
How to fix "reading directory: Invalid argument"?
$ ls Downloads ls: reading directory 'Downloads': Invalid argument How can I ever again access my precious Downloads directory? I've got something important in there! What next, a ransom note? I've ...