Tagged Questions
3
votes
3answers
80 views
How can I display octal notation of permissions with ls - and can octal represent all permissions? [duplicate]
After looking at the man page for ls on my system and searching Google, I see there IS a hack of way to use awk or perl to show octal permissions when using ls, but with bash is there anything more ...
2
votes
6answers
133 views
sort ls output by users
On Linux, is there a way to sort ls output by users? What I try to achieve is something like this:
user_a file1
user_a file2
user_b another_file
user_c this_file
user_c ...
10
votes
2answers
389 views
Highlight the three last updated files in ls output
Is there any way to overload or wrap the ls command so that it will highlight / underline / otherwise make obvious the last three modified files?
I know that I can simply ls -rtl to order by reverse ...
5
votes
2answers
651 views
Output ls -l size field with digits grouped by thousands?
It is possible to make ls -l output the size field with digits grouped by thousands? If so, how?
For instance:
$ ls -l
-rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py
(Note the commas ...
2
votes
1answer
1k views
How to get exact file size and file name?
Right now I am using ls -lt /my/directory (see below) then php parses the output. But inconsistently because the delimiter is space and there might be two or more spaces in between two fields.
The ...
1
vote
1answer
390 views
What does @ sign mean in 'ls' output on Mac OSX Lion terminal? [duplicate]
Possible Duplicate:
what does the @ mean in ls -l?
What does the @ sign mean in the following "ls" output?
-rw-r--r--@ 1 root wheel 489 Jan 4 13:14 boot.plist
12
votes
1answer
2k views
ls taking long time in small directory
Running Ubuntu, I open a terminal and do
sudo bash
cd /
ls | head -n 1000
And predictably about 20 directories are returned.
However, if I do an ls, and don't pipe it into anything, the ls just ...
2
votes
3answers
3k views
ls to show only directory/filename and size
First of all, this is not a duplicate of this: Linux ls to show only filename date and size
Because I want to print actual directory name additionally.
I was always using this command:
ls -l | awk ...
8
votes
3answers
1k views
How can I use ms-dos style wildcards with ls and mv?
I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
4
votes
2answers
316 views
How to list files and directories with directories first
I have two questions. First, which command lists files and directories, but lists directories first?
Second question: I want to copy a list of files into a single directory, but make the target ...
8
votes
3answers
6k views
Linux ls to show only filename date and size
How can I use ls in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?
4
votes
4answers
356 views
ls command operating differently depending on recipient
How does commands like ls know what its stdout is?
It seems ls is operating different depending on what the target stdout is. For example if I do:
ls /home/matt/tmp
the result is:
a.txt b.txt ...
5
votes
4answers
2k views
How do I limit the number of files printed by ls?
Is there a way to limit the quantity of listed files on a ls command?
I've seen:
ls | head -4
but to get head to be executed I need to wait for ls to finish execution,
and with directories with an ...
4
votes
2answers
1k views
How to list ALL directories according to their size? [without including the parent directory]
I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes.
I have something on the lines of this in mind:
ls -d -1 -a */ ...
7
votes
2answers
226 views
Is there a correct way to list the subdirectories of the current directory?
I can find the subdirectories of a directory by
ls -d -- */
or
ls -l | grep "^d"
but both of these seem indirect, and I would imagine that there would be a standard way to find just the ...
8
votes
5answers
2k views
What is the difference between ls and l?
I accidentally typed l instead of ls today and found that the command still printed a list of the files in my current directory. Trying l --help brings up the help file for ls suggesting that l is ...
6
votes
1answer
284 views
How do I get a long listing for a single directory?
I want to see a long listing for a single directory. When I type ls -lha, I see this:
drwxrwxr-x 4 username groupname 4.0K 2010-08-05 09:55 files
drwxrwxr-x 7 username groupname 4.0K 2010-08-05 ...
