Download What is Linux? - Longwood Blogs

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

MTS system architecture wikipedia , lookup

Mobile operating system wikipedia , lookup

Acorn MOS wikipedia , lookup

DNIX wikipedia , lookup

Computer terminal wikipedia , lookup

Commodore DOS wikipedia , lookup

OS 2200 wikipedia , lookup

Spring (operating system) wikipedia , lookup

RSTS/E wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Burroughs MCP wikipedia , lookup

Linux wikipedia , lookup

Mandriva Linux wikipedia , lookup

Caldera OpenLinux wikipedia , lookup

CP/M wikipedia , lookup

Linux adoption wikipedia , lookup

Smallfoot wikipedia , lookup

VS/9 wikipedia , lookup

Security-focused operating system wikipedia , lookup

Unix security wikipedia , lookup

Transcript
_____________________________________________________________________________________
A Simple Introduction to
Programming on Linux
___________________________________________________________________________________
Olivia Zaleski
0
Contents____________________________
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
What is Linux? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Moving Around a File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
VIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Quick Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1
Introduction________________________________
As the title implies, this guide is for people who want to learn about coding in a Linux
environment. Topics covered include VIM shortcuts, comparisons of Linux to other operating
systems, and more. One of the topics not covered is the installation process, and so this guide is
not intended for those who do not already have access to Linux (for those that do not already
have Linux, check box below). No prior experience with Linux or free-line command is required
to understand any of the content in this manual. This is by no means meant to give a person an
in-depth understanding, but rather a gentle introduction that provides knowledge to build off
of. The Quick Guide in the last section is meant to serve as an easy reference for even people
who do have general experience. Here are some reasons why this guide is right for you:

You want (or are required) to learn about Linux

You have no experience with free line command

Other guides are confusing

You want to start off with the basics
Don’t have Linux yet?
2
Check out these sites for more information:

https://www.linux.com/learn/tutorials/770346-how-to-install-and-try-linux-theabsolutely-easiest-and-safest-way

https://www.linux.com/learn/tutorials/783109-how-to-choose-the-best-linux-desktopfor-you

http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows
What is Linux?_____________________________
Linux is an open computer operating system (OS) that allows users to access devices and
perform desired functions on a computer. In some aspects it may be compared to a Windows
operating system or even a Mac. A computer scientist named Linus Torvalds created the first
version of Linux in 1991; since then it has evolved into one of the most widely used operating
systems in the world. One difference between Linux and other operating systems is that Linux is
open source, meaning that it is not owned by one single corporation, and many improvements
are through the collaboration of multiple sources.
Key Features
LINUX MINT
Linux is extremely lightweight (this translates to
improvement in performance)
Lots of room for customization
More secure than other operating systems such
as Windows
Easy installation process
Free to download
3
Linux, like many
other operating
systems, offers a
variety of versions from which to
choose from. Linux Mint is perhaps
one of the most popular versions
for those who are less experienced
with the Linux operating system.
Many features are already
included for easy use.
Quick to install.
Built-in graphics are similar to
a traditional desktop layout.
Linux Mint Desktop_________________________
Figure 1. Basic Linux Mint desktop layout.

This desktop has similar features to other operating
systems. One feature sets it apart, and that is the ability to have
access to a terminal window.
A terminal window is a text-only window in a graphical user
interface. It lacks the visual graphics and is controlled through
text commands.
A command line interface is where communication between
the user and the console is based solely on textual input/output.
4
Moving Around a File System_________________
Terminal window
By using a command line in a terminal window the user
can have access to all sorts of options such as managing the file
system. In the file manager, all of the files are displayed in a
graphical representation. In a terminal window, you are
automatically in your home directory.
Graphical file system
List the file contents:
 To list the contents of the directory, simply
type “ls” and hit <enter>.
Blue represents folders
Enter a folder:
 If you want to open up a folder then you need to change your current working directory
with the “cd filename” command. For instance, if you wanted to enter the file
“cmsc262”, you would type:
cd cmsc201
This section displays which
directory you are in, so you
know if it works or not.
Create a new folder:
 To create a new folder, the command is “mkdir filename”. To create a folder named
“projects” type:
mkdir projects
5
Copy one file into another:
 You can copy the contents of one file into another with “cp”, followed by the name of
the file you want to copy and the destination file. If you wanted to make a copy of the
folder “Lab1” and wanted to store it in “Lab2” you would type:
cp Lab1 Lab2
This works for folders as well as different types of files.
Create a new file:
 To create a new file you need to have a text editor, and one of the most well-known text
editors is VIM.

The user can specify what type of
Type of File
Command
file to create based on the command.
C++
vim filename.cpp
6
python
vim filename.py
text
vim filename.txt
html
Vim filename.html
C
vim filename.c

Note: If VIM is not already installed
on your computer you can download it with
the command:
sudo apt-get install vim
Quick Guide_____________________________________________
Use these commands to navigate around in VIM
Command What it does
paste
:w
Save any changes to the file
u
Undo changes
:q
Quit; exit the file
$
Jump to end of line
:q!
Quit without saving any
changes
:wq
Save and quit
k
Move upward
i
Insert mode
h
Move left
v
Visual mode
j
Move down
dd
Delete a row
l
Move right
gg
Move to the top of the file
^
Jump to first character in
line
“shift” + g Move to the bottom of the
file
e
Forward to end of word
be
Backward to end of word
# + dd
y
7
p
Delete # rows
Yank a line (copy in visual)
:syntax on Syntax colors will display
(
Go one sentence backward
0