Tagged Questions
3
votes
1answer
109 views
ACL, ls, “permission denied” and a lot of questionmarks
I have two users, Alice and Bob. Bob should be allowed to list, ls, Alice's home directory. Alice also has a file in her home directory that Bob should also be allowed to read.
I run these commands ...
1
vote
4answers
261 views
Is there a command to list files, exclude sub-directories and display size and date?
Before I begin please assume I have only basic knowledge in UNIX. Basic meaning I have only started reading about it since last week for a work related purpose.
I have been experimenting with the ls ...
3
votes
1answer
86 views
Listing both ls information and mount points of a directory?
On my Ubuntu Natty, typically all new drives inserted (e.g. USB Flash thumbdrives) are mounted under /media. So, on my system, I can do something like this:
$ mount | grep '/media'
/dev/sda6 on ...
1
vote
1answer
47 views
mark or color empty directories for `ls`
ls's -F flag allows to see the types of file and distinguish directories. Is there a way to add a functionality to distinguish an empty directory?
2
votes
4answers
125 views
Find directories that do not contain subdirectories
I'm writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories.
I know that I could use ls -alR and recursively parse ...
3
votes
2answers
133 views
Why do . and .. have a file size of 4 kB and 12 kB, respectively? [duplicate]
As displayed by ls -al, for example:
drwxr-xr-x 9 jb jb 4.0K Mar 8 18:05 ./
drwx------ 49 jb jb 12K Mar 17 14:15 ../
I assume this is the minimum amount of space required to store the inode's ...
1
vote
1answer
66 views
Total vs listed directories [duplicate]
On a server when I type in ls -al I get a list of the directories
-bash-3.2$ ls -al
total 12
drwxr-xr-x 3 root root 0 Feb 13 2011 .
drwxr-xr-x 4 root root 4096 May 11 2011 ..
drwxr-xr-x 55 ...
28
votes
5answers
2k views
The result of ls * , ls ** and ls ***
I know using the command ls will list all the directories. But what does the ls * command do ? I used it and it just lists the directories. Is the star in front of ls means how deep it can list the ...
0
votes
1answer
99 views
How to display directory permission without listing permission for their contents [duplicate]
Possible Duplicate:
How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?
I am new to UNIX and I want to display the ...
5
votes
3answers
177 views
What's the best way to list size of / in Terminal?
I want to see how much total space / is taking, but I don't know how to do that. I can use ls -hal and add up the subtotals, or I can use fdisk to tell me the size of that partition, but is there a ...
4
votes
1answer
187 views
Why could the size of the “dot file” /. exceed 4096?
Today I found an "empty" directory with a size of 4MB.
It had no visible contents, so I tried ls -lah. This showed me some hidden files (not very large). Searching for the reason why the directory ...
1
vote
1answer
183 views
Very basic question, ls a different directory and save file
I seriously can't understand where I'm going wrong with his question. The first part is.
List all the file and directory names in /etc which have 1 or more numbers in their name. Remember to use ...
1
vote
1answer
429 views
cannot 'ls' /mnt directory
I have a CentOS-6 machine that I'm working on that is running a live database. It's having a problem with the /mnt directory. I cannot ls the directory for some reason. stat is working and shows ...
3
votes
2answers
181 views
Why is bash giving me (apparently) conflicting information about a file?
Background
I am working on a RHEL 5 cluster. I want my Fortran program to read the file /home/bob/inputs/input_1
I asked Bob to give me permission to read all contents of inputs:
[bob@server]$ ...
1
vote
5answers
1k views
ls: Do not show directories that match same pattern in wildcard searches, only files
Supposing I have something like the following, a typical business PC situation:
drwxr-xr-x 1 whatever whoever 3 Oct 3 16:40 invoices2009
drwxr-xr-x 1 whatever whoever 4 Oct 3 16:40 ...
2
votes
2answers
376 views
How can I stop ls from descending into directories, similar to prune for find?
If I type ls *ro* I also get files in subdirectories that match the *ro* pattern.
Is there any option for ls similar to prune?
Ideally a flag, otherwise perhaps an exec?
2
votes
2answers
112 views
What does it mean when the output of $ls -lasrt includes '.' and '..'
I input the command:
$ ls -lasrt
And the output includes (there are more results, these are the ones that confuse me):
4 drwxr-xr-x 5 tuc40953 stdchem 4096 Jul 3 17:48 ..
4 drwxr-xr-x ...
5
votes
4answers
9k views
How can I list subdirectories recursively?
The obvious
ls -dR
does not work.
I am currently using
find /path/ -type d -ls
but the output is not what I need (plain listing of sub-folders)
Is there a way out?
3
votes
2answers
134 views
Is it possible to show the contents of a directory without changing into it?
I'd like to show the contents of a folder without first changing into it. for example:
---- Documents
|
|
L_ Essays
If I'm in Documents, how can I show the contents of ...
3
votes
2answers
122 views
How do I create a structured list of all the files and directories under a particular directory (recursively)?
I need to have an "image" of a file system without actual contents of the files - just all the names and the structure, so that I can read the file and know what files were stored there and how were ...
7
votes
6answers
4k views
What's the best way to count the number of files in a directory?
If parsing the output of ls is dangerous because it can break on some funky characters (spaces, \n, ... ), what's the best way to know the number of files in a directory?
I usualy rely on find to ...
1
vote
1answer
329 views
How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?
Say I have folder "foo" residing, the home directory. I want to get some info of it, owner, group, permissions, etc...
I then do this to try to get the information:
cd ~
ls -l foo
Of course it now ...
2
votes
1answer
1k views
Why can't list file/directory relative to .. from a symbolic link directory (No such file or directory)?
I have a /usr/tomcat6/logs directory linked to /var/log/tomcat6.
When I changed directory to /usr/tomcat6/logs and try to ls files using a relative pathname ../conf/Catalina/localhost, a No such file ...
7
votes
2answers
247 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 ...
1
vote
0answers
134 views
How can I list only the directories present in a directory using ls? [duplicate]
Possible Duplicate:
Is there any option with 'ls' command that I see only the directories?
I have a directory with a lot of files but only a few directories.
To get a list of only ...
4
votes
2answers
1k views
ls'ing through an entire directory tree to produce one pipeable list of files
This might have been answered already. But I wasn't able to find it.
I have:
directory
directory/subdirectory/subdirectoryofsubdirectory
...
21
votes
3answers
1k views
What does size of a directory mean in output of 'ls -l' command?
What does size of a directory mean in output of ls -l command?