![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix Find commands | scooter17 | UNIX for Dummies Questions & Answers | 1 | 09-11-2006 03:55 PM |
| Omitting some filenames for commands to process | milhan | Shell Programming and Scripting | 5 | 05-19-2006 07:49 PM |
| where i can find list of UNIX commands for daily operations ? | mgoutham | UNIX Desktop for Dummies Questions & Answers | 1 | 03-02-2006 02:35 PM |
| Unix History Question: Why are filenames/dirnames case sentsitive in Unix? | deckard | UNIX for Dummies Questions & Answers | 3 | 03-26-2005 01:59 PM |
| find lowercase filenames | jpprial | UNIX for Dummies Questions & Answers | 4 | 01-28-2002 04:57 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
find filenames like unix commands
Hi,
I need to write a small script to search in some specific directories to check if any file is present with a unix command name... Means if the directory contains any files like cat, vi, grep, find etc i need to list those files into a file. Please help Thanks, D |
|
||||
|
u can have a shell script like "search.sh" which accepts a directory name as an argument..
search.sh may look like #! /bin/sh DIR_NAME =$1 # u have to search for all the unix files one by one like and write to serach.log file. Below command will do the same for you #find DIR_NAME name nameoffile > search.log find DIR_NAME name cat > search.log find DIR_NAME name grep > search.log I am also new to linux.. this solution will work but only thing is the script will be as long as set of unix commands u want to find out. Cheers!! |
|
||||
|
Thanks buddies
find . -type f | grep -E "cat|vi|grep" will get any files matching the pattern. Therefore if there is a file like "catert" or "vides" they will also match cat and vi pattern and I want the exact pattern. I tried grep -Ex but not working. There fore find dir -type f -name cat -o -name vi -o -name grep is the one which can be used I believe though it will become lengthier |
![]() |
| Bookmarks |
| Tags |
| linux, linux commands, solaris, unix commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|