Unix basic help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix basic help
# 1  
Old 08-24-2006
Unix basic help

What command would I use to list the first lines of all
text files within my Unix directory or within any directory
inside there? I was using "find" , "head" and "-exec" commands like this:

find ~/Unix -name "*.txt" -exec head {} \;

But its not perfectly working, please help me. thanks
# 2  
Old 08-24-2006
This might work?
Code:
for file in ~/Unix/*.txt; do
   head $file
done

# 3  
Old 08-24-2006
Try...
Code:
find ~/Unix -type f -name '*.txt' -print | xargs head

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Basic doubt in UNIX

Hi, I'm new to this and very much interested to learn unix. Can any one explain me the symbols y we use this is scripting(~ and $). It would be great if some one explain with the eg. Thanks Naveen A (2 Replies)
Discussion started by: Pranaveen
2 Replies

2. Shell Programming and Scripting

Basic Unix cp command help

I am new to unix so this is probably a pretty basic question. I am trying to write several commands on one line that creates a directory called bf in the current directory, then copy all files within that directory and any subdirectories, that do not start with the letter c to the new bf folder.... (5 Replies)
Discussion started by: scotty85
5 Replies

3. UNIX for Dummies Questions & Answers

Basic UNIX Training

I'm wondering where a good place to start is for basic UNIX training. Due to a shift of responsibilities at work, I am now the admin for a product called AutoSys. I have close to zero knowledge in the subject area. :wall: (3 Replies)
Discussion started by: Cjw_55106
3 Replies

4. Solaris

Basic FAQS in unix

can any body tell me this followings in details when do we use this & in which senario we most use this 1.GSD raising 2.MOSFET checks 3.Audit remedation 4.KBS fixes thanks in advance (0 Replies)
Discussion started by: wkbn86
0 Replies

5. Solaris

basic unix question

Hello, I'm new to solaris and have an experience with linux. When we see network interface I can see qfe, hme, le0. What is that mean? Is it depend on the network card? (11 Replies)
Discussion started by: mokkan
11 Replies

6. UNIX for Dummies Questions & Answers

Need help with basic unix script

What I am supposed to do is creat a menu with the following Find a song Find a album Sort by artist Delete a song Add a new song Quit Now the file with the song information is database Here is what I have so far #!/bin/bash #================================================= #Script Name:... (1 Reply)
Discussion started by: stp0052
1 Replies

7. UNIX for Dummies Questions & Answers

Basic Unix Questions

OK, here's a question from a true UNIX newb: How does one make a 20 line file? I'm lost. :confused: OK, I figured it out. :D (0 Replies)
Discussion started by: Kitchen Zinc
0 Replies

8. IP Networking

basic question about UNIX?

With not knowing absolute nothing about Unix can anyone let me in on how it is setup and how easy is it to learn?I'm using MML Commands and know that it is completely different but if I start learning commands in UNIX is that a good way to get started? (1 Reply)
Discussion started by: RoliOCon
1 Replies

9. UNIX for Dummies Questions & Answers

Basic unix

okay, im having some trouble. Go ahead, call me a retard, but i keep getting stuck. Suppose i want to open a Picture of Jesus(for the sake of simplicity) using unix. I type: open Desktop/Pictures/Jesus.jpg It opens, and its all well and good. But, suppose i want to open a picture called Joe... (4 Replies)
Discussion started by: HipCracka
4 Replies

10. UNIX for Dummies Questions & Answers

Unix basic commands

I need a sheet with the basic unix commands , and commands for VI editor. Does anyone know where i can get them. (3 Replies)
Discussion started by: Peter Spellman
3 Replies
Login or Register to Ask a Question