when less invoked... what is the " log file "!?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers when less invoked... what is the " log file "!?
# 1  
Question when less invoked... what is the " log file "!?

Smilie I have been through the man pages and am not understanding the purpose of even what is a "Log File:"... I would like to be be able to access this application.. since it looks like something i could use but i am not sure what it is.. can some one clarify the matter.. and how to use it...
thanx moxxx68..Smilie
# 2  
I'm not sure ... whether i have understood you correctly.

But here is advantage and using of logfiles.

Logfiles fecilitates you to see what happened to yr out put statements such as "echo " .... etc.

u can have history of the cmds that run as crons which outputs on shell ; The o/p is lost if the shell is lost.

If we write them as logfiles ... u can revisit yr o/p again ...

Here is an example ... how to write into the logfile ...

exec >> ./logs/logfile 2>&1

echo `$TIME` "----------- TODAY IS `date` ---------------\n"
echo $PATH
echo "Hello ..."

Check the ./logs/logfile ... u get all echo outputs would be writen there.
# 3  
MySQL thanx...!

Smilie sort've like a usage journal of sorts... !!? are the logfiles under one datafile or are there.. extensions to different log.files.. if so how would i access them through less? use Examine: ?
thanx moxxx68
# 4  
I use more. Not that it matters all that much.

more file.log

Use the /<search pattern> to find words like Error, or whatever would indicate some sort of problem in a big log file.

However for large files or lots of files, grep is loads better -- if you know what word(s) indicate some sort of problem or error condition.
# 5  
MySQL much thanx for your rapid reply

Smilie thanx alot.. I think I can figure it out from here, your advice has been very helpfull indeed..
thanx moxxx68Smilie

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #438
Difficulty: Medium
TypeScript is a free and open-source subset of JavaScript developed by Microsoft.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

5. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

6. Shell Programming and Scripting

Script invoked using "sh" is not executing. Urgent help required

Hi , I am new to shell scripting. I am using Linux for doing scripting. Below is my script, which takes 2 parameters as input. test.sh has the below: #!/bin/bash . $HOME/.profile gpg --yes --no-use-agent -r "$(eval echo \$$2_Var)" -e $1 1st parameter is command line... (7 Replies)
Discussion started by: rangarb
7 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

Featured Tech Videos