Download presentation
Presentation is loading. Please wait.
Published byCleopatra Boyd Modified over 9 years ago
1
A Brief Overview of Unix Brandon Bohrer
2
Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know the dominant Unix text editors, and their relative strengths and weaknesses. Filesystem – Learn the differences between Unix filesystems and those on other operating systems Using the Unix shell – Basic commands and shell syntax
3
What is Unix? Operating system first developed at Bell Labs in 1969 Based on design philosophy of simplicity and modularity Gave birth to a large family of operating systems. The most common of these (and the one used at Drexel) is GNU/Linux Free and open-source
4
Accessing Documentation man command ◦ Access online documentation for programs, functions, and more. info command ◦ More advanced documentation format, but not as widely used. apropos command ◦ Searches man pages for a command; helpful when you don’t know the exact name Course materials – Probably best source for basic commands Software manuals – More detailed and readable than man pages Books - Unix in a Nutshell available from Drexel Unix standards ◦ POSIX, Single Unix Specification ◦ Poor choice for everyday use, but may be helpful for portability questions.
5
Text Editors Vi (Visual Editor) ◦ Simple ◦ Available almost everywhere (part of Single Unix Specification) ◦ Mode-based UI takes some getting used to Emacs (Editor Macros) ◦ Lots of features (even has a vi mode) ◦ Highly extensible ◦ Uses multi-key keyboard shortcuts instead of modes Other editors : ◦ vim ◦ nano ◦ Kate ◦ And many more
6
Filesystem Overview File paths are delimited with forward slashes( / ) All directories are descendants of a root directory, called / Parent directory is denoted with two periods (..) Current directory is denoted with one period (.) Files are assigned permissions, which determine how they can be accessed and by whom.
7
Filesystem - Related Commands Directory manipulation ◦ cd change directory ◦ ls list files in directory ◦ mkdir make directory ◦ rmdir remove directory ◦ pwd print working directory File manipulation ◦ mv move file ◦ cp copy file ◦ rm remove file ◦ touch make file / update file timestamp
8
More common commands Search ◦ grep search text (General Regular Expression Parser) ◦ find search for file by name Display ◦ cat concatenate file to output ◦ echo output a given string Misc ◦ wc word/line count ◦ tail return the end of a file ◦ cmp compare files, show first difference ◦ diff compare files, show all differences ◦ ps show running processes ◦ less/more make large outputs easy to read And many more
9
Important Directories / Root directory /home Personal files /usr User software files /bin Executables /sbin Restricted Executables /dev Devices /usr/man Manuals /usr/src Source code /lib Important libraries /tmp Temporary, deleted on boot For full list, see Filesystem Hierarchy Standard: http://www.pathname.com/fhs/pub/fhs-2.3.html
10
File permissions Three sets of permissions ◦ Owner: Generally the file’s creator, but can be changed with chown ◦ Group: A group of users with a special set of permissions Defined in /etc/passwd and /etc/group File’s group is changed with chgrp ◦ Other: All other users Three flags in each set ◦ Read, write, execute ◦ Set with chmod Often encoded with each set represented by an octal digit, and each permission flag stored in a single bit ◦ E.g “Read and execute” encoded as 5 ( 2^2 + 2^0) ◦ E.g All permissions for all users encoded as 777
11
Shell Pipes and Metacharacters Pipes help programs work together. Use | to send output from one program to input for another. ◦ Example: cat file.txt | grep “hello” prints lines of file.txt containing the string “hello” Use > to write output to a file ◦ Example: ls > file.txt writes a directory listing to file.txt Use < to send a file to a program’s input ◦ Example: cat < file.txt prints file.txt * expands to all filenames in the current directory ◦ Example: rm./* deletes all files in current directory. ◦ Use carefully: Easy to type rm /* and destroy the filesystem. Use rm –i to avoid accidental deletions. See course notes or sh manual for more shell syntax.
12
Questions
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.