Commonly Used Linux Commands

1. Check User history

				
					adquery user u1234567
				
			

2. Copy file using SCP

				
					sudo scp /home/u1234/java-4.51.00.tar.gz u5678@ec23456.arn1234.aws.com:/data/TEMP

				
			

3. Send file as mail through Linux.

In below command, the echo part gives the body, -s gives the subject, -a is the path of file and email address at the end

				
					echo "please find the file" | mailx -s "server load logs" -a load.logs useremail@domain.com
				
			

4. Extract specific parts of a log file

* use this command carefully as it is a low-level data copying and conversion tool. It is very powerful but also potentially dangerous if used incorrectly, as it can overwrite data or disks without warning.

				
					dd if=serverbkp.log bs=1G skip=117 count=2 of=/home/u12345/processed_dd.log
				
			

4. Find files larger than 100mb.

				
					find /opt/java/logs/ -type f -size +100M -exec ls -lh {} \;
				
			
FacebookWhatsAppPinterestTwitterEmailShare

Leave a Comment

FacebookWhatsAppPinterestTwitterEmailShare
Exit mobile version