Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different.

Similar presentations


Presentation on theme: "UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different."— Presentation transcript:

1 UNIX Overview

2 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different users can read mails, copy files, and print all at once.

3 Basic Command Suite CommandMeaning lslist files and directories ls -alist all files and directories mkdirmake a directory cd directorychange to named directory cdchange to home-directory cd ~change to home-directory cd..change to parent directory pwddisplay the path of the current directory

4 Man Pages Manual pages are on-line manuals which give information about most commands –T–Tells you which options a particular command can take –H–How each option modifies the behavior of the command Type man command at the UNIX command line to read the manual for a command What does the wc (word count) command do? … Type % man wc Alternatively, % whatis wc –A–A one-line description of the command, but omits information about options, etc.

5 More Useful Commands CommandMeaning cp file1 file2copy file1 and call it file2 mv file1 file2move or rename file1 to file2 rm fileremove a file rmdir directoryremove a directory cat filedisplay a file less filedisplay a file a page at a time head filedisplay the first few lines of a file tail filedisplay the last few lines of a file grep 'keyword' filesearch a file for keywords wc file count number of lines/words/characters in file

6 CommandMeaning command > fileredirect standard output to a file command >> fileappend standard output to a file command < file redirect standard input from a file command1 | command2 pipe the output of command1 to the input of command2 cat file1 file2 > file0 concatenate file1 and file2 to file0 sortsort data wholist users currently logged in *match any number of characters ?match one character man command read the online manual page for a command whatis commandbrief description of a command apropos keyword match commands with keyword in their man pages

7 7 How to stop a process? Foreground processes can generally be stopped by pressing CONTROL C (^C). Background processes can be stopped using the kill command. Usage: kill SIGNAL kill -9 (-9 means no blocked) Or kill. If a foreground process is not stopping by ^C, you can open another session and use the kill command.

8 8 Text editors Different editors: emacs, pico, vi emacs pico vi http://www.thegeekstuff.com/2009/07/top-5-best- linux-text-editors/

9 9 The simplest editor: pico or nano pico Full screen editor Help on the bottom of the screen nano is an extension to pico

10 10 Basic operations in pico Ctrl + v : to move page down Ctrl + y : to move page up Ctrl + o : to save the current buffer Ctrl + x : to exit with or without saving Ctrl + g : to get help Ctrl + r : to open a file Ctrl + w : to find a string in the current buffer Ctrl + c : to get the current position in the buffer

11 UNIX Tutorial Resources http://www.ee.surrey.ac.uk/Teaching/Unix http://www.math.utah.edu/lab/unix/unix- tutorial.html http://www.math.utah.edu/lab/unix/unix- tutorial.html http://www2.ocean.washington.edu/unix.tuto rial.html http://www2.ocean.washington.edu/unix.tuto rial.html

12 Get Your Feet Wet Read man pages to learn other commands such as: – gzip, cat, zcat, diff, find, history, diff, more, less, source Learn about the Bash shell – http://www.gnu.org/software/bash/manual/bashref.html http://www.gnu.org/software/bash/manual/bashref.html Debugger – Debugging a multi-process program is difficult with a debugger such as gdb – It is recommended that you use lots of printf statements during development


Download ppt "UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different."

Similar presentations


Ads by Google