Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Simple Command (head) Question Post 302071685 by jbud on Sunday 23rd of April 2006 07:12:25 PM
Old 04-23-2006
Simple Command (head) Question

Okay, this probably sounds dumb for anyone who knows the answer, but I'm completely lost. I have to use the head command to search a directory AND all of its subdirectories to display the first line of all .txt files. I know how to do this: head -1 ~/UnixCourse/*.txt, but that does not search the subdirectories. I've tried to figure it out on my own and use help resources, but had no luck. I would really appreciate if someone could save me a little time and effort by helping me out here.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SImple command question

Does anyone know the command to get the date CREATED for a file? This is driving me berserk. Windows has it. But I cannnnnnot remeber what it is in UNIX! Thanks! (4 Replies)
Discussion started by: Diabeticus
4 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. Shell Programming and Scripting

The cut command. Really simple question!

hi, sorry for asking what I am sure is a really easy question, I am wanting to cut the users real name from the output of 'finger'. $ cut -f2-3 filename is in my script but it only seems to cut the first line. I need to cut the 2nd and 3rd word from each line and store them in variables... (1 Reply)
Discussion started by: rorey_breaker
1 Replies

5. Shell Programming and Scripting

Simple question abt Copy command.

Hi ! All This is very simple question.... How to write a 'cp' command interative. Example : cp /wlsuite/om/cm/Tools/deploy_scripts/*.xml ${INF_ROOT}/tmp | echo "" || echo " Pls investigate ..." My intent was > to copy the files. > CP fails... then let know the user. pls... (2 Replies)
Discussion started by: dashok.83
2 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

Diff/head - not sure if this is the right command to use

Hi, I need some advise on whether there is a better way of doing what I am currently planning to do. Perhaps I should be using arrays instead of re-directing output to files? I need to use a tool/program named ADRCI provided by Oracle to remove trace files that it generates. Honestly it is... (1 Reply)
Discussion started by: newbie_01
1 Replies

8. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

9. Linux

A simple question about mail command

Simple question: i read mail n°4,how to return to list of messages? (2 Replies)
Discussion started by: Linusolaradm1
2 Replies
MAN(1)							    BSD General Commands Manual 						    MAN(1)

NAME
man -- display the on-line manual pages (aka ``man pages'') SYNOPSIS
man [-acw|-h] [-C file] [-M path] [-m path] [-S srch] [[-s] section] name ... man -k [-C file] [-M path] [-m path] keyword ... man -p DESCRIPTION
The man utility displays the manual pages named on the command line. Its options are as follows: -a Display all of the man pages for a specified section and name combination. (Normally, only the first man page found is displayed.) -C Use the specified file instead of the default configuration file. This permits users to configure their own man environment. See man.conf(5) for a description of the contents of this file. -c Copy the man page to the standard output instead of using more(1) to paginate it. This is done by default if the standard output is not a terminal device. -h Display only the ``SYNOPSIS'' lines of the requested man pages. For commands, this is typically the command line usage information. For library functions, this usually contains the required include files and function prototypes. -k Display the header lines for any man pages matching keyword(s), in the same manner as apropos(1). -M Override the list of standard directories which man searches for man pages. The supplied path must be a colon (``:'') separated list of directories. This search path may also be set using the environment variable MANPATH. The subdirectories to be searched, and their search order, is specified by the ``_subdir'' line in the man configuration file. -m Augment the list of standard directories which man searches for man pages. The supplied path must be a colon (``:'') separated list of directories. These directories will be searched before the standard directories or the directories specified using the -M option or the MANPATH environment variable. The subdirectories to be searched, and their search order, is specified by the ``_subdir'' line in the man configuration file. -p Print the search path for the manual pages. -s Restrict the directories that man will search to the specified section. The man configuration file (see man.conf(5)) specifies the possible section values that are currently available. -S Display only man pages that have the specified string in the directory part of their filenames. This allows the man page search process criteria to be narrowed without having to change the MANPATH or ``_default'' variables. -w List the pathnames of the man pages which man would display for the specified section and name combination. If the '-s' option is not specified, there is more than one argument, the '-k' option is not used, and the first argument is a valid section, then that argument will be used as if specified by the '-s' option. If name is given with a full or relative path then man interprets it as a file specification, so that you can do man ./foo.5 or even man /cd/foo/bar.1.gz. ENVIRONMENT
MACHINE As some man pages are intended only for specific architectures, man searches any subdirectories, with the same name as the current architecture, in every directory which it searches. Machine specific areas are checked before general areas. The current machine type may be overridden by setting the environment variable MACHINE to the name of a specific architecture. MANPATH The standard search path used by man may be overridden by specifying a path in the MANPATH environment variable. The format of the path is a colon (``:'') separated list of directories. The subdirectories to be searched as well as their search order is speci- fied by the ``_subdir'' line in the man configuration file. PAGER The pagination command used for writing the output. If the PAGER environment variable is null or not set, the standard pagination program more(1) will be used. FILES
/etc/man.conf default man configuration file. /usr/{share,X11R7,pkg,local}/man/whatis.db standard whatis/apropos database search path, set in /etc/man.conf. SEE ALSO
apropos(1), whatis(1), whereis(1), man.conf(5), mdoc(7), mdoc.samples(7) STANDARDS
man conforms to X/Open Commands and Utilities Issue 5 (``XCU5''). BUGS
The on-line man pages are, by necessity, forgiving toward stupid display devices, causing a few man pages to be not as nicely formatted as their typeset counterparts. BSD
October 7, 2011 BSD
All times are GMT -4. The time now is 06:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy