+3 votes
in Operating Systems by (11k points)
I want to search all ".log" files that are being creatd by the system on my VPS. How can I check using "find" command?

1 Answer

+1 vote
by (15.1k points)

SSH to your VPS and type the following command.

# find / -type f -name "*.log"

/var/lib/mysql/tc.log

/var/log/fail2ban.log

/var/log/cwp/cwp_api.log

/var/log/cwp/cwp_cron.log

/var/log/cwp/cwp_backup.log

/var/log/cwp/gui.log

/var/log/vmware-vmsvc.log

...

...

...

Check out some of these details about find command. You can always use "man find" to check more details.

To find a file by name, use the command:

find -name "query"

To find a file by name, but ignore the case of the query, use the command:

find -iname "query"

To find a file by type, use the command:

find -type 'type_descriptor' 'query'

Some of the most common descriptors are as follows:

f: regular file

d: directory

l: symbolic link

c: character devices

b: block devices

...