Linux command and main system log

Asked By 10 points N/A Posted on -
qa-featured

What is the command used to identify the number of files and the amount of disk space that is already used and also the status of the quota from each user? What is the default name and path of the Linux main system log? Can anyone answer this? Thanks.

SHARE
Best Answer by Tony clever
Best Answer
Best Answer
Answered By 20 points N/A #118093

Linux command and main system log

qa-featured

Hi friend,

The series of the command used to identify the number of file is :

Go to directory: find /home -user joe

 Find user name: find /usr -name *stat
 Find every file under user: find /var/spool -mtime +60
 Find every file under directory: find /tmp -name core -type f -print
 For count the number of files: find / ( -perm -4000 -fprintf /root/suid.txt '%#m %u %pn' ), 
( -size +100M -fprintf /root/big.txt '%-10s %pn' )

And Linux command for find disk space:

cd /

du -hc –max-depth=1

This will show result like this:

[root@hostname /]# du -hc –max-depth=1
0 ./net
1.6G ./usr
16K ./lost+found
515M ./proc
8.0K ./misc
648M ./var
112K ./dev
8.0K ./mnt
66M ./lib
8.0K ./selinux
7.3M ./bin
77M ./root
4.2M ./boot
28K ./tmp
2.7M ./backups
20M ./sbin
8.0K ./media
8.0K ./srv
0 ./sys
43M ./etc
42M ./home
8.0K ./opt
3.0G .
3.0G total

Answered By 0 points N/A #118094

Linux command and main system log

qa-featured

 

To list the number of files in the `/usr/share' directory owned by user u1:
# find /usr/share -user  u1 ! -type d | wc -l

Disk space used by a user
# find . -user user1 -type f -exec du -h {} ;

Quota status
#quota -u user_id

There are three centralized logging demons
1)syslogd
2)klogd
3)auditd

klogd:- collect log file created by the Kernel
syslogd:- Collect log file created by the system
auditd:- Collect log file created by the SELinux

System store logs on different location
/var/log/dmesg:- Created at boot time, by kernel
/var/log/messages:- standard system error message,
/var/log/secure:- authentication related log
/var/log/maillog:- Mail related log
/var/log/audit/audit.log:-Selinux related log

We can redirect the log by configuring
/etc/sysconfig/syslog
/etc/syslog.conf

Related Questions