Locating files and directing ouput

Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory Locating files and directing ouput
# 1  
Old 03-10-2002
Locating files and directing ouput

I'm trying to locate all files that do not contain the string /usr but do contain the string csh within the file called /etc/passwd. Then I would like to direct this output to a file called pout.

Does anyone one have suggestions on this one?

# 2  
Old 03-10-2002
How about:

grep csh /etc/passwd > filename

I think that's what your were asking. -mk
# 3  
Old 03-11-2002
Try this instead...

cat /etc/passwd | grep "/usr" | grep -v "csh" > pout 2> /dev/null
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Locating shell script files with the $PATH variable

I've created a test script, which is located in $HOME/bin. The script runs as expected with no issues. However, upon echo'ing the $path variable the location of my script is not located in any of the directories listed in $path. So my question is, how does shell know where the script is located... (2 Replies)
Discussion started by: BrandonD
2 Replies

2. Solaris

Locating files!

My question is : -How do I locate files of specific user in specific folder. In other words, How do I find files that belong only to "root" user, in /etc folder? (5 Replies)
Discussion started by: alexex666
5 Replies

3. Shell Programming and Scripting

Re-directing issue.

Hi All, Have scheduled a cron entry to run once a week. 0 0 * * 1 /export/home/nz/history_load/prod/LoadManager.sh >>/dev/null 2>&1 Not sure, why this job did not got triggered last week. Want to know the reason behind not getting triggered. I was re-directing the output of... (1 Reply)
Discussion started by: Nagaraja Akkiva
1 Replies

4. UNIX Desktop Questions & Answers

Re-directing output

ps –xyz >/tmp/proc 2>&1 Can anyone explain what does '2' and '&1' will do here? Thanks to explain (1 Reply)
Discussion started by: kkalyan
1 Replies

5. Shell Programming and Scripting

Help in locating a word in huge files

hi i receive about 5000 files per day in my system. Each of them are like: cat ABC.april24.dat ABH00001990 01993 409009092 0909 INI iop 9033 AAB0000237893784 8430900 898383 AUS 34349089008 849843 9474822 AAA00003849893498098394 84834 348348439 -438939 IN AAA00004438493893849384... (2 Replies)
Discussion started by: Prateek007
2 Replies

6. Shell Programming and Scripting

Directing awk output to a folder

Dear All I have a simple bash script that creates a folder ( I called it TEMP) in the current directory. The question is: how do I direct the output of my awk script into folder TEMP? Below is my attempt: #!/bin/bash mkdir TEMP echo Enter input file: read infile awk... (4 Replies)
Discussion started by: Ghetz
4 Replies

7. Shell Programming and Scripting

directing output to multiple files

I have a script in which some outputs are directed to one file echo "Load Started" >>${LOGFILE1} If I have another file LOGFILE2 and i want to redirect the output of the above echo command to LOGFILE2 as well with the same command line... how can i do that? Thanks (2 Replies)
Discussion started by: cobroraj
2 Replies

8. Shell Programming and Scripting

Directing program output to a file

When I do time tar cvf /dev/st0 /mnt/junk >> /root/benchlog, I want it to put the output of the time command into the benchlog file, but it put /mnt/junk. How do I get it to put the output of the tar command? (1 Reply)
Discussion started by: jeriryan87
1 Replies

9. UNIX for Advanced & Expert Users

Error re-directing

Hi, I'm running a program by executing the following command... convert NA 2> compiler.err Here is the command for debugging this process in IBM debugger... idebug convert NA 2> compiler.err On executing the above command the error output from idebug process is redirected to compiler.err,... (3 Replies)
Discussion started by: fermisoft
3 Replies

10. UNIX for Dummies Questions & Answers

directing output

How do I direct the output of an at command at now < backupprogram so that I see something happening. It says the job has been executed but I am not getting the tar file that my backup program on the computer anywhere at all Please help me - I really am a struggling begginer. (1 Reply)
Discussion started by: Cynergetix
1 Replies
Login or Register to Ask a Question

Featured Tech Videos