Linux

How to install Apache together with PHP5 on Ubuntu

H

How to install Apache together with PHP5 on Ubuntu? This becomes very handy if you wish to do some PHP development on Ubuntu.   Open a new terminal window (CLI) Execute the following commands: sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 Now we need to restart Apache so that our changes can take effect. There are two commands for you to...

How to install MySql Server 5 on Ubuntu

H

NOTE: Tried and tested on Ubuntu 10.04

Open a new Command Line Window 
Execute the following command to install MySql Server 5

sudo apt-get install mysql-server

If you wish to use MySql together with PHP 5 you will need to install the PHPmodule for MySql 5. To do this open a Command Line Window and execute the following command

sudo apt-get install php5-mysql

How to search and replace text within a text file using the Command Line on Linux

H

This can be accomplished by using the sed command. sed =  stream editor for filtering and transforming text   For this example we will have a file called test.txt that contains the following text “This is a test file with some test information, containing some test data.“ We want to replace all instances of test in the file with cool and save the output to a new file called cool...

How to install Google Earth in Ubuntu

H

Open a new Terminal Window 
Type in the following command and hit Enter to download the installation file (Binary File).

wget

Run the command below to make the bin file executable

chmod +x GoogleEarthLinux.bin

Now we need to execute the bin file to install Google Earth.

./GoogleEarthLinux.bin

How to reset a forgotten Ubuntu password

H

Boot up your System When the Grub screen appears choose “Ubuntu x.xx, kernal x.x.x-xx-generic (recovery mode)”. The x’s are in the place of the version numbers On the next screen select “Drop to root shell prompt” Once in the root shell prompt use the passwd command to reset your password password USERNAME Replace USERNAME with the username who’s password you...

How to search for files on the command line in Linux

H

By using the find command we can search for files and directories using the command line. The find command uses a raw search to find files and directories. The usage is find [PATH] [OPTIONS][SEARCH CRITERIA] Example: find /home/ -name test The example above finds all files/directories within the home directory that contain the word test Below are different common options that can be used together...

Ubuntu Panel is missing on Ubuntu 10.10

U

Open the command line, to do this right click on the Desktop and select Create Launcher… In the Command text field type in gnome-terminal and in the Nametext field Terminal click OK A new shortcut called Terminal will appear, double click on it to Open a new Terminal window Type the following command killall gnome-panel Create another Launcher as in step one type in the command text...

How to get information about your laptop battery using the Command Line within Linux

H

Open a new command line window and type in the following command cat /proc/acpi/battery/BAT0/info   This will display all information about your battery present:                 yes design capacity:         7200 mAh last full capacity:      2732 mAh battery technology:      rechargeable design voltage:          11100 mV design capacity warning: 135 mAh design capacity low:     94 mAh cycle...

How to find files in a directory that where modified in the last 14 days using Linux

H

Type in the following command

find /var/www/ -mtime -14

this will find all files that where modified within the last 14 days within the /var/www/ directory. We use the -mtime test to get all the modified files.
 
To only find .txt files that were modified within the last 14 days within the /var/www/directory we would use this command

find /var/www/ -mtime -14 | grep '\.txt'

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me