SlideShare a Scribd company logo
1 of 34
Download to read offline
Unix for Librarians




Ravi Mynampaty
searchguy@hbs.edu
About me

Just a hustler making a living by pretending to
know more about search than he actually
does...
Workshop Goals
● Remember the roaring 90's?

● Geared towards beginners

● Lifetime guarantee!
What is Unix?
Multi-user

Multi-tasking

Hierarchical filesystem

Everything is a file
Philosophy
Doug McIlroy:
● Write programs that do one thing and do it
  well.
● Write programs to work together.
● Write programs to handle text streams,
  because that is a universal interface.
Let's get started
These slides:
- Slideshare

Use your own shell
   or
Go here:
http://bellard.org/jslinux/
A brief note about shells
Many flavors
Bourne (sh)
Korn (ksh)
Bourne-again (bash)
C-shell (csh)
tcsh

echo $0
How do I get in/out?
login: searchguy
Password:
Authentication successful

Logout
  > exit, logout

id, whoami

passwd
Where am I?
hostname

uname -a

pwd

cd

ls
Exercise
Login to JS shell

1.   Who are you logged in as?
2.   What is the name of the machine?
3.   What is the OS? and version?
4.   What dir are you working in?
5.   Change dir to /bin
     a. Look at a listing of all files in that dir
     b. are there any that begin with 'z' (just eyeball it for
        now)
What's around me?
cat

less is better than more
Documentation/Locations
man

apropos

which

whereis
Exercise
1. Examine the /etc/passwd file
   a. what are a couple of ways of doing this?
2. Where is the "less" utility located on the
   filesystem?
Who's around?
who

finger

w

last
Directories
mkdir new_dir

cd dir_name

pwd

your home dir
Files
cp old_file new_file

mv old_file new_file

grep search_str filename

head filename

tail filename
Exercise
1. Navigate to /etc/ directory
2. Take the file named "passwd"
   a. Make 4 copies in /var/tmp/
   b. Name them as follows:
      i. passwd1, passwd2, passwd3, passwd4
3. Search for the string "daemon" in any one of
   the 4 files
   a. How many instances did you find?
Files
sort filename

uniq filename

dos2unix oldfile newfile

find path -name '*html'

wc filename

cut: selected fields from each line
File compression
gzip filename

gunzip filename.gz

zcat filename.gz

tar cvf all.tar file1 file2 file3 ...
tar tvf
tar xvf
Hidden Files
ls -a

.profile
.cshrc
.login
.aliases

. and ..
File/Directory permissions
ls -l

-rwxr-xr-x

-u, g, o

chmod 775 filename
chmod g+w filename
Linking
ln old_file new_file

ln -s old_file new_file
Exercise: Linking
1. Navigate to /var/tmp
2. Create a hardlink to the passwd3 file
3. Create a symlink to the passwd4 file
What do you see?

1. Delete passwd3 and passwd4
What do you notice?
Editing files
vi

emacs

...
What did I do?!
[and can I do it again?]

history

!!

!13
I/O Redirection, Pipes
>

<

>>

|

xargs
Exercise: I/O, Redirection
command arg1 arg2 ... > filename

● cat > io.txt
Unix is great, much better than many other os's
makes me very productive
CONTROL-D

● cat < io.txt
● In /var/tmp merge all passwd* files into one
Exercise: Pipes
● Your merged file in /var/tmp
   ○ find the uniq lines
   ○ sort the file
   ○ now let's pipe it!
● sort filename | uniq

● find . -name 'pass*' | xargs grep -i nobody
More on pipes...
history | perl -pe 's/^ +[0-9]+//' | sort | uniq -c | sort -nr | head

"Top 200" list of directory sizes (under /dir-name - in KB)
sorted by largest:
du -dk /dir-name | sort -rn | head -200 > report.txt

List of requesting IP's from a web server log, sorted by
most frequent first:
cut -f1 -d access.log | sort | uniq -c | sort -rn

[df: free disk blocks,
du: disk usage]
Processes
ps
ps -u
ps -e
ps -auxww

top
Dealing with processes
kill pid

bg a process: command &

jobs

fg job_number

nice
Remotely
scp

rsync

sftp

ping

traceroute

ifconfig
Automation
at

cron
There's plenty more...
But for now...

...thanks for attending!

                 searchguy@hbs.edu

More Related Content

What's hot

Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
Andre Ferraz
 
Linux cmd
Linux cmdLinux cmd
Linux cmd
Reka
 
Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++
Michael Gordon
 

What's hot (20)

Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Linux file commands
Linux file commandsLinux file commands
Linux file commands
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformatics
 
