Sponsored Content
Full Discussion: find and head -1
Top Forums UNIX for Dummies Questions & Answers find and head -1 Post 302417660 by tjmannonline on Friday 30th of April 2010 08:39:29 AM
Old 04-30-2010
find and head -1

i have lots of files in /law/prod and /law/dev, such as AP20PD, AP20WS, AP20.scr, AP20.rpt

if i am in /law DIR

Code:
find . -name AP20PD, found in /law/prod and /law/dev

i want to head -1 AP20PD from both location and >> /tmp/test.log


can i use find and head in one line ?

---------- Post updated at 08:39 AM ---------- Previous update was at 07:57 AM ----------

never mine. find . -name filename > /tmp/test.log and then i use while loop to head -1 does the trick for me. thank you anyway.

Last edited by zaxxon; 04-30-2010 at 10:25 AM.. Reason: use code tags please, ty
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help.. I am in way over my head !!!!

my boss has done it again I have been sent to fix a unix issue and I ma hoping you can help three issues 1st. I have a printer that when you try to print to it the print job comes out on a diffrent printer. If I take the printer ( dot matrix thourgh a serail connection) to a diffrent local the... (3 Replies)
Discussion started by: oberon42
3 Replies

2. UNIX for Dummies Questions & Answers

simple 'head' question

I'm sorry, but the example in the man pages was no help. I know head -5 fileName will give you the first 5 lines of the file but how do you get like the 6th-13th lines only or one line before the end of the file? Sorry I just started learning the basics..... =( (3 Replies)
Discussion started by: terms5
3 Replies

3. Shell Programming and Scripting

head command

Hi All, How can the head command be used to extract only a particular line. By default head -n filename displays the first n lines. I want only the nth line. I couldn't get it from forum search. Thanks, Sumesh (6 Replies)
Discussion started by: sumesh.abraham
6 Replies

4. Programming

http HEAD reuest

I have written a c socket programe which can send the http GET request.But it dont work for HEAD reuest.can anyone help me.I am connected to internet via a proxy and the port/ip in the programe are proxies ones -------------------------------------------------- #include <stdlib.h> #include... (3 Replies)
Discussion started by: chamaraHe
3 Replies

5. Shell Programming and Scripting

head usage

$ct=1 head -n $ct file. When i used like this, i got an error , Bad usage of head Cant we use variables in place of number in HEAD. In my requirement for every iteration i should increase the number in Head and tail the last one. HOw can i achieve this (5 Replies)
Discussion started by: vasuarjula
5 Replies

6. UNIX for Dummies Questions & Answers

alternative for head command

Hi friends,I am new to unix and this is really a dummy question.but please help me out. How to simulate head command without using head command??? also tail command too,also more command. it is given as a homework to do....please tell me how to do (2 Replies)
Discussion started by: nikhilneela
2 Replies

7. Shell Programming and Scripting

head followed by variable??

I know that the common use of head is for example head -3 etc.Is there any possibility that,if i have a variable that equals to an integer(i=5),i can write head -i?? If not,what syntax or commands should i write down in order to have the same result? //maybe something lik head -"$variable" ? (2 Replies)
Discussion started by: bashuser2
2 Replies

8. Shell Programming and Scripting

Remove head for all the files

Hi all, i need to remove the header for all the files which is ending with .csv and append into one file example, test1.csv test2.csv test3.csv i tried with the below command, sed '1d' test*.csv> appendnew.csv but it deletes only the first file header. and appending all the... (11 Replies)
Discussion started by: baskivs
11 Replies

9. Homework & Coursework Questions

Unix find and head command help

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: I've been stuck on this problem for 2 days now What command would you enter to list the first lines of all text... (11 Replies)
Discussion started by: partieboi37
11 Replies

10. HP-UX

How to find the head cleaning history on HP HP MSL4048 1 LT0-4 Ultrium 1840?

Please guide me how to get the head cleaning history on HP HP MSL4048 1 LT0-4 Ultrium 1840. (0 Replies)
Discussion started by: marunmeera
0 Replies
HEAD(1) 								FSF								   HEAD(1)

NAME
head - output the first part of files SYNOPSIS
head [OPTION]... [FILE]... DESCRIPTION
Print first 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -c, --bytes=SIZE print first SIZE bytes -n, --lines=NUMBER print first NUMBER lines instead of first 10 -q, --quiet, --silent never print headers giving file names -v, --verbose always print headers giving file names --help display this help and exit --version output version information and exit SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg. AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for head is maintained as a Texinfo manual. If the info and head programs are properly installed at your site, the command info head should give you access to the complete manual. head (coreutils) 4.5.3 February 2003 HEAD(1)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy