November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Searching and File Operations in linux

TOP 10 largest file # find /var -type f -ls | sort -k 7 -r -n | head -10

FIND FILES MORE THAN 5Gb # find /var/log/ -type f -size +5120M -exec ls -lh {} \;

Find all temp files older than a month and delete: # find /usr/home/admin/Maildir/new -mtime +30-type f | xargs /bin/rm […]

use awk command in linux?

1. list content of file myfile # [localhost@localhost ~] $ cat myfile apple orange mango

banana GUAVA ra dish pineapple

2. delete the first line of the file # [localhost@localhost ~] $ sed ‘1d’ myfile orange mango

banana GUAVA ra dish pineapple

3. delete the third line of the file # [localhost@localhost ~] $ sed […]

How To Capture Packets with TCPDUMP?

See the list of interfaces on which tcpdump can listen # /usr/sbin/tcpdump -D

Listen on any available interface # /usr/sbin/tcpdump -i any

Verbose Mode # /usr/sbin/tcpdump -v # /usr/sbin/tcpdump -vv # /usr/sbin/tcpdump -vvv # /usr/sbin/tcpdump -q

Limit the capture to an number of packets N # /usr/sbin/tcpdump -c N

Display IP addresses and port numbers […]

INCREMENTAL BACKUP USING rsync COMMAND

SIMPLE INCREMENTAL BACKUP USING rsync COMMAND

Backups can be classified to two types.They are

1)Full backup The entire data will be backup will be taken every time

2)Incremental backup

Incremental backup take the full backup at the first time ,from the second time it will compare the files in first backup and the files in […]

linux log files, location and description

linux log files, location and description Linux stores logs of almost everything from user accounting to system halts. These logs are always useful to debug problems or track the loophole of any configurations. Logs are the records of system activity to assure the faults, traffic activities, configuration logs, user activity logs. Main Linux log files […]

Linux filesystem security scans

Either they are intentional or not, system misconfiguration can lead to very big problems. For example :

Corruption or deletion of important system files Integrity failure (ex. eavesdropping on private data) Privilege escalation Backdoor/rootkit installation

To avoid these problems you should regularly scan your system for known “misconfiguration patterns”. This article will explain how to […]

Certmonger breaks boot on linux 6.x

Usually it will hang after Starting certmonger: [OK]

Startup the hanging machine (H1) From another machine do:

> ssh H1 > su > mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

Now restart H1.

You can have more explanations by doing a “tail -n 200 /var/logXorg.0.log” on the hanging machine.

just found a strange bug when installing Oracle Linux 6.5. […]

SSH password authentication

There are times when you really want to get rid of SSH password authentication, however SSH is VERY picky about permissions etc. I just found out that there’s a tool for that in all Linux boxes!

As promised, the two simple steps:

Create your keypair (assuming you don’t already have it ready) $ ssh-keygen -t […]

Install Rootkit Hunter Centos 7 / 6 / 5

Rootkit Hunter (rkhunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. Rootkits are self-hiding toolkits secretly installed by a malicious intruder to allow that user to gain access to the server. Rootkit Hunter offers protection by comparing SHA-1 hashes of important files with known good ones in a online database […]

FSCK on an LVM

Running FSCK on an LVM (Logical Volume Manager) using Linux Rescue Disk

i am not a linux expert and so when I have problems from time to time I usually have to go searching for the answer. It usually takes me looking at several articles to get my answer and when I am finished I […]