Download presentation
Presentation is loading. Please wait.
Published byFrancine Dixon Modified over 9 years ago
1
Chapter Linux Basics
2
Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later
3
Introduction Command Line –The standard utilities for manipulating files –Features providing by shell File system Installation
4
Command line File handling utilities – mkdir (MaKe DIRectory) Example mkdir foo - creates a directory foo in the current directory mkdir –p images/misc docs - creates a directory misc in directory images
5
Command line – rm (ReMove) -r, or –R Delete recursively -I Request confirmation before each deletion -f The opposite of –I Example rm –i images/*.jpg file1 - Deletes all files which name ends with.jpg in the current directory rm –Rf images/misc/file* - Deletes without requesting confirmation the whole directory misc/ in directory images/ together with files in the currrent directory
6
Command line – mv (Move) -f Force file moving -i The opposite -v Verbose Example Mv –I/tmp/pics/*.gif - Move al files in directory /tmp/pics/ which name ends with.gif to the current directory mv foo bar - Rename file foo as bar
7
Command line – Cp (CoPy) -R Recursive copy -i Request confirmation before overwriting any files -f The opposite of –i -v Verbose Example cp –i /tmp/images/*images/ - Copies all file from directory /tmp/images to directory images/ of the current directory cp foo bar - Make a copy of file foo under the name bar in the current directory
8
Command line Handling File Attributes –chown, chgrp (change the owner and group of one or more files -R Recursive; to change the owner of all files and subdirectories in a given directory -v Verbose mode, describes all actions performed by chown -c Like –v, but only reports which files have been changed
9
Command line Example chmod –R o-w/shared/docs – Recursively removes write permission for “other” on all files and subdirectories of /shared/docs chmod –R og-w,o-x private – Recursively removes write permission for the group and others for whole directory private/, and removes the execution permission for others.
10
Command line Shell globbing patterns and regular expressions –? matches one and only one character, whatever that character –[…] match any character found into the brackets –[!…] match any character not found in the brackets –{c1,c2} matches c1 and c2
11
Command line Example image/cars,space[0-9]/*.jpg – All filenames ending with.jpg in directory image/cars, image/space0, …, image/space9, if such directories exist *[!a-z] – All files which names do not end with a lowercase letter in the current directory
12
Command line Redirections Example $ Is image/*.gif 1>file_list – command (1) is redirected (>) to the file named file_list Pipes Example Is images/*.gif | wc –1 – The standard output of the Is command is redirected to the standard input of the wc command
13
File System Files – Character mode files Special system files which share the particularity that their contents are not buffered – Block mode files Peripherals and as opposed to character files, their contents are buffered – Symbolic links Common heavily used file in the system startup procedure – Name pipes Similar to pipes used in shell but these one actually have names
14
File System Links –The directory itself (.) –Parent directory (..) Anonymous –Pipes The shell creates the pipe and operates before the pipe write to it –Name pipes Opposite to the pipes used by shell
15
File System Special files –Character mode Files were buffered –Block mode files Files were not buffered Symbolic links –Files of a particular type whose sole contents is an arbitrary string
16
File System File attributes –A (no Access time) –a (append only) –d (no dump) –i (immutable) –s (secure deletion) –S (Synchronous mode)
17
Installation Requirements –A computer with a working operating system –General knowledge of the operating system you use –Some space on your hard disk –A compiler (usually for the C language) and an archiver (tar)
18
Installation Compilation –Principle Translate a source code into a binary file Logically done by a C compiler Repetitive operations are handled by a utility name make
19
Installation –Four steps of compilation cpp: consists in replacing directive (preprocessors) by pure C instructions ccl: consists in converting C into assembly language as: consists in generating object (or binary) code from the assembly language ld: links all the object files (.o) and the associated libraries
20
Installation –Structure of a distribution An install file, which describes the installation procedure A readme file, which contains general information related to the program A copying file, which contains the license or describes the distribution conditions of the software A contrib or credits file, which contains a list of people related to the software
21
Installation A changes file, which contains recent improvements and bugfixes A makefile file, which allows compilation of the software A configure or Imakefile file, which allow one to generate a new Makefile A directory that contains the sources ( src ) A directory that contains the document ( doc )
22
Installation Decompression –tar.gz archive Gzip is a standard format Developed by the GNU project Consider as one of the best general compression tools Gzip is often associated with a utility name tar.tar
23
Installation –The use of GNU Tar v make tar verbose f is a required option z allows you to treat a “gziped” Tar allow you to perform several actions on an archive
24
Installation Configuration –Use Autoconf if a file named configure exists in the parent directory of the distribution –Use Imake if a file name Imakefile exists in the parent directory of the distribution –Run a shell script according to the contents of the INSTALL file
25
Installation Compilation –make The developer saves time because it allows one to efficiently manage compilation of his interests Compile and install the software in few command lines –Rules make operates in accordance with a system of dependencies Compiling a binary file requires to go through several stages
26
Installation –Go, go, go! make without argument just executes the compilation of the program make install compile and provides the installation of the required files at the right place on the file system make clean clears all the temporary files created by the compilation
27
Installation Support –Documentation Look on your disk in /usr/doc/HOWTO Type man to get documentation on the command –Technical support Newsgroup (on Usenet) comp.os.linux Several IRC channel (#linuxhelp) on IRCNET Ask the developer of the software
28
Installation –How to find free software FTP site sundite.unc.edu http://www.freshmeat.net/ is probably the most complete sitehttp://www.freshmeat.net/ http://linux-france.org/ contains a lot of links to software working with GNU/Linuxhttp://linux-france.org/ http://www.gnu.org/software/ for an exhaustive list of all of GNU softwarehttp://www.gnu.org/software/
29
Linux-Mandrake information source http://www.linux- mandrake.com/guides71/en/mdkrefguide/f s-and-mntpoints.htmhttp://www.linux- mandrake.com/guides71/en/mdkrefguide/f s-and-mntpoints.htm http://metalab.unc.edu/mdw/FAQ/Linux- FAQ/x13.htmlhttp://metalab.unc.edu/mdw/FAQ/Linux- FAQ/x13.html http://www.linuxdoc.org/ http://www.linux-mandrake.com/en/ http://faqs.jmas.co.jp/FAQs/linux/faq/
30
End of presentation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.