TITLES: || HOME | Contact
Us || || Add Command || AliasesBackupcpInsertion of a password into a pdf filePlay video DVD ISO file with XineQuick format of CD-RWRemoving old kernelsSearchingSplitxorg.conf ModeLine
|
Showing SearchingScroll Down to see the comments / add comments Submitted by: Will | Total Views: 304 There are several ways to search for files
I came up with a little bash script which you can use for searching for files:
#!/bin/bash
## INSTALLATION:
## MAKE A FILE se AND PLACE IT IN THE /USR/BIN DIRECTORY, YOU MUST BE ROOT TO DO THIS
## CHMOD IT TO 700 - CHANGE OWNERSHIP chown user:user se
## TYPE IN se AT THE TERMINAL AND YOU SHOULD SEE "What file to search for?"
## ANY QUESTIONS VISIT HTTP://CODE-HEADS.COM
echo "CodeHeads File Search"
read -p "What file to search for?? " FIL
if [[ $FIL == "" ]]
then
echo "Sorry need a file to search for"
else
read -p "What directory?? " DIR
if [[ $DIR == "" ]]
then
echo "Sorry need a directory to search under"
else
echo; echo "List of files found"
du -a $DIR | grep $FIL
fi
fi
You can also use find:
find [text]
This only finds files in the current directory you are in.
Locate is another option:
locate [file]
You may have to issue this command before using the locate command:
updatedb
It will tell you if you need to do this. | Add Comment | Comments
|