//
archives

Linux Command

This category contains 4 posts

use ‘sed’ to list all content of a file after a specified word in Linux

In many cases, DBAs need to check the database log file. But if the database log contain million of rows how do we check the log by Date. Use ‘cat’ command will be very time consuming. Here is an example: Advertisements

Linux ‘df’ command and example (Keep add on)

Linux ‘df’ command and example List all volumes information on the server df -H | grep -vE ‘^Filesystem|tmpfs|cdrom’ | ${AWK_BIN} ‘{ print $5 ” ” $1 }’ | while read output;

Linux ‘find’ command and example (keep add on)

Linux ‘find’ command and example Find all .xml files in the target folder and tar into one .gz file find /target_folder -mtime +5 -name “*.xml” -type f -exec tar -cvf temp_log_xml.tar {} \; Find all .xml files created 5 days ago in the target folder and delete it find /target_folder -mtime +5 -name “*.xml” -type … Continue reading

Linux ‘du’ command and example

Linux ‘du’ command and example List all sub folders and its’ size bigger than 1GB du -h –max-depth=1 /folderLocation | grep ‘[0-9]G\>’