Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find all files ending with .rb with Linux?

Tags:

linux

I am in a directory which contains more directories. What command can I use to get all files ending with .rb?

like image 378
balaji Avatar asked Mar 21 '11 11:03

balaji


People also ask

What are files with at the end in Linux?

Files with a ~ at the end of their names (for example, example. txt~) are automatically created backup copies of documents edited in the gedit text editor or other applications. It is safe to delete them, but there is no harm to leave them on your computer. These files are hidden by default.

Where is the last 30 days file in Linux?

Find files modified in last X days Here dot (.) is used to search in current directory. And -30 defines to search files modified in last 30 day. Change this number with your search requirements. You can also customize search based on file type.

What is the command to display all the files ending in txt Linux?

txt files in the directory: ls *. txt. List by file size: ls -s. Sort by time and date: ls -d.


2 Answers

You could try

find . -type f -name \*.rb 
like image 88
bmk Avatar answered Oct 03 '22 16:10

bmk


Try this find . -type f -name '*.rb'.

For a more thorough explanation, get the 'Unix Power Tools' book.

like image 31
Victor Sorokin Avatar answered Oct 03 '22 18:10

Victor Sorokin