CSC320 chapter3 Part1 - 1 CSC 320 Systems Programming...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 CSC 320 Systems Programming Chapter 3 –UNIX/Linux commands & shell programming – Part 1 Updated by: Dr. Safwan Qasem – Spring 2010 Original version created by: Dr. Mohamed El Bachir Menai 2 The Shell of UNIX Linux has a variety of different shells: Bourne shell (sh), C shell (csh), Korn shell (ksh), TC shell (tcsh), Bourne Again shell (bash). The most popular shell is “bash”. Bash is the shell appearing in the GNU operating system. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). (The GNU Project was launched in 1984 to develop a complete UNIX-like operating system) It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. 3 The Shell of UNIX, cont. bash is not only an excellent command line shell, but a scripting language in itself. Shell scripting allows users to use the shell's abilities and to automate a lot of tasks that would otherwise require a lot of commands . For more details : A bash guide for beginners http://tille.garrels.be/training/bash/ List of bash commands http://ss64.com/bash/ 4 The Shell of UNIX, cont. Difference between programming and scripting languages: Programming languages are generally a lot more powerful and a lot faster than scripting languages. Programming languages generally start from source code and are compiled into an executable. This executable is not easily ported into different operating systems. A scripting language also starts from source code, but is not compiled into an executable. Rather, an interpreter reads the instructions in the source file and executes each instruction. Interpreted programs are generally slower than compiled programs. The main advantage is that you can easily port the source file to any operating system. bash is a scripting language. Other examples of scripting languages are Perl, Lisp, and Tcl. 5 UNIX: The Command Line Accessing UNIX through a terminal telnet [hostname] [port] The omnipresent failsafe. Nowadays, turned off due to lack of adequate security. ssh [user@]hostname (Secure Shell) Secure. Data is encrypted over “the wire”. Log in! 3 tries to get valid username and password right Show who is logged in w or who finger Logout! exit CTRL-D 6 Index of Linux bash commands alias Create an alias apropos Search Help manual pages (man -k) awk Find and Replace text, database sort/validate/index break Exit from a loop builtin Run a shell builtin bzip2 Compress or decompress named file(s) cal Display a calendar case Conditionally perform a command cat Display the contents of a file cd Change Directory cfdisk Partition table manipulator for Linux chgrp Change group ownership chmod Change access permissions chown Change file owner and group 7...
View Full Document

Page1 / 46

CSC320 chapter3 Part1 - 1 CSC 320 Systems Programming...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online