Results 1 to 5 of 5
I need a sed command to to print a list of files in "/home" directory, ending in ".sh"...
- 05-14-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 2
need a sed command
I need a sed command to to print a list of files in "/home" directory, ending in ".sh"
- 05-15-2009 #2Linux Newbie
- Join Date
- Jul 2005
- Location
- Australia (Down Under)
- Posts
- 141
I know you have asked for a sed command, but does it have to be a sed command? i believe that you can use grep for this.
try something likeI haven't had a chance to test this, but i believe that it would work.Code:ls $HOME | grep '.sh'
Linux is the OS of tomorrow, Here today!!
- 05-15-2009 #3
sed command used for find and replace a text/string in file
Generally /home contains all users home,something likefiles in "/home" directory
If you just want to list files from your home directory use ls command/home/lakshmipathi
/home/lg
ls -l ~/*.sh
you can use /home/your_login instead of ~
to know more about ls or find command from terminal type
HTHman ls
man find- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 05-15-2009 #4Just Joined!
- Join Date
- May 2009
- Posts
- 2
Thanks for your replies...but actually I need to use "sed" command only.....I could have used grep or awk better...but I am tied
- 05-15-2009 #5- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------


Reply With Quote
