list files commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting list files commands
# 8  
Old 04-16-2008
Quote:
Originally Posted by era
(Weird, double post, sorry.)
era,

thanks a million Smilie it works!

wee
# 9  
Old 04-16-2008
Quote:
Originally Posted by lweegp
era,

thanks a million Smilie it works!

wee
ooops....it does not work...got the following:

spids111% ls -ltr | grep 2004....\.txt$ | xargs rm
rm: illegal option -- w
rm: illegal option -- -
rm: illegal option -- w
rm: illegal option -- -
rm: illegal option -- -
rm: illegal option -- -
usage: rm [-fiRr] file ...

somewhere went wrong? apologies...Smilie

wee
# 10  
Old 04-16-2008
Yes, take out the options from ls, you just want the file names -- it's trying to remove the permissions, the owners, and the date stamps, too. Oops.
# 11  
Old 04-17-2008
Quote:
Originally Posted by era
Yes, take out the options from ls, you just want the file names -- it's trying to remove the permissions, the owners, and the date stamps, too. Oops.
hi era,

sorry for the trouble...Smilie

i try the following:

spids111% grep 2004....\.txt$ | xargs echo

but nothing returns...some part went wrong? thanks.


wee
# 12  
Old 04-17-2008
You took out too much. You still need ls to list the files, only not in "long format".

Code:
ls | grep 2004....\.txt$ | xargs echo rm

I put in an "echo" so you see what it's doing. Take out the echo if the result looks correct.
# 13  
Old 04-17-2008
Quote:
Originally Posted by lweegp
hi era,

sorry for the trouble...Smilie

i try the following:

spids111% grep 2004....\.txt$ | xargs echo

but nothing returns...some part went wrong? thanks.


wee
hi era...wonderful!! it works perfectly fine now! thanks so much!!Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to save and run a list of commands?

Dear every one, I am working with the data of my lab program and I have to do many times by the same list of some commands (grep, then save to file, then use awk to delete odd lines, save to file, use awk to delete even lines, save to file...). Is there any way to save a list of command which I... (4 Replies)
Discussion started by: phamnu
4 Replies

2. UNIX for Dummies Questions & Answers

sudo commands list

Hi, Can you please give me a list of commands executed through 'sudo' command, thank you. (1 Reply)
Discussion started by: Dev_Dev
1 Replies

3. UNIX for Dummies Questions & Answers

how to know the list of all commands supported by unix ?

how to know the list of all commands supported by unix. how to know the list of functions supported by unix. (4 Replies)
Discussion started by: Gopi Krishna P
4 Replies

4. Shell Programming and Scripting

List of internal commands ??

Dear Sir/Mam, Can you tell me list of internal commands which are easy to implements...??? Means sir I am a beginner in unix shell programming. So, I just wanted to know that which internal commands are easy to implements in C language. thanks.... (1 Reply)
Discussion started by: ranusahu
1 Replies

5. UNIX for Dummies Questions & Answers

Command for maintaining the list of commands used

Hi, There is a command by which you can maintain a list of commands previously typed. By this you dont have to type in the same command again and can use the up-down arrows to scroll through the list. Which is this command, i am not able to recall. (8 Replies)
Discussion started by: appledrive
8 Replies

6. UNIX for Advanced & Expert Users

Comparison List of commands

Hi, I would like to have a list of commands in a table, see below example Command description HPUNIX SUN UNIX IBM AIX all above i need comparison list of commands ASAP please.......... B.R (1 Reply)
Discussion started by: f_amshan
1 Replies

7. Solaris

List of Commands

Dear All, I am a new Administrator of Solaris in the company , I need a list of the commands pls ... Regards Adel (2 Replies)
Discussion started by: ArabOracle.com
2 Replies

8. UNIX for Dummies Questions & Answers

A Thorough List of FreeBSD commands?!?

I was just wondering if anyone knew of a site that covered all or many of FreeBSD's built in commands. I would also like to know what FreeBSD automatically logs, and where it logs it. Thanks! (1 Reply)
Discussion started by: Kyser_Soze
1 Replies

9. UNIX for Dummies Questions & Answers

List of Commands for Unix Please

Hello, I have recentlly been given access to a Unix based server in order to learn how to operate a Unix machine.. i have never used Unix before and am in need of a list of commands and there functions.. if you have one available please send it to me in .txt or wordpad document form.. thank you in... (5 Replies)
Discussion started by: ShdwMaster
5 Replies
Login or Register to Ask a Question