Monday, 6 August 2018

Useful commands in Linux for specific tasks


Below are the few commands which were useful during my tasks in linux. There are so many challenges we face during our work and we always come with a solution at last. So it is good to spread that solution to everyone.
I always try to note down them in my documents. Now i will post them here in this blog.
1) RSYNC FOR LOCAL FOLDERS
Where
2) FIND COMMAND TO SEARCH FILES FOR MULTIPLE EXTENSIONS  AND FOR SINGLE FOLDER NOT RECURSIVELY
AND FILES OLDER THEN n DAYS WITHOUT RECURSIVE SEARCH
3) Script to Automate document Root and also for the sql database with logging
4) How to print options fields for user 
5) Flush home page cache from varnish in magento website.
or if you want to flush any other specific url then replace index.php to your URL.
6) How to pass password in ssh command to remote server along with multiple commands with sudo user?
Here
-p -> for asking password with sshpass – insecure method to pass password which will be visible to everyone in ps command
or
-e -> for this option we need to set ENV varibale “SSHPASS” for password
-S -> for standard input.
7) Merge two files and create a new file with complete sorted content.
8) Command to get hists per hour from apache access logs.
Will update this post later with more commands.

0 comments:

Post a Comment