Archlinux install
Archlinux installArchlinux install
Archlinux install
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
 
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 cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
 
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
 
리눅스 간단 강의 5강
리눅스 간단 강의 5강리눅스 간단 강의 5강
리눅스 간단 강의 5강
 
Bootcamp linux commands
Bootcamp linux commandsBootcamp linux commands
Bootcamp linux commands
 
Linux cmd
Linux cmdLinux cmd
Linux cmd
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++Introduction to Linux, Pico, G++
Introduction to Linux, Pico, G++
 
Using linux in schools
Using linux in schools Using linux in schools
Using linux in schools
 

Viewers also liked (9)

Unix processes
Unix processesUnix processes
Unix processes
 
Unit 2
Unit 2Unit 2
Unit 2
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Ch2
Ch2Ch2
Ch2
 
Unix lab
Unix labUnix lab
Unix lab
 
Unit 3
Unit  3Unit  3
Unit 3
 
Kernal
KernalKernal
Kernal
 
Unix system programming
Unix system programmingUnix system programming
Unix system programming
 

Similar to Unix for Librarians

Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Sudharsan S
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
Dimas Prasetyo
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
Nap Ramirez
 

Similar to Unix for Librarians (20)

Linux midterm quiz
Linux midterm quizLinux midterm quiz
Linux midterm quiz
 
Linux
LinuxLinux
Linux
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Mac OSX Terminal 101
Mac OSX Terminal 101Mac OSX Terminal 101
Mac OSX Terminal 101
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginners
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Tips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development EfficiencyTips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development Efficiency
 
One-Liners to Rule Them All
One-Liners to Rule Them AllOne-Liners to Rule Them All
One-Liners to Rule Them All
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux Fundamentals
Linux FundamentalsLinux Fundamentals
Linux Fundamentals
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
 
linux cmds.pptx
linux cmds.pptxlinux cmds.pptx
linux cmds.pptx
 
(Practical) linux 101
(Practical) linux 101(Practical) linux 101
(Practical) linux 101
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Linux basic for CADD biologist
Linux basic for CADD biologistLinux basic for CADD biologist
Linux basic for CADD biologist
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 

More from Ravi Mynampaty

Developing a Search & Findability Practice for the Enterprise
Developing a Search & Findability Practice for the EnterpriseDeveloping a Search & Findability Practice for the Enterprise
Developing a Search & Findability Practice for the Enterprise
Ravi Mynampaty
 
Clustering as presented at UX Poland 2013
Clustering as presented at UX Poland 2013Clustering as presented at UX Poland 2013
Clustering as presented at UX Poland 2013
Ravi Mynampaty
 

More from Ravi Mynampaty (13)

Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to Omega
 
Let Search Power Your Intranet!
Let Search Power Your Intranet!Let Search Power Your Intranet!
Let Search Power Your Intranet!
 
How we spiked the HBS water supply with Solr
How we spiked the HBS water supply with Solr How we spiked the HBS water supply with Solr
How we spiked the HBS water supply with Solr
 
Building a Solr-driven Web Portal
Building a Solr-driven Web PortalBuilding a Solr-driven Web Portal
Building a Solr-driven Web Portal
 
Developing a Search & Findability Practice for the Enterprise
Developing a Search & Findability Practice for the EnterpriseDeveloping a Search & Findability Practice for the Enterprise
Developing a Search & Findability Practice for the Enterprise
 
Clustering as presented at UX Poland 2013
Clustering as presented at UX Poland 2013Clustering as presented at UX Poland 2013
Clustering as presented at UX Poland 2013
 
Clustering Search Log Data
Clustering Search Log DataClustering Search Log Data
Clustering Search Log Data
 
How We Incrementally Improved Search
How We Incrementally Improved SearchHow We Incrementally Improved Search
How We Incrementally Improved Search
 
Findability Standards
Findability StandardsFindability Standards
Findability Standards
 
What to Feed Your Search Engine: The Evolution of Search Analytics at HBS
What to Feed Your Search Engine:  The Evolution of Search Analytics at HBSWhat to Feed Your Search Engine:  The Evolution of Search Analytics at HBS
What to Feed Your Search Engine: The Evolution of Search Analytics at HBS
 
Better Search UX
Better Search UXBetter Search UX
Better Search UX
 
Business owner findability interview questions
Business owner findability interview questionsBusiness owner findability interview questions
Business owner findability interview questions
 
Developing & Implementing Findability Standards
Developing & Implementing Findability StandardsDeveloping & Implementing Findability Standards
Developing & Implementing Findability Standards
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Unix for Librarians