![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep help | flood | Shell Programming and Scripting | 3 | 06-05-2008 10:14 PM |
| Grep | Aejaz | UNIX for Advanced & Expert Users | 3 | 04-30-2008 04:10 AM |
| grep | dineshr85 | Shell Programming and Scripting | 1 | 10-10-2007 01:52 AM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| Make grep -c display like grep -n? | Jerrad | Shell Programming and Scripting | 2 | 08-24-2006 09:20 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi Frineds,
I am executing this command ls -a | grep .* on my systems but it is showing confusing output so can anyone please tell me what output it is showing. Regards-- krishna_sicsr |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Assuming you want to ouput a list of all files starting with '.' (dot) e.g. .profile, .cshrc, etc.
the easiest way is Code:
ls -a .* |
|
#3
|
|||
|
|||
|
NO I am using
ls -a | grep .* only but what output it is showing I am not getting on different systems it is showing different output. ls -a .* shows output in the form of directory within directory form. So please if are getting that what output ls -a | grep .* is showing let me know. |
|
#4
|
|||
|
|||
|
murphy's method is the better one
Please show the output, sometime, the ouput speaks better that our words RUV |
|
#5
|
|||
|
|||
|
Quote:
When we use murphy's syntax we'll get something like that : ------------------------------------------------------------------ .mh_profile .profile .sh_history .vi_history .: . VIPSCFqstat_output_archive smit.log .. VIPSqstat_output smit.script .mh_profile VIPSqstat_output_archive smit.transaction .profile XptionAudit_SuccessMessages.txt sumanta .sh_history XptionsAuditFailMessages.txt temp.598178 .ssh XptionsAuditMessages.txt tempdspmq.txt.598178 .vi_history backup test1 EBRM deploy test2 GetRateVIPSCF.gz gtb vinay HLD_LLD.zip mike vips ILLogs mqILScript.sh vipscf Mail sanjay vipsscript VIPSCFqstat_output sed wbimb6_broker ..: . .. dspmq_temp mqsi mqsiadm mqsiprd mqsitst t1917mk t5615rw .ssh: . .. known_hosts ------------------------------------------------------------------ where all the hidden files are listed including the normal files and directories. If want to list out only directories the use the conditional script for that if [ -f ] then fi OR id [ -d ] then fi where as ls -a | grep .* command will list all the files that are hidden and nonhidden files, and in those you will serach the string ".*" So obviously in different files and systems output will be different. Thanks |
|
#6
|
|||
|
|||
|
How about using "ls -a | grep \.*"?
|
|
#7
|
||||
|
||||
|
use
Code:
ls -a | grep '.*' Code:
ls -a | grep .profile .sh_history .etc |
||||
| Google The UNIX and Linux Forums |