SlideShare a Scribd company logo
4/7/2017 Basic Linux Commands
http://www.pas.rochester.edu/~pavone/particle­www/telescopes/ComputerCommands.htm 1/5
Basic Linux Commands
 
Modes of Operation
 
The linux operating system used for the PARTICLE DAQ system can be
used either in a terminal mode where you type commands or in a Windows
Explorer style graphical user interface (GUI).
 
The Explorer­like GUI can be used for file manipulation functions (e.g.,
copying a file to a floppy) or deleting or moving files on the disk.  It cannot
be used to run the PARTICLE DAQ itself.
 
To begin using the Explorer­like GUI, double click on the icons on the
Desktop.  For the most part, Explorer mode will be familiar from Windows
or MAC OS, so with a few exceptions, this information will not focus on this. 
Where something is much more easily done from Explorer mode, it will be
highlighted here.
 
To begin working in the terminal mode, you will need to open a terminal. 
This can be accomplished by clicking on the terminal icon in the bottom icon
bar, by using the main menu (footprint icon in lower left of bottom icon bar)
System Tools ­> New Terminal. 
 
The Manual (terminal mode)
 
man                                This command brings up the online Unix
manual. Use it on each of the commands below.
 
For Example:   
man pwd                        You will see the manual for the pwd command.
 
 
 
Accessing files in Folders (Directories) in terminal mode
 
pwd                                Shows what directory (folder) you are in.
In Linux, your home directory is /home/particle
 
       Let's suppose you have several data files (data1, data2 ... etc.) in a
directory called muondata.
4/7/2017 Basic Linux Commands
http://www.pas.rochester.edu/~pavone/particle­www/telescopes/ComputerCommands.htm 2/5
       Then suppose the directory muondata is an entry in your main home
directory, /home/particle .
       If you are in your home directory (where terminals start) and type pwd,
you will see /home/particle.
       If you were in the muondata directory, pwd would give you
/home/particle/muondata instead    
       The last slash after a directory name is optional.
 
As you can see, each slash (/) indicates another sub­directory.
cd                                  Changes directories.
 
Examples of relative movement among directories:
cd muondata                Moves down from your current directory
into the muondata sub­directory
 
 
cd ..                            Moves up one directory (yes, include the
two little dots) 
 
You can also move directly into directories
cd /home/particle/muondata
                   Moves from ANY directory into the muondata
sub­directory of your home directory.
 
cd ~               Takes you back to your home directory
(/home/particle)
 
Making or Removing a Directory (terminal mode)
 
mkdir dirName            Creates a directory with name dirName.
 
For Example:
mkdir temp             Creates the directory temp.
 
 
rmdir dirName      Removes a directory dirName.
 
For Example:
rmdir temp                  Removes the directory temp.
 
4/7/2017 Basic Linux Commands
http://www.pas.rochester.edu/~pavone/particle­www/telescopes/ComputerCommands.htm 3/5
 
Looking at or Finding your Files (terminal mode)
 
ls                                  Lists files.
 
If you add ­al after ls it will give more details for each file. Such as, size,
permissions, owners, dates etc.
 
ls al                          You'll see a huge list of files that you can't see with the
'ls' command alone and lots of details.
 
If you see such a long list of files that they scroll off the terminal screen, one
way to solve the problem is to use:
 
ls ­al |more       Shows one screen of file names at a time.
 
less data1         Dumps the contents of the data1 file to your screen
with a pause at each line so you don't miss any contents
as they scroll. You may move through the file using
page up, page down, home and end keys.  When done
with less you use the q key to get back to the main
terminal.
 
whereis data1      Shows you the location of the data1 file.
 
 
 
Altering your Files
 
rm data1                      Deletes the file data1 in the current directory. 
 
rm ­i muon*                Removes all of your muon data files
(careful!!  rm * will remove ALL your files) 
The "­i" makes the computer prompt before removing
each file.  If you really want to work without a net, omit
the "­i".
 
cp data1 newdata/    will copy the file data1 to the directory newdata
(assuming it has already been created)
 
mv data1 newdata/    moves the file data1 to the folder newdata and deletes
the old one.
4/7/2017 Basic Linux Commands
http://www.pas.rochester.edu/~pavone/particle­www/telescopes/ComputerCommands.htm 4/5
 
 
Using the Floppy Disk Drive in Linux
 
The simplest way to access the floppy drive under Linux is to use the
Explorer­like interface.  However, there is a very important detail!  To access
the files on the disk, you have to mount the floppy disk, which means that the
operating system will scan the disk so that it can recognize the files on it. 
Although your computer will be perfectly happy to allow you to remove the
disk by pushing the eject key on the laptop floppy drive, this may result in
unexpected actions unless you unmount the disk.  For example, your files
may be only partly there or not there at all!  (This is no different then under
Windows or DOS; its just that those operating systems hide that detail from
you a little better.  This is why, for example, you must eject floppy disks from
the disk properties menu in Windows.)
 
In the Explorer interface, to mount the floppy, you just double click on the
desktop icon.  This will bring up a window with the contents of the floppy,
and you may drag and drop files there, or take any other actions you would
with normal files.   (Note: unlike in Windows and MacOS, when you drag a
file from your home area to the floppy, it moves the file instead of making a
copy.)
 
