References We Like
New to Linux? Looking for an easy to understand online tutorial or book? Check this out: The Linux Command Line by William E Shotts, jr.
What is Linux?
Just like Windows XP, Windows 7, Windows 8, and Mac OS X, Linux is an operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. To put it simply – the operating system manages the communication between your software and your hardware. Without the operating system (often referred to as the “OS”), the software wouldn’t function. For more information, visit Linux.com
Working with Linux
While some versions of Linux include a graphical desktop, similar to Windows, server implementations of Linux however do not generally include a graphical interface. Instead, all work is done by entering commands at a text prompt called the Command Line.
Connecting to a Server
Logging into Linux
To log into a Linux server you will need a user account name and password. If you are connecting to the server remotely you would have provided these as part of the SSH command, or Putty configuration. If you are using the Opmantek VM you can find the default passwords HERE: Default Credentials (Passwords) for NMIS8 VM.
Logging In as Root
If the last character of your Linux Prompt is # instead of $ you are logged in as root, which has superuser access. You should never be logged in as root, unless what you are doing absolutely requires that level of access.
Navigating Around the Command Line
The Linux Command Line, or Prompt, allows you to navigate around the file and folder structure, search for information, run programs, create scripts, and configure the server and applications. The sections below provide a basic overview of commands you may find useful while working with Linux.
Understanding the Linux Prompt
The Linux Prompt provides several valuable pieces of information. The example command prompt below provides the current user (root), the host name of the server or IP address if the hostname isn't set (demo.opmantek.com) , the current directory (~) and the level of permissions you are using (# is for root access, )
Navigating Around / Changing Directories
Linux organizes programs into files and folders, which are stored on drives or shares. Folders provide the concept of an organizational hierarchy in each share.
How to Determine Where You Are NOW
Typing pwd at the command line, then press Enter will provide the path to your current folder. Notice that the prompt indicates you are in the nmis8 folder, but the pwd command provides the full path /usr/local/nmis.
Showing a Listing of Files and Folders in the Current Directory
As we showed above, the Linux Prompt will show you the name of the current folder, or directory, you are in. To provide a list of the files and folders in the current directory you can type ls -l at the command prompt, then press Enter. The ls command will list the directory contents, the -l is an argument passed to the ls command, which tells the command to use the long listing format. There are many more arguments available for the ls command, they can be found on the official Manual page HERE: http://linuxcommand.org/lc3_man_pages/ls1.html