trying to list everything in a folder except . and ..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting trying to list everything in a folder except . and ..
# 1  
Old 05-15-2007
trying to list everything in a folder except . and ..

I want to list everything in a directory, including dotfiles (example .file1) except for the . and .. that are in every folder.
I'm guessing it's some sort of regular expression I need.
So far, I have come up with
ls -a | grep [^.]
That lists the .file1 file only (though I don't see why it should, as it indicate listed lines which start with . and the listings . and .. qualify for this)
However, when I create a file called ... and try this, it doesn't work.
# 2  
Old 05-15-2007
ls -A

Cheers,
ZB
# 3  
Old 05-16-2007
That simple! Cheers!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find the owner user of each folder in a list

Hello I have a file containing the list of different folders like this file_list.txt: /s8/tests/test1 /s8/tests/tests/test2 /s8/tests/test2 /s8/tests/tests/test2/test5 I want a script to put the owner user of each folder in front of it in the text file. So the reult would become... (5 Replies)
Discussion started by: Johanni
5 Replies

2. UNIX for Beginners Questions & Answers

How to list todays file in perticular folder?

How to list todays file in perticular folder Moved thread to appropriate forum (9 Replies)
Discussion started by: pspriyanka
9 Replies

3. UNIX for Dummies Questions & Answers

Unable to list folder contents

I'm unable to list the contents of a directory once I move into it. I have full permissions on this directory (called "Scripts" in the below example). The scenario is shown below in detail: Command 'ls' works fine to begin with: 1: pmn@linuxhost /home/pmn > cd /opt/smt/proiv 2:... (4 Replies)
Discussion started by: pmn
4 Replies

4. HP-UX

List year for a Folder

Hi, I am trying to list the year for this folder but it does not show. See output: ==> ls -ltrde default drwxr-xr-x 2 bea /tmp 8192 Jul 10 22:56 default Any reasons ? Instead of showing year it shows 22:56. Why ? (1 Reply)
Discussion started by: mohtashims
1 Replies

5. Shell Programming and Scripting

List of files in a folder inclusive subfolder

Hi, I need to list the names of existing files in a specific folder. I have written a script for that, but the problem is, it is also picking up name of a subfolder that is there in that folder. I need only the list of files and not that subfolder. How to go about that ? Can anyone plz help... (2 Replies)
Discussion started by: Subhasis
2 Replies

6. UNIX for Dummies Questions & Answers

dtterm to list a folder contents in new window

Hi everyone,:cool: thank you in advance for any help on this I have a dtterm command to open a new small terminal window with a contents of log, and it works fine. dtterm -title "my.log" -geometry =40x30+0+550 -fn 6x13 -e tail -n 40 -f /home/logs/user.log & However what I want to do... (4 Replies)
Discussion started by: golfcents
4 Replies

7. UNIX for Dummies Questions & Answers

List certain file in a folder and make list

Hi, im having problem that frustate me today. there are list of file in a folder that i want to grab the folder /subject/items/ in this folder there are this file CREATE_SUBxxxx.xml UPDATE_SUBxxxx.xml DELETE_SUBxxxx.xml loginresponsexxxxx.xml core how can i grab all the file... (1 Reply)
Discussion started by: andrisetia
1 Replies

8. UNIX for Dummies Questions & Answers

Command to list samba shared folder in linux

Hi All, Is there any command to list samba shared folders in red hat linux 7.2 Thanks in advance Bache Gowda (0 Replies)
Discussion started by: bache_gowda
0 Replies
Login or Register to Ask a Question