Unable to list particular file in dir.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unable to list particular file in dir.
# 1  
Old 10-01-2013
Unable to list particular file in dir.

Hi

i am trying to list all the file starting with CSA.CHENAISCP* i am using below command to do that

Code:
ls -lrt | grep CSA.CHENAISCP*

however i am getting below error.
Code:
0403-027 The parameter list is too long.

please suggest me some alternative way.

scriptor
# 2  
Old 10-01-2013
Try:
Code:
ls -lrt | grep '^CSA.CHENAISCP'

# 3  
Old 10-01-2013
i am getting no o/p . although there is a lots of files
# 4  
Old 10-01-2013
Ouch. Yes, sorry. I obviously need some sleep.

As long as you don't have any filenames containing a space character followed by your search string, try:
Code:
ls -lrt | grep -F ' CSA.CHENAISCP'

Or, if your version of grep doesn't have a -F option, try:
Code:
ls -lrt | fgrep ' CSA.CHENAISCP'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

2. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

3. HP-UX

NFS Client unable to access shared DIR's

I ve a client : <clientname> and a server: <servername> Both of them running: HPUX B.11.31 SERVER outputs: I ve shared a folder in <servername> called /test and the O/P for # exportfs - /test root=<clientname>,rw=<clientname>,ro "" # showmount -e export list for... (6 Replies)
Discussion started by: Amit Kulkarni
6 Replies

4. HP-UX

Unable to Set Prompt to current working DIR

HPUX does not recognise \h,\w,\u to display the hostname,working directory and username respectively. So how do i set the PS1 variable to display my current working Directory as my prompt? I also tried PS1=$PWD, But it keeps showing the same directory path as prompt which PWD was holding at... (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

5. Shell Programming and Scripting

how to list of file in home dir ?

I want to print all list of file in the home dir of the user in $i with full bath an owner and group and permissions (1 Reply)
Discussion started by: testman84
1 Replies

6. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

7. UNIX for Dummies Questions & Answers

unable to set user home dir

I created a new user and changed their home directory to /export/home/mydir/ I verified in the passwd file that the home directory is set to the above and that owner of that directory is the new user and yet when I log in as that user I get the following message: No directory! Logging in with... (14 Replies)
Discussion started by: some_one
14 Replies

8. Shell Programming and Scripting

List file in Dir and then match

Hi ALL, I am making a script that search all then worldwriteable dir in documentroot.I have manage to find all the dir now i want to match each file extension in worldwriteable against a list of array which contain file like php html etc,if i find any file then print dirname. Dont see to get any... (8 Replies)
Discussion started by: aliahsan81
8 Replies

9. UNIX for Dummies Questions & Answers

Searching list of entries in file for actual files in dir

Hi all, I have a file entries.txt that contains a number of entries all on seperate lines e.g. test1 test2 test3 test4 Then in a directory called /TestFiles I have a number of files that could contain the above text in the file name e.g. qwertytest1.csv qwertytest2.csv... (2 Replies)
Discussion started by: not4google
2 Replies

10. Shell Programming and Scripting

how to create new dir fro a file list

Hi, What will be the best way to do the follwing: i have a file calld dir.list /cav /cav/brif /usr/main /cat i want to run a script that will take each of the item in the file and create a new dir in a location that i'll choose it nee to do mkdir cav mkdir cav cd cav mkdir brif... (8 Replies)
Discussion started by: banjo
8 Replies
Login or Register to Ask a Question