To remove the disk, you must first right­click on the desktop icon, and select
Unmount volume or Eject (either does the same thing).  When this is
complete (and it may take a long time since it may have to complete writing
files to the floppy!), you may push the eject button on the floppy to remove it.
 
Things are more complicated by possible in the terminal mode:
 
mount              Mounts a drive to the operating system.
Linux does not 'see' the floppy drive until
you tell it to.
 
For Example:
mount /mnt/floppy    Allows you to use the floppy drive which has directory
name /mnt/floppy
 
 
cp aFile /mnt/floppy/     Copies the file aFile to the floppy disk.
 
ls /mnt/qfloppy/          Allows you to see what files are on your floppy.
4/7/2017 Basic Linux Commands
http://www.pas.rochester.edu/~pavone/particle­www/telescopes/ComputerCommands.htm 5/5
 
You may run into problems moving large files onto a 1.44MB floppy disk. 
One option to fit larger files is to create a zip archive containing the file onto
the floppy.  For Example:
 
zip /mnt/floppy/myFile.zip muon.myDataRun 
                   Moves the file muon.myDataRun into a zip file on the
floppy named myFile.zip
 
After you are done and before you eject it (this is very, very important), you
must unmount the floppy.
 
umount /mnt/qfloppy     Allows you to remove the floppy disk
 
       Make sure you wait for the command prompt to reappear (this might
take a few seconds) before ejecting the floppy. 
       If you eject the floppy before you unmount the floppy, it may corrupt
the data on the floppy and cause the system to be confused if you try to
use the floppy again. 
       If you make a mistake like this, it's probably best to reboot.  Sorry.
 
df                                  Shows the disk usage. This will tell you how much disk
space you have left on your hard drive as well as the
floppy.
 
 
 
 

More Related Content

Similar to Basic linux commands

Intro tounix
Intro tounixIntro tounix
Intro tounixdjprince
 
IntroToUnix.ppt
IntroToUnix.pptIntroToUnix.ppt
IntroToUnix.ppt
Pecific University
 
IntroToUnix.ppt.intro.to.linuxlinuxintroduction
IntroToUnix.ppt.intro.to.linuxlinuxintroductionIntroToUnix.ppt.intro.to.linuxlinuxintroduction
IntroToUnix.ppt.intro.to.linuxlinuxintroduction
NagavelliMadhavi
 
intro unix/linux 12
intro unix/linux 12intro unix/linux 12
intro unix/linux 12
duquoi
 
Linux tips
Linux tipsLinux tips
Linux tips
H. Kheir
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D E
Ngo Hung Long
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
alan moreno
 
Batch file-programming
Batch file-programmingBatch file-programming
Batch file-programming
jamilur
 
Microsoft windows operating concept
Microsoft windows operating conceptMicrosoft windows operating concept
Microsoft windows operating concept
Mi L
 
Know thyubuntu
Know thyubuntuKnow thyubuntu
Know thyubuntuchkmao
 
Main file win 8
Main file win 8Main file win 8
Main file win 8
Tapesh Chalisgaonkar
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
I B.Sc C & HA - Basics of CS
I B.Sc C & HA - Basics of CSI B.Sc C & HA - Basics of CS
I B.Sc C & HA - Basics of CS
Hepsijeba
 

Similar to Basic linux commands (20)

Intro xp linux
Intro xp linuxIntro xp linux
Intro xp linux
 
Intro tounix
Intro tounixIntro tounix
Intro tounix
 
IntroToUnix.ppt
IntroToUnix.pptIntroToUnix.ppt
IntroToUnix.ppt
 
IntroToUnix.ppt.intro.to.linuxlinuxintroduction
IntroToUnix.ppt.intro.to.linuxlinuxintroductionIntroToUnix.ppt.intro.to.linuxlinuxintroduction
IntroToUnix.ppt.intro.to.linuxlinuxintroduction
 
ch 3
ch 3ch 3
ch 3
 
intro unix/linux 12
intro unix/linux 12intro unix/linux 12
intro unix/linux 12
 
Linux tips
Linux tipsLinux tips
Linux tips
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D E
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
 
Batch file-programming
Batch file-programmingBatch file-programming
Batch file-programming
 
linux
linuxlinux
linux
 
Microsoft windows operating concept
Microsoft windows operating conceptMicrosoft windows operating concept
Microsoft windows operating concept
 
Linux monitoring
Linux monitoringLinux monitoring
Linux monitoring
 
Know thyubuntu
Know thyubuntuKnow thyubuntu
Know thyubuntu
 
Main file win 8
Main file win 8Main file win 8
Main file win 8
 
Install guide
Install guideInstall guide
Install guide
 
Install guide
Install guideInstall guide
Install guide
 
Classic shellreadme
Classic shellreadmeClassic shellreadme
Classic shellreadme
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado
 
I B.Sc C & HA - Basics of CS
I B.Sc C & HA - Basics of CSI B.Sc C & HA - Basics of CS
I B.Sc C & HA - Basics of CS
 

Recently uploaded

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 

Basic linux commands