The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Finding Hidden files and protecting the folder containing hidden files from deletion pochaw Shell Programming and Scripting 4 12-22-2007 01:33 AM
removing a user with hidden files nov_user UNIX for Dummies Questions & Answers 1 12-21-2007 06:16 PM
Transferring hidden files with scp matrixmadhan UNIX for Dummies Questions & Answers 13 01-16-2007 04:00 PM
how to copy hidden files from one folder to another rajan_ka1 UNIX for Dummies Questions & Answers 1 11-07-2005 09:04 AM
I revealed hidden files, now i want to hide em again unclejessie1967 UNIX for Dummies Questions & Answers 3 07-26-2005 11:26 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-19-2007
useless79 useless79 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 57
how to display only hidden files

how can i display only and only hidden file in the current directory.
  #2 (permalink)  
Old 09-19-2007
pbsrinivas pbsrinivas is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 141
ls -a|grep "^\."
  #3 (permalink)  
Old 09-19-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,915
With zsh:

for all type of files:


Code:
print -l .*

for regular files only:


Code:
print -l *(.D)


P.S. . and .. are not matched per default.

Last edited by radoulov; 09-19-2007 at 09:43 AM..
  #4 (permalink)  
Old 09-20-2007
useless79 useless79 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 57
ls -a|grep "^\."


is not working does grep supports regulaexepession ?
  #5 (permalink)  
Old 09-20-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by useless79 View Post
ls -a|grep "^\."


is not working does grep supports regulaexepession ?
Are you sure it does not work ? That command worked just fine for me. Try this


Code:
ls -a | grep -e "^\."

See man grep for other flags. -e allows you to mention a pattern.
  #6 (permalink)  
Old 09-20-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,915
Quote:
Originally Posted by useless79 View Post
[...]
does grep supports regulaexepession ?


g/re/p

re stands for Regular Expression ...
  #7 (permalink)  
Old 11-11-2008
nottrobin nottrobin is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 6
Much easier:


Code:
ls -ad .*

Or I prefer:


Code:
ls -lad .*

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0