Posts tagged Linux
Linux Startup Scripts
Nov 17th
The following scripts are run by bash if the –noprofile option is not used with the shell:
Linux – I installed the x86_64 version, so why do I have i386 packages
Nov 4th
In my case
yum remove \*.i\?86
To keep 32-bit packages from being installed in future updates, edit your
vi /etc/yum.conf
and add the line:
exclude = *.i?86
Note:
Be aware that 32-bit applications, including some browser plugins that may only be available in 32-bit versions, will no longer work after this procedure so be carefully.
Copy directory structure without content.
Sep 16th
Handy command to run if you need the directory structure replicated without the content.
To demonstrate I am going to create an example directory:
mkdir /new/destination/root/
The go into the root directory you want to replicate:
cd /source/root/
and type:
find * -type d -exec mkdir /new/destination/root/\{\} \;
crontab
Sep 15th
![]()
What is crontab:
Cron is driven by a crontab, a configuration file that specifies shell commands to run periodically on a given schedule. Each line of a crontab file represents a job and is composed of a CRON expression, followed by a shell command to execute.
Uptime command
Jul 15th
![]()
The uptime command produces a single line of output that shows the current time, how long the system has been running (in minutes) since it was booted up, how many user sessions are currently open and the load averages.
Listing cron jobs
Jun 30th
If you have root access to a server and you have a large number of domains with cron jobs the easiest way to list them all is:
cd /var/spool/cron
cat *
Your output might look somehting like this:
29 2 25 * * python /var/www/vhosts/thesupportsystem.com/httpdocs/sitemap/sitemap_gen.py --config=/var/www/vhosts/thesupportsystem.com/httpdocs/sitemap/config.xml */5 * * * * php -f /var/www/vhosts/thesupportsystem.co.uk/httpdocs/email_marketer/admin/cron/cron.php 0 * * * * wget -O - -q -t 1 http://www.thesupportsystem.com/cron.php
Linux Searching All Files For A String (Recursively)
Feb 18th
Linux Searching All Files For A String (Recursively)
You can use the grep or find command to search recursivley for a string
Basic grep command
grep -ri "STRING" .
Options
| Option | Description |
| -r | recursive |
| -i | ignore case |