SlideShare a Scribd company logo
Notes on Linux operating system
Written by Jan Mrázek for the MIBO(BCMB)8270L course
last updated: Jan 9, 2007
UNIX: operating system
Linux: free version of UNIX
Basic communication with a Linux computer is through a command line terminal (no graphics) or
“shell”. That is, the commands are typed on the keyboard instead of clicking on things on the
screen with a mouse.
Most modern UNIX/Linux platforms offer a graphical user interface similar to Windows but its use
over the network can be problematic. We will use the shell.
One of the advantages of using Linux and Linux shell is that you can access the computer from
anywhere through the Internet.
We will access our Linux server via secure shell (ssh) and secure file transfer protocol (sftp), which
have to be installed on your computer (PC or Mac). If you want to use your home computer for
access to our server download and install SSH 3.2.9 at http://www.sitesoft.uga.edu/ (SSH 3.2.9
includes both ssh ad sftp, no need to install a separate sftp). For the purpose of this course you have
been provided with accounts on our lab server willow.mib.uga.edu (type it in when SSH asks you
for a host name).
ssh allows you to open a Linux shell window on your desktop. In the Linux shell, you can type in
commands, run programs and manipulate files on the remote computer. ssh itself does not allow
you to move files between your computer and the remote Linux computer. That’s done by sftp.
Linux file system
Files in Linux are organized in directories (analogous to folders in Windows). The root directory is
simply “/”. Users have their files in their home directories in “/home/”. For example, my home
directory (user name “jan”) is “/home/jan/”.
Special directory names: “./” refers to the current directory; “../” refers to the directory one level
above the current directory; “~/” refers to your home directory.
File names: unlike Windows, Linux differentiates upper case and lower case letters in file names.
That is, the file names “MyFile”, “Myfile”, “myfile”, and “MYFILE” relate to four different files.
Hidden files: filenames that begin with “.” (period) are hidden files. These are usually system files
that don’t show up when you list directory content. Under normal situations you don’t have to
worry about the hidden files. Just remember not to use “.” at the start of a file name.
Files are assigned “permissions” that define who has access to them and what kinds of access.
Basic types of access are read, write and execute. Read access allows you to read the content (e.g.,
make your own copy) of a file. Write access allows you to delete, modify or overwrite files.
Execute access is required to execute programs or for directories to be able to access their content.
You have write access only to your home directory, that is, unless specifically given access you
will not be able to store files elsewhere on the file system. At the same time, you have read and
execute (but not write) access to all system files and programs that you will need. File permissions
can be changed with the “chmod” command but it is unlikely that you will need it in this course.
Linux does not use extensions to recognize the type of a file (like Windows) but you can include
“.” in file names. I often give files Windows-like extensions (like .txt, .pdf, .bat, etc.) in order to
remind myself what kind of a file it is and also that I don’t have to change the extension when I
transfer the file to Windows.
I recommend that you use directories to keep your files organized.
Wildcards: Many Linux commands allow wildcards in the file names. Most useful are “*” (matches
any text) and “?” (matches any single character). For example, “*” matches all files in a directory,
“a*” matches all files that start with “a”, “a*z” matches all files that start with “a” and end with
“z”, “a?z” will match things like “atz”, “a2z”, “a.z” but not “a2.z”, ????? will mach all files with
names exactly 5 characters long. You can use it with directories, too, e.g., the command “ls
~/*/*.txt” (see also below) will display file names of all files ending with “.txt” in directories one
level inside your home directory.
Linux Shell
Linux commands have none, one or more parameters. For example, “ls /home/jan” will list the
content of my home directory (“/home/jan” is a parameter). “ls” with no parameters will list content
of the current directory. “cp file1 file2” will read “file1” and make a copy named “file2”. As you
see, the order of the parameters is usually significant.
In addition to parameters, most Linux commands have options. Options start with “-“. For example,
“ls -l /home/jan” will list additional information about each file (without the -l it will only list the
file names). Options modify behavior of the command.
There are several types of shells that have some minor differences. The shell we use is called
“bash”.
List of Basic UNIX/Linux shell commands
Following is just the very basic list of some useful commands. More can be found on the internet
(e.g., type “linux shell commands” in Google). Check http://linux.org.mt/article/terminal for a
beginner’s tutorial including some more advanced tricks.
Ctrl-C: pressing ctrl-C will stop the running program or command
Output redirection: “>” will redirect the output normally going on the screen into a file. E.g., “ls >
List” will list all files in the directory but store it in a file named “List” instead of displaying it on
the screen. This can be used with any command or program.
Files and directories
• pwd: shows current directory.
• cd directoryname: makes directoryname your current directory. cd with no parameters
switches to your home directory
• ls directoryname: lists contents of directories. Use ls -l for more information about the files.
You can limit the list with wildcards (e.g., “ls /home/mydirectory/*.txt”)
• mkdir directoryname: creates a new directory.
• cp source destination: makes a copy of a file named “source” to “destination”.
• cp –r source destination: copies a directory and its content
• mv source destination: moves a file or directory.
• rm filenamelist: removes/deletes file(s). Be careful with wildcards.
• rm –r directory: removes directory (-ies) including its content
Viewing files
• cat file: prints the whole file on the screen. Can be used with redirection, e.g., “cat Small1
Small2 Small3 > Big” will concatenate files Small1, 2 and 3 into a single file named Big.
You can also use wildcards, e.g., “cat *.txt > VeryBigFile”.
• more file: shows a file page by page. When viewing the files press “Enter” to move forward
one line, “Space” to move forward one page, “b” to move one page backward, “q” to end
viewing the file, type “/patern” to jump to the next occurrence of the text “pattern”. These
are just few things you can do with more.
Getting more information about commands
• man command: will show the manual page (complete reference) for the command. Scroll up
and down as in more.
• info command: similar to man but contains more verbose information.
• Many commands will show basic description when run with -h or --help option.
Other
• passwd: change your password
• exit: close the terminal
• chmod: change permissions for a file/directory. This allows you to set access to your files
for other users or turn a text file into an executable. You will hardly need it in this course.
• cc program.c –o ~/bin/program: compiles a program written in C language and creates an
executable file in your bin directory. ~/bin/ is a standard place for storing executable
(binary) files. –lm option has to be included if the program uses math library. –O option will
optimize the program (make it run faster).
Editing
You can use command-line editors like vi, emacs or ed to modify contents of text files. However,
they take a while to get used to and unless you already know them you may be better off using sftp
to open the file in Notepad on your (Windows) computer. Just make sure that the sftp is set to
ASCII (text) mode when you do this.
Running programs
Once created, executable programs can be run as any regular command just by typing the program
name and any parameters and/or options. In fact, the shell commands are programs.
Executable program files can be created in different ways (included for your reference):
• When written in a language like C, C++, or Fortran, the “source code” (human-readable text
file prepared by a programmer in an appropriate syntax) can be converted into an
“executable” (machine-readable binary file) by a special program called compiler (see cc
command above). Compiling complex program packages may be complicated and
programmers often create “make” files, which contain all instructions how the program
should be compiled and assembled in a single file and are executed with the “make”
command. Program packages are increasingly often distributed as rpm files where the
installation is completely automatic making it very easy for the user (generally only the
system administrator can install such packages).
• You can create shell scripts (text files containing lists of commands to be executed) and
give them executable permission. That will effectively turn them into executable programs.
• Interpreted languages such as Perl differ from compiled ones in that you do not prepare an
executable file but instead each command is “interpreted” at the time of execution. This
makes such programs slower to run but eliminates need for compilation. Perl programs
(scripts) are run by typing “perl program” followed by parameters and options.

More Related Content

What's hot

50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
Rodrigo Maia
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformatics
BITS
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
Sagar Kumar
 
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformatics
BITS
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
SuKyeong Jang
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
Harish1983
 
Linux
Linux Linux
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
Saikumar Daram
 
Unix
UnixUnix
Linux Commands
Linux CommandsLinux Commands
Linux Commands
Ramasubbu .P
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
Tushar B Kute
 
Linux commands
Linux commands Linux commands
Linux commands
debashis rout
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
Haitham Raik
 
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsPart 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Joachim Jacob
 
Basic commands
Basic commandsBasic commands
Basic commands
ambilivava
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
Anuchit Chalothorn
 
LINUX
LINUXLINUX
LINUX
ARJUN
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 

What's hot (20)

50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformatics
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformatics
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux
Linux Linux
Linux
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Unix
UnixUnix
Unix
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Linux commands
Linux commands Linux commands
Linux commands
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsPart 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
LINUX
LINUXLINUX
LINUX
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 

Similar to Linux Basics

Shell intro
Shell introShell intro
Shell intro
Ankit Garg
 
Shell intro
Shell introShell intro
Shell intro
Srikanth Learner
 
Shell intro
Shell introShell intro
Shell intro
Teja Bheemanapally
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
Vu Hung Nguyen
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
Tushar Jain
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
Cam YP Co., Ltd
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
Cam YP Co., Ltd
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
Suman bhatt
Suman bhattSuman bhatt
Suman bhatt
Tapas Bayen
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
Tushar B Kute
 
Using Unix
Using UnixUsing Unix
Using Unix
Dr.Ravi
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 
Linux Systems Programming: File Handling
Linux Systems Programming: File HandlingLinux Systems Programming: File Handling
Linux Systems Programming: File Handling
RashidFaridChishti
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
KiranMantri
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
Soumya Behera
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
norhloudspeaker
 

Similar to Linux Basics (20)

Shell intro
Shell introShell intro
Shell intro
 
Shell intro
Shell introShell intro
Shell intro
 
Shell intro
Shell introShell intro
Shell intro
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Suman bhatt
Suman bhattSuman bhatt
Suman bhatt
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
Using Unix
Using UnixUsing Unix
Using Unix
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
 
Linux Systems Programming: File Handling
Linux Systems Programming: File HandlingLinux Systems Programming: File Handling
Linux Systems Programming: File Handling
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
 

More from Team-VLSI-ITMU

Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
Team-VLSI-ITMU
 
Intermediate Fabrics
Intermediate FabricsIntermediate Fabrics
Intermediate Fabrics
Team-VLSI-ITMU
 
RTX Kernal
RTX KernalRTX Kernal
RTX Kernal
Team-VLSI-ITMU
 
CNTFET
CNTFETCNTFET
scripting in Python
scripting in Pythonscripting in Python
scripting in Python
Team-VLSI-ITMU
 
Placement in VLSI Design
Placement in VLSI DesignPlacement in VLSI Design
Placement in VLSI Design
Team-VLSI-ITMU
 
Reduced ordered binary decision diagram
Reduced ordered binary decision diagramReduced ordered binary decision diagram
Reduced ordered binary decision diagram
Team-VLSI-ITMU
 
Nmos design using synopsys TCAD tool
Nmos design using synopsys TCAD toolNmos design using synopsys TCAD tool
Nmos design using synopsys TCAD tool
Team-VLSI-ITMU
 
CAD: Floorplanning
CAD: Floorplanning CAD: Floorplanning
CAD: Floorplanning
Team-VLSI-ITMU
 
CAD: Layout Extraction
CAD: Layout ExtractionCAD: Layout Extraction
CAD: Layout Extraction
Team-VLSI-ITMU
 
CAD: introduction to floorplanning
CAD:  introduction to floorplanningCAD:  introduction to floorplanning
CAD: introduction to floorplanning
Team-VLSI-ITMU
 
Computer Aided Design: Layout Compaction
Computer Aided Design: Layout CompactionComputer Aided Design: Layout Compaction
Computer Aided Design: Layout Compaction
Team-VLSI-ITMU
 
Computer Aided Design: Global Routing
Computer Aided Design:  Global RoutingComputer Aided Design:  Global Routing
Computer Aided Design: Global Routing
Team-VLSI-ITMU
 
floor planning
floor planningfloor planning
floor planning
Team-VLSI-ITMU
 
Cmos inverter design using tanner 180nm technology
Cmos inverter design using tanner 180nm technologyCmos inverter design using tanner 180nm technology
Cmos inverter design using tanner 180nm technology
Team-VLSI-ITMU
 
SRAM- Ultra low voltage operation
SRAM- Ultra low voltage operationSRAM- Ultra low voltage operation
SRAM- Ultra low voltage operation
Team-VLSI-ITMU
 
All opam assignment2_main
All opam assignment2_mainAll opam assignment2_main
All opam assignment2_main
Team-VLSI-ITMU
 
MOSFET Small signal model
MOSFET Small signal modelMOSFET Small signal model
MOSFET Small signal model
Team-VLSI-ITMU
 
twin well cmos fabrication steps using Synopsys TCAD
twin well cmos fabrication steps using Synopsys TCADtwin well cmos fabrication steps using Synopsys TCAD
twin well cmos fabrication steps using Synopsys TCAD
Team-VLSI-ITMU
 

More from Team-VLSI-ITMU (19)

Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
 
Intermediate Fabrics
Intermediate FabricsIntermediate Fabrics
Intermediate Fabrics
 
RTX Kernal
RTX KernalRTX Kernal
RTX Kernal
 
CNTFET
CNTFETCNTFET
CNTFET
 
scripting in Python
scripting in Pythonscripting in Python
scripting in Python
 
Placement in VLSI Design
Placement in VLSI DesignPlacement in VLSI Design
Placement in VLSI Design
 
Reduced ordered binary decision diagram
Reduced ordered binary decision diagramReduced ordered binary decision diagram
Reduced ordered binary decision diagram
 
Nmos design using synopsys TCAD tool
Nmos design using synopsys TCAD toolNmos design using synopsys TCAD tool
Nmos design using synopsys TCAD tool
 
CAD: Floorplanning
CAD: Floorplanning CAD: Floorplanning
CAD: Floorplanning
 
CAD: Layout Extraction
CAD: Layout ExtractionCAD: Layout Extraction
CAD: Layout Extraction
 
CAD: introduction to floorplanning
CAD:  introduction to floorplanningCAD:  introduction to floorplanning
CAD: introduction to floorplanning
 
Computer Aided Design: Layout Compaction
Computer Aided Design: Layout CompactionComputer Aided Design: Layout Compaction
Computer Aided Design: Layout Compaction
 
Computer Aided Design: Global Routing
Computer Aided Design:  Global RoutingComputer Aided Design:  Global Routing
Computer Aided Design: Global Routing
 
floor planning
floor planningfloor planning
floor planning
 
Cmos inverter design using tanner 180nm technology
Cmos inverter design using tanner 180nm technologyCmos inverter design using tanner 180nm technology
Cmos inverter design using tanner 180nm technology
 
SRAM- Ultra low voltage operation
SRAM- Ultra low voltage operationSRAM- Ultra low voltage operation
SRAM- Ultra low voltage operation
 
All opam assignment2_main
All opam assignment2_mainAll opam assignment2_main
All opam assignment2_main
 
MOSFET Small signal model
MOSFET Small signal modelMOSFET Small signal model
MOSFET Small signal model
 
twin well cmos fabrication steps using Synopsys TCAD
twin well cmos fabrication steps using Synopsys TCADtwin well cmos fabrication steps using Synopsys TCAD
twin well cmos fabrication steps using Synopsys TCAD
 

Recently uploaded

4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
Kamal Acharya
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
PIMR BHOPAL
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
ycwu0509
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
mahaffeycheryld
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 

Recently uploaded (20)

4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
VARIABLE FREQUENCY DRIVE. VFDs are widely used in industrial applications for...
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 

Linux Basics

  • 1. Notes on Linux operating system Written by Jan Mrázek for the MIBO(BCMB)8270L course last updated: Jan 9, 2007 UNIX: operating system Linux: free version of UNIX Basic communication with a Linux computer is through a command line terminal (no graphics) or “shell”. That is, the commands are typed on the keyboard instead of clicking on things on the screen with a mouse. Most modern UNIX/Linux platforms offer a graphical user interface similar to Windows but its use over the network can be problematic. We will use the shell. One of the advantages of using Linux and Linux shell is that you can access the computer from anywhere through the Internet. We will access our Linux server via secure shell (ssh) and secure file transfer protocol (sftp), which have to be installed on your computer (PC or Mac). If you want to use your home computer for access to our server download and install SSH 3.2.9 at http://www.sitesoft.uga.edu/ (SSH 3.2.9 includes both ssh ad sftp, no need to install a separate sftp). For the purpose of this course you have been provided with accounts on our lab server willow.mib.uga.edu (type it in when SSH asks you for a host name). ssh allows you to open a Linux shell window on your desktop. In the Linux shell, you can type in commands, run programs and manipulate files on the remote computer. ssh itself does not allow you to move files between your computer and the remote Linux computer. That’s done by sftp. Linux file system Files in Linux are organized in directories (analogous to folders in Windows). The root directory is simply “/”. Users have their files in their home directories in “/home/”. For example, my home directory (user name “jan”) is “/home/jan/”. Special directory names: “./” refers to the current directory; “../” refers to the directory one level above the current directory; “~/” refers to your home directory. File names: unlike Windows, Linux differentiates upper case and lower case letters in file names. That is, the file names “MyFile”, “Myfile”, “myfile”, and “MYFILE” relate to four different files. Hidden files: filenames that begin with “.” (period) are hidden files. These are usually system files that don’t show up when you list directory content. Under normal situations you don’t have to worry about the hidden files. Just remember not to use “.” at the start of a file name. Files are assigned “permissions” that define who has access to them and what kinds of access. Basic types of access are read, write and execute. Read access allows you to read the content (e.g., make your own copy) of a file. Write access allows you to delete, modify or overwrite files.
  • 2. Execute access is required to execute programs or for directories to be able to access their content. You have write access only to your home directory, that is, unless specifically given access you will not be able to store files elsewhere on the file system. At the same time, you have read and execute (but not write) access to all system files and programs that you will need. File permissions can be changed with the “chmod” command but it is unlikely that you will need it in this course. Linux does not use extensions to recognize the type of a file (like Windows) but you can include “.” in file names. I often give files Windows-like extensions (like .txt, .pdf, .bat, etc.) in order to remind myself what kind of a file it is and also that I don’t have to change the extension when I transfer the file to Windows. I recommend that you use directories to keep your files organized. Wildcards: Many Linux commands allow wildcards in the file names. Most useful are “*” (matches any text) and “?” (matches any single character). For example, “*” matches all files in a directory, “a*” matches all files that start with “a”, “a*z” matches all files that start with “a” and end with “z”, “a?z” will match things like “atz”, “a2z”, “a.z” but not “a2.z”, ????? will mach all files with names exactly 5 characters long. You can use it with directories, too, e.g., the command “ls ~/*/*.txt” (see also below) will display file names of all files ending with “.txt” in directories one level inside your home directory. Linux Shell Linux commands have none, one or more parameters. For example, “ls /home/jan” will list the content of my home directory (“/home/jan” is a parameter). “ls” with no parameters will list content of the current directory. “cp file1 file2” will read “file1” and make a copy named “file2”. As you see, the order of the parameters is usually significant. In addition to parameters, most Linux commands have options. Options start with “-“. For example, “ls -l /home/jan” will list additional information about each file (without the -l it will only list the file names). Options modify behavior of the command. There are several types of shells that have some minor differences. The shell we use is called “bash”. List of Basic UNIX/Linux shell commands Following is just the very basic list of some useful commands. More can be found on the internet (e.g., type “linux shell commands” in Google). Check http://linux.org.mt/article/terminal for a beginner’s tutorial including some more advanced tricks. Ctrl-C: pressing ctrl-C will stop the running program or command Output redirection: “>” will redirect the output normally going on the screen into a file. E.g., “ls > List” will list all files in the directory but store it in a file named “List” instead of displaying it on the screen. This can be used with any command or program.
  • 3. Files and directories • pwd: shows current directory. • cd directoryname: makes directoryname your current directory. cd with no parameters switches to your home directory • ls directoryname: lists contents of directories. Use ls -l for more information about the files. You can limit the list with wildcards (e.g., “ls /home/mydirectory/*.txt”) • mkdir directoryname: creates a new directory. • cp source destination: makes a copy of a file named “source” to “destination”. • cp –r source destination: copies a directory and its content • mv source destination: moves a file or directory. • rm filenamelist: removes/deletes file(s). Be careful with wildcards. • rm –r directory: removes directory (-ies) including its content Viewing files • cat file: prints the whole file on the screen. Can be used with redirection, e.g., “cat Small1 Small2 Small3 > Big” will concatenate files Small1, 2 and 3 into a single file named Big. You can also use wildcards, e.g., “cat *.txt > VeryBigFile”. • more file: shows a file page by page. When viewing the files press “Enter” to move forward one line, “Space” to move forward one page, “b” to move one page backward, “q” to end viewing the file, type “/patern” to jump to the next occurrence of the text “pattern”. These are just few things you can do with more. Getting more information about commands • man command: will show the manual page (complete reference) for the command. Scroll up and down as in more. • info command: similar to man but contains more verbose information. • Many commands will show basic description when run with -h or --help option. Other • passwd: change your password • exit: close the terminal • chmod: change permissions for a file/directory. This allows you to set access to your files for other users or turn a text file into an executable. You will hardly need it in this course. • cc program.c –o ~/bin/program: compiles a program written in C language and creates an executable file in your bin directory. ~/bin/ is a standard place for storing executable (binary) files. –lm option has to be included if the program uses math library. –O option will optimize the program (make it run faster). Editing You can use command-line editors like vi, emacs or ed to modify contents of text files. However, they take a while to get used to and unless you already know them you may be better off using sftp to open the file in Notepad on your (Windows) computer. Just make sure that the sftp is set to ASCII (text) mode when you do this.
  • 4. Running programs Once created, executable programs can be run as any regular command just by typing the program name and any parameters and/or options. In fact, the shell commands are programs. Executable program files can be created in different ways (included for your reference): • When written in a language like C, C++, or Fortran, the “source code” (human-readable text file prepared by a programmer in an appropriate syntax) can be converted into an “executable” (machine-readable binary file) by a special program called compiler (see cc command above). Compiling complex program packages may be complicated and programmers often create “make” files, which contain all instructions how the program should be compiled and assembled in a single file and are executed with the “make” command. Program packages are increasingly often distributed as rpm files where the installation is completely automatic making it very easy for the user (generally only the system administrator can install such packages). • You can create shell scripts (text files containing lists of commands to be executed) and give them executable permission. That will effectively turn them into executable programs. • Interpreted languages such as Perl differ from compiled ones in that you do not prepare an executable file but instead each command is “interpreted” at the time of execution. This makes such programs slower to run but eliminates need for compilation. Perl programs (scripts) are run by typing “perl program” followed by parameters and options.