SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
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.

Más contenido relacionado

La actualidad más candente

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 bioinformaticsBITS
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar 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 bioinformaticsBITS
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginnersSuKyeong Jang
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command ShellTushar B Kute
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentialsHaitham 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 tipsJoachim Jacob
 
Basic commands
Basic commandsBasic commands
Basic commandsambilivava
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command LineAnuchit Chalothorn
 
LINUX
LINUXLINUX
LINUXARJUN
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 

La actualidad más candente (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 a Linux Operating System Commands

Unix Basics
Unix BasicsUnix Basics
Unix BasicsDr.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 scritpingchockit88
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08Tushar Jain
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
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 UnixDr.Ravi
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdfroschahacker
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04spDr.Ravi
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.pptLuigysToro
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.pptKiranMantri
 

Similar a Linux Operating System Commands (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 (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
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-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
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
 

Más de Team-VLSI-ITMU

Placement in VLSI Design
Placement in VLSI DesignPlacement in VLSI Design
Placement in VLSI DesignTeam-VLSI-ITMU
 
Reduced ordered binary decision diagram
Reduced ordered binary decision diagramReduced ordered binary decision diagram
Reduced ordered binary decision diagramTeam-VLSI-ITMU
 
Nmos design using synopsys TCAD tool
Nmos design using synopsys TCAD toolNmos design using synopsys TCAD tool
Nmos design using synopsys TCAD toolTeam-VLSI-ITMU
 
CAD: Layout Extraction
CAD: Layout ExtractionCAD: Layout Extraction
CAD: Layout ExtractionTeam-VLSI-ITMU
 
CAD: introduction to floorplanning
CAD:  introduction to floorplanningCAD:  introduction to floorplanning
CAD: introduction to floorplanningTeam-VLSI-ITMU
 
Computer Aided Design: Layout Compaction
Computer Aided Design: Layout CompactionComputer Aided Design: Layout Compaction
Computer Aided Design: Layout CompactionTeam-VLSI-ITMU
 
Computer Aided Design: Global Routing
Computer Aided Design:  Global RoutingComputer Aided Design:  Global Routing
Computer Aided Design: Global RoutingTeam-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 technologyTeam-VLSI-ITMU
 
SRAM- Ultra low voltage operation
SRAM- Ultra low voltage operationSRAM- Ultra low voltage operation
SRAM- Ultra low voltage operationTeam-VLSI-ITMU
 
All opam assignment2_main
All opam assignment2_mainAll opam assignment2_main
All opam assignment2_mainTeam-VLSI-ITMU
 
MOSFET Small signal model
MOSFET Small signal modelMOSFET Small signal model
MOSFET Small signal modelTeam-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 TCADTeam-VLSI-ITMU
 

Más de 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
 

Último

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 

Último (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 

Linux Operating System Commands

  • 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.