Sunday, April 30, 2017

Some Linux Commands

How to delete files older than 3 days:
find . -name ‘*.*’ -mtime +3 -exec rm {} \;

How to list files modified in last 3 days:
find . -mtime -3 -exec ls -lt {} \;

How to sort files based on Size of file:
ls -l | sort -nrk 5 | more

How to find CPU & Memory:
cat /proc/cpuinfo
cat /proc/meminfo

How to find if any service is listening on particular port or not:
netstat -an | grep (port no)
Example :
netstat -an | grep 7001

How to find Process ID (PID) associated with any port:
lsof | grep 7001

How to find a pattern in some file in a directory:
To find pattern in particular file :
grep pattern file_name
To find in all files in that directory
grep pattern * 

How to create symbolic link to a file:
ln -s target source

No comments:

Post a Comment

SQL query to find whether OdiSendMail is configured or not ODI 12c

In the SQL developer connect to the ODI work repository user (Ex: DEV_ODI_REPO) and run the below query. select SCEN_NAME,TASK_NAME3,DE...