Useful Linux Commands

A growing list of commands that are helpful to the new Linux user. If there are commands that you would like to see added to the list, post them in the comments and I'll be sure to put them on the list.

Operation Command
Return information about an SSL certificate. # openssl s_client -connect servername:443
Stop, Start or Restart Apache. # /etc/init.d/apache2 stop
# /etc/init.d/apache2 start
# /etc/init.d/apache2 restart
A file containing passwords for users on your system. # /etc/passwd
Display currently mounted devices on your system. # /etc/mtab
Display the setup of printers on your system. # /etc/printcap
Display CPU information. # /proc/cpuinfo
Display Linux version and other useful information. # /proc/version
Update apt-get repositories. # apt-get update
Upgrade all apt-get packages. # apt-get upgrade
Install a package with apt-get. # apt-get install *package
Remove a package with apt-get. # apt-get remove *package
List directory contents. # ls
Move a file. # mv *filename *destination
Perform a command with root privileges. # sudo *

Comments

  1. Paul (not verified)
    Fri, 01/22/2010 - 11:14pm

    This list comes in very handy!

  2. John Minton (not verified)
    Wed, 01/27/2010 - 10:55am

    I have recently started using Ubuntu Server LTS 9.x and I have found that different linux flavors are different from each other in not only their GUI, but their command line / terminal as well.

    Here are some commonly used commands for Ubuntu Server LTS 9.x:

    #Upgrades the apt-get repositories.
    apt-get update

    #Upgrades anything that was installed with apt-get.
    apt-get upgrade

    #installed OpenSSH for terminal.
    apt-get install openssh-server

    #Install an ssh client.
    apt-get install openssh-client

    #Uninstalls a program installed with apt-get. #Example: apt-get remove openssh-client
    apt-get remove program-name

    #Chmod Recursive and Verbose (print to screen)
    chmod -R -v 0770 /path/file

    #Chown Recursive and Verbose (print to screen)
    chmod -R -v user:group /path/file

    #List Current Working Directory
    ls

    #Alternative List CWD
    ls -l
    #(That is a lower case "L")

    #Move files
    mv source destination

    #Do as Root (requires root password)
    sudo command

    #A Text Editor
    pico filename

    #Stop, Start or Restart Apache
    /etc/init.d/apache2 start
    /etc/init.d/apache2 stop
    /etc/init.d/apache2 restart

    Corrections welcome!

    Other information found at:

    http://iluvjohn.com/2009/12/29/ubuntu-server-lts-910/

    ~John Minton
    http://iluvjohn.com/
    cjohnweb+creative-ctrl.com@gmail.com

  3. JR Chew
    Wed, 01/27/2010 - 11:18am

    Great addition man, I'll add these to the list when I get a chance. I just finished downloading Ubuntu a few minutes ago. I want to give it a try on my laptop.

  4. John Minton (not verified)
    Wed, 01/27/2010 - 11:50am

    That is awesome!

    I have yet to give the GUI a try, but I hear Ubuntu is pretty good!

  5. JR Chew
    Thu, 01/28/2010 - 1:48pm

    Added a lot of your commands to the list. Also put them in table form to make everything easier to read. Thanks for the contribution man, sign up for an account!

  6. Comment viewing options

    Select your preferred way to display the comments and click "Save settings" to activate your changes.