You are not logged in.

#1 2019-02-09 14:49:39

Gugi
Member
From: Poland
Registered: 2019-01-15
Posts: 10
Website

[SOLVED] Finding all .log files

this command

find . -name "*.log" 

Can help me find all log files in linux?
any ideas?

Last edited by Gugi (2019-02-09 15:48:33)

Offline

#2 2019-02-09 14:52:47

ratcheer
Member
Registered: 2011-10-09
Posts: 658

Re: [SOLVED] Finding all .log files

find / -name "*.log"

This will find them, but you will get many error messages about directories' permissions.

Your command will only find the ones in your current directory and its subdirectories.

Last edited by ratcheer (2019-02-09 14:54:06)

Offline

#3 2019-02-09 14:56:11

Gugi
Member
From: Poland
Registered: 2019-01-15
Posts: 10
Website

Re: [SOLVED] Finding all .log files

ratcheer wrote:
find / -name "*.log"

This will find them, but you will get many error messages about directories' permissions.

Your command will only find the ones in your current directory and its subdirectories.

If i will login to root account, and use cd / to move to root directory
Its enough to find all files with "*.log" ?

#Next Question

So if i will find them all, i can find them and clear it all via root account ? If i delete them, it will automatically create new one log file?

Last edited by Gugi (2019-02-09 14:59:00)

Offline

#4 2019-02-09 15:11:38

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 2,426

Re: [SOLVED] Finding all .log files

What exactly are you trying to do, and what is your ultimate goal? This sounds like an XY problem.

Offline

#5 2019-02-09 15:19:30

Gugi
Member
From: Poland
Registered: 2019-01-15
Posts: 10
Website

Re: [SOLVED] Finding all .log files

As you ask, my ultimate goal is to find them all and with @ratcher i did it, now i can clear them or delete, and see what will happen after few days with using computer, if linux create new one, or if when i delete them, it will not exist anymore big_smile

@2ManyDogs
You are wrong, propably you dont understand my topic question, and last post after @ratcher answer, because i said all what you need to answer "#Next Question, but dont worry, now its all clearly to see.

And now i get my "Ultimate Goal"

Its ready to close thread

Last edited by Gugi (2019-02-09 15:23:19)

Offline

#6 2019-02-09 15:27:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,234
Website

Re: [SOLVED] Finding all .log files

Gugi wrote:

You are wrong, propably you dont understand my topic question

You are likely correct on both counts.  But only so because your question was extremely vague.

Do you really want just files with the .log extension?  If so, then you are all set, and you can mark the thread as [SOLVED].  If you actually want all files with potentially relevant logged data, the commands in this thread will not do that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2019-02-09 15:42:26

Gugi
Member
From: Poland
Registered: 2019-01-15
Posts: 10
Website

Re: [SOLVED] Finding all .log files

Trilby wrote:
Gugi wrote:

You are wrong, propably you dont understand my topic question

You are likely correct on both counts.  But only so because your question was extremely vague.

Do you really want just files with the .log extension?  If so, then you are all set, and you can mark the thread as [SOLVED].  If you actually want all files with potentially relevant logged data, the commands in this thread will not do that.


So would you like to help me out?

You mean about that not all Data is in .log files ? Or?

Last edited by Gugi (2019-02-09 15:44:19)

Offline

#8 2019-02-09 15:44:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,234
Website

Re: [SOLVED] Finding all .log files

With what??

I already noted I thought your question was vague.  If you really do want just files with a name literally ending in '.log' then you don't need any more help - mark the thread as solved.

If this is not what you actually want, then 2ManyDogs was correct that this is an X-Y problem.

No, not all data is in .log files.

Last edited by Trilby (2019-02-09 15:45:03)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2019-02-09 15:56:43

seth
Member
Registered: 2012-09-03
Posts: 10,589

Re: [SOLVED] Finding all .log files

@Gugi, logs exist so you can later inspect what happened. They will at last get rewritten when the logging process restarts, should not take lots of space on your HDD (compared to eg. a set of wallpapers) and there's also https://www.archlinux.org/packages/core … logrotate/

If you intend to clutter the systems history w/ "alternative facts", *.log won't cut it…

Offline

#10 2019-02-09 16:47:39

Gugi
Member
From: Poland
Registered: 2019-01-15
Posts: 10
Website

Re: [SOLVED] Finding all .log files

thanks

Offline

Board footer

Powered by FluxBB