Skip to main content

General linux commands

When I have started working on linux platform, i was unable to work. And I m writing this myself actually so that i can get help form this post to know about particular command and this post can also help others. I will be covering all below questions.

How to find pid of program like firefox?
How to find out the current running kernel version?
How to find a file with .txt extension in particular directory?
How to find a file containing word 'hello' in particular directory?
How to change ownership recursively?
How to change permissions on directory recursively?
How to login using ssh?
How to check if package is installed Let for example if we want to check if apache is installed?
How to check for processes listening on port 80?
How to check for a procesess files are located?
How to Zip a folder in linux?
How to remove directory in linux?

How to find pid of program like firefox?
ps -aux | grep firefox
How to find out the current running kernel version?
cat /proc/version
How to find a file with .txt extension in particular directory?
find /var/www/html/ -type f -name "*.txt"
How to find a file containing word 'hello' in particular directory?
grep -r "hello" /var/www/html/
How to change ownership recursively?
chown -R testuser /var/www/html
How to change permissions on directory recursively?
chmod -R 775 /var/www/html
How to login using ssh?
ssh user@localdomain.com -p 22 v How to check if package is installed Let for example if we want to check if apache is installed?
dpkg --get-selections | grep apache
How to check for processes listening on port 80?
sudo lsof -nPi | grep ":80 (LISTEN)"
How to check for a procesess files are located?
which apache2
How to Zip a folder in linux?
zip -r
How to remove directory in linux?
sudo rm -rf folderName

Comments

Popular posts from this blog

PHP DATABASE CONNECTION

//connecting to db $conn = mysql_connect("localhost","peter","abc123"); if (!$conn) { die('Could not connect: ' . mysql_error()); } // some code mysql_close($conn); // closing connection //query db $data=$conn->query("SELECT * FROM myTable "); foreach($data as $row) { print_r($row); }

CUSTOM WHERE CLASS IN SUGARCRM DASHLETS

How to add custom where class in sugar dashlets??? for example if you want to see top opportunities dashlet containing only filtered opportunities on some condition then you can do this as below require_once(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.php’); class MyOpportunitiesCustomDashlet extends MyOpportunitiesDashlet { function MyOpportunitiesCustomDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; require(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php’); parent::MyOpportunitiesDashlet($id, $def); } function process($lvsParams = array()) { $lvsParams = array( ‘custom_select’ => ”, ‘custom_from’ => ”, ‘custom_where’ => ‘ AND opportunities.sales_stage=\’Qualification\”, ‘distinct’ => true ); parent::process($lvsParams); } } these codes are only hints, you should know where these piece of codes should be placed to be working..

AJAX BANNED MODULES

In SugarCRM if you want to ban ajax only for particular modules then go to your config_override.php file and add this code $sugar_config['addAjaxBannedModules'][] = “KReports”; //disable ajaxgui for specific module in config override. Now you have done