LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2010, 05:51 AM   #1
lipun4u
Member
 
Registered: Sep 2008
Location: Mumbai, india
Distribution: ubuntu and hp-unix
Posts: 118

Rep: Reputation: 15
list only hidden files


Anyone please tell me how to list only hidden files in current directory ?
 
Old 02-15-2010, 06:00 AM   #2
mannoj
LQ Newbie
 
Registered: Sep 2009
Location: India
Posts: 20

Rep: Reputation: 1
Follow the link given

Below link will help you:

http://www.linux.ie/newusers/beginne...guide/find.php

I think you posted the same problem in two different forum.

Did you?
 
0 members found this post helpful.
Old 02-15-2010, 06:13 AM   #3
TreborG2
LQ Newbie
 
Registered: Jan 2009
Location: Virginia
Distribution: Debian
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by lipun4u View Post
Anyone please tell me how to list only hidden files in current directory ?
ls -Ad .*
ls -Adl .*

you might have issues with other defaulted switches with ls, generally those go away if you reference ls directly (ie. /bin/ls )

the 'd' shows only directory names, rather than showing the files in the directories

the 'l' (lower case L) does a long list format more like standard "dir" command in DOS & Windows command lines..
 
Old 02-15-2010, 06:14 AM   #4
TreborG2
LQ Newbie
 
Registered: Jan 2009
Location: Virginia
Distribution: Debian
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by mannoj View Post
FYI Mannoj, I get a 404 going to that URL.
 
Old 02-15-2010, 06:15 AM   #5
slightlystoopid
Member
 
Registered: Jan 2010
Distribution: Arch, Gentoo, FreeBSD
Posts: 64

Rep: Reputation: 16
I don't think a broken link will help, but 'man find' might. the command you want is `find -maxdepth 1 -iname '.*'` and add -type f to only show regular files.

Last edited by slightlystoopid; 02-15-2010 at 06:16 AM.
 
Old 02-15-2010, 06:36 AM   #6
mannoj
LQ Newbie
 
Registered: Sep 2009
Location: India
Posts: 20

Rep: Reputation: 1
Quote:
Originally Posted by TreborG2 View Post
FYI Mannoj, I get a 404 going to that URL.
Sorry, it was wrong link.

Please, try following link:
http://www.linux.ie/newusers/beginne...guide/find.php

Please, see the next post.

I don't know, how to use the editor?

Last edited by mannoj; 02-15-2010 at 06:44 AM.
 
Old 02-15-2010, 06:42 AM   #7
mannoj
LQ Newbie
 
Registered: Sep 2009
Location: India
Posts: 20

Rep: Reputation: 1
Quote:
Originally Posted by TreborG2 View Post
FYI Mannoj, I get a 404 going to that URL.
In that link:

"beginne...guide" is nothing but "beginners-linux-guide"

Now, correct the link and use it.
 
Old 02-15-2010, 06:52 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
You can also use "ls -d .[^.]*". This will list hidden directories as well. The [^.] is needed instead of .* to prevent .. matching.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
List hidden files Dryaf Linux - Newbie 1 01-26-2010 05:01 AM
bash: mv hidden and not hidden files lupe Linux - General 4 06-22-2009 01:27 PM
how to list only hidden files babu198649 Linux - Newbie 5 12-28-2007 04:45 AM
Bash scripting problem: Can't get a list of all files, including hidden ones oxi Programming 24 03-12-2007 06:19 AM
kmail list contacts hidden? patolfo Linux - Software 2 06-19-2006 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration