Category Archives: Linux Commands

Recommended Linux Commands

How to Generate SSH Keys!

To generate SSH keys, just do:

ssh-keygen -t dsa

Then do:

cat /root/.ssh/id_dsa.pub

Then copy over the whole thing into /root/.ssh/authorized_keys on the server you are trying to get connection.

 

This can be useful for setting up RSync between two servers.

Leave a comment

How to Restart Networking on Linux!

Here’s how to restart networking services on your linux webserver.  I find that especially with VPS web servers, there are times where your network gets blocked completely.

To reset, get into SSH via console on your VPS web server company’s control panel.

Type:

service network stop

then

service network start

For some web servers, you might have to use:

/sbin/service network stop

and

/sbin/service network start

Wait like 5 seconds and see if you can ping the outside world:

ping google.com

If you

Click Here to Read Full Article

Leave a comment

How to Check MySQL/PHP Version via Command Line!

To check your MySQL version via linux command line, type:

# mysql -version mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) using readline 5.0

and for PHP version:

# php -version PHP 5.2.6 (cli) (built: May 8 2008 08:53:44)

Most linux commands allow you to check the version simply by adding -version after the command.

Click Here to Read Full Article

Leave a comment

How to Run as Root on Ubuntu/Debian – Avoid Annoying SUDO!

If you are installing many programs using apt-get command in Ubuntu/Debian, you will want to avoid using sudo in front of every command.

To do that it’s rather simple, just type:

sudo /bin/bash

to enter root for good and you won’t have to type sudo in front of every command.

Click Here to Read Full Article

Leave a comment

[apt-get] How to See all Installed Packages!

To see all the installed packaged on your linux servers, you can do:

dpkg -l

which will list all installed packages on your web server.

Click Here to Read Full Article

Leave a comment

List Users in Linux!

You can use the command:

cat /etc/passwd

to list all the users in your linux system.

Click Here to Read Full Article

Leave a comment