display certain files ending

Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions display certain files ending
# 1  
Old 09-23-2011
display certain files ending

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

how to display a listing of all the files ending in txt using one command.

2. Relevant commands, code, scripts, algorithms:

ls i guess i can't figure it out, basically display the ending

3. The attempts at a solution (include all code and scripts):
ls .txt
ls -r .txt
ls -la .txt

cant figure it out

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

FSU, Tallahassee, FL, USA, Prof. Rob, COP 3353

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
# 2  
Old 09-23-2011
Hint -- Think wild card.
# 3  
Old 09-23-2011
no clue about wild cards
# 4  
Old 09-23-2011
Have a read though the ls section on this page:

# 5  
Old 09-26-2011
3. The attempts at a solution (include all code and scripts):
ls .txt
ls -r .txt
ls -la .txt

cant figure it out
you were almost right, if you haven't got it by now try the following:

ls -a *.txt

the -a shows hidden file as well, and the * is a wild card means anything.

so *.txt is anything that ends .txt.
This User Gave Thanks to Tommyk For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

General find /grep question: files with lines ending in r

I am trying to find files that have lines in them that end in an r. I have been able to locate files by using the following command: find . -type f -name "*RECORDS"| xargs grep -l r$ However, I now want to find files that don't end in r anywhere. That means that no sentences or lines in... (9 Replies)
Discussion started by: newbie2010
9 Replies

2. Shell Programming and Scripting

Find out if multiple files have lines ending with"r"

I am trying to find out which files in a group of files have lines ending in r. What I have is this: cat /tmp/*RECORDS| if grep r$>/dev/null; then echo "yes";else echo"no";fi Records is more than one file. There are the following files TEST-RECORDS /volume/testing /volume/programs ... (2 Replies)
Discussion started by: newbie2010
2 Replies

3. UNIX for Dummies Questions & Answers

Sorting files ending in numbers with "sort"

I have a group of files that I need to be sorted by number. I have tried to use the sort command without any luck. ls includes* includes1 includes10 includes11 includes12 includes2 includes3 includes4 includes5 includes6 includes7 includes8 includes9 I have tried ls includes*... (6 Replies)
Discussion started by: newbie2010
6 Replies

4. UNIX for Dummies Questions & Answers

Listing files in a Unix Directory ending with .....

Hi Unix Gurus, I need to list all files in a Unix Directory which either end with a .pdf or .rtf and they should be case insensitive ie .Pdf , .pDF , .RtF etc are also possible. How can i accomplish this with with a ls command ? If not then a find command. (6 Replies)
Discussion started by: pchegoor
6 Replies

5. Shell Programming and Scripting

if statement to check files with different ending but same starting name

I am trying to check if files staring with filename but ending with diffent dates e.g. filename.2011-10-25. The code I am using is below if It works find only if one file is present but returns binary operator expected when there are mulptiple files. Please help me correcting it. I... (5 Replies)
Discussion started by: ningy
5 Replies

6. Shell Programming and Scripting

Convert directory of text files to Unix/Linux Line Ending

I need help converting a directory of *.txt with Windows line ending to UTF-8 character encoding and Unix/Linux line ending. (9 Replies)
Discussion started by: chipperuga
9 Replies

7. Shell Programming and Scripting

move files not ending in .sh

Hi I have a list of files under a directory , for eg drwxr-xr-x 2 beauser bea 6 Mar 16 15:43 security.20110316.stress -rw-r--r-- 1 beauser bea 41063 Mar 16 17:30 config.xml.20110316_1 -rw-r--r-- 1 beauser bea 423930597 Mar 16 23:29 jra_managed1_20110316.jfr... (12 Replies)
Discussion started by: pkabali
12 Replies

8. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

9. Shell Programming and Scripting

Delete files in a folder with a specific ending

Hi I have files that end with .txt.txt that i want to delete. But I also have files that end with .txt that I want to leave intact. How do I specifically delete files that end with .txt.txt in a folder. thanks (5 Replies)
Discussion started by: kylle345
5 Replies

10. UNIX for Dummies Questions & Answers

Find files and display only directory list containing those files

I have a directory (and many sub dirs beneath) on AIX system, containing thousands of file. I'm looking to get a list of all directory containing "*.pdf" file. I know basic syntax of find command, but it gives me list of all pdf files, which numbers in thousands. All I need to know is, which... (4 Replies)
Discussion started by: r7p
4 Replies
Login or Register to Ask a Question