This document provides an introduction to using UNIX. It outlines the course aims of explaining what UNIX is used for and how to navigate files and directories. The agenda covers a brief history of UNIX, logging on, working with files and directories, commands like vi editor, and customizing the login environment. It describes the kernel, commands/utilities, and shell that make up the UNIX operating system model. It also explains the file structure, special characters, and transferring files between Windows and UNIX.
This document provides an introduction to the UNIX operating system. It discusses that UNIX is a multi-user, multitasking operating system developed in 1969. It describes the three categories of UNIX systems and lists some popular flavors. It also summarizes key UNIX features like portability, security, and networking. Finally, it provides overviews of the UNIX file system structure, commands, utilities and applications.
This ppt contains basic commands of UNIX operating system. This ppt is prepared by Dr. Rajiv Srivastava who is a director of SIRT, Bhopal which is a Best Engineering College in Central. India
The document provides an overview of the UNIX operating system. It discusses the history and development of UNIX from the 1960s onward. It describes the key features of UNIX including its layered architecture, kernel, shell, process management, file system, and security features. It also covers basic UNIX commands for working with files and directories, permissions, and getting help. The objective is to introduce readers to fundamental concepts of the UNIX OS.
The document provides an overview of the UNIX operating system. It discusses the components of a computer system including hardware, operating system, utilities, and application programs. It then defines the operating system as a program that acts as an interface between the user and computer hardware. The document outlines the goals of an operating system and provides a brief history of the development of UNIX from Multics. It also describes some key concepts of UNIX including the kernel, shell, files, directories, and multi-user capabilities.
The document provides an overview of the UNIX operating system through a seminar presentation. It discusses the history of UNIX from the 1970s to the 2000s, defines what UNIX is, describes common UNIX commands and the file system structure, and covers topics like memory management, interrupts, reasons for using UNIX, and some applications of UNIX like storage consulting and middleware/database administration. The presentation is intended to educate about the key aspects and functionality of the UNIX operating system.
Unix was created in 1969 by Ken Thompson at Bell Labs to allow multiple users to access a computer simultaneously. It features a multi-user design, hierarchical file system, and shell interface. The kernel handles memory management, process scheduling, and device interactions to enable these features. Common Unix commands like cat, ls, cp and rm allow users to work with files and directories from the shell. File permissions and ownership are managed through inodes to control access across users.
This document provides an overview of the UNIX operating system, including its history, features, basic structure, and commands. UNIX was created in 1969 at AT&T's Bell Labs and has undergone several revisions. It is a multi-user, multi-tasking operating system that runs on various hardware platforms. The kernel allocates resources and the shell acts as the interface between the user and kernel. Common UNIX commands allow users to navigate the file system, view and edit files, and manage the operating system.
This document provides an introduction to the UNIX operating system. It discusses that UNIX is a multi-user, multitasking operating system developed in 1969. It describes the three categories of UNIX systems and lists some popular flavors. It also summarizes key UNIX features like portability, security, and networking. Finally, it provides overviews of the UNIX file system structure, commands, utilities and applications.
This ppt contains basic commands of UNIX operating system. This ppt is prepared by Dr. Rajiv Srivastava who is a director of SIRT, Bhopal which is a Best Engineering College in Central. India
The document provides an overview of the UNIX operating system. It discusses the history and development of UNIX from the 1960s onward. It describes the key features of UNIX including its layered architecture, kernel, shell, process management, file system, and security features. It also covers basic UNIX commands for working with files and directories, permissions, and getting help. The objective is to introduce readers to fundamental concepts of the UNIX OS.
The document provides an overview of the UNIX operating system. It discusses the components of a computer system including hardware, operating system, utilities, and application programs. It then defines the operating system as a program that acts as an interface between the user and computer hardware. The document outlines the goals of an operating system and provides a brief history of the development of UNIX from Multics. It also describes some key concepts of UNIX including the kernel, shell, files, directories, and multi-user capabilities.
The document provides an overview of the UNIX operating system through a seminar presentation. It discusses the history of UNIX from the 1970s to the 2000s, defines what UNIX is, describes common UNIX commands and the file system structure, and covers topics like memory management, interrupts, reasons for using UNIX, and some applications of UNIX like storage consulting and middleware/database administration. The presentation is intended to educate about the key aspects and functionality of the UNIX operating system.
Unix was created in 1969 by Ken Thompson at Bell Labs to allow multiple users to access a computer simultaneously. It features a multi-user design, hierarchical file system, and shell interface. The kernel handles memory management, process scheduling, and device interactions to enable these features. Common Unix commands like cat, ls, cp and rm allow users to work with files and directories from the shell. File permissions and ownership are managed through inodes to control access across users.
This document provides an overview of the UNIX operating system, including its history, features, basic structure, and commands. UNIX was created in 1969 at AT&T's Bell Labs and has undergone several revisions. It is a multi-user, multi-tasking operating system that runs on various hardware platforms. The kernel allocates resources and the shell acts as the interface between the user and kernel. Common UNIX commands allow users to navigate the file system, view and edit files, and manage the operating system.
Linux is an open-source operating system developed by Linus Torvalds in 1991. It has a reputation for being efficient and fast-performing. The document then lists and describes 50 common Linux commands, including their syntax and usage. Examples include commands for changing directories, copying files, displaying the date/time, searching files with grep, and more.
Here are the steps to complete the assignment:
1. Logged in as guest user
2. Present working directory is /home/guest
3. Wrote the structure of root directory /
4. A few commands in /bin are ls, cp, mv. A few in /sbin are ifconfig, route
5. Guest directory is /home/guest
6. Permissions of /home/guest are drwxr-xr-x
7. Created directory test in /home/guest
8. Copied /etc/resolv.conf to /home/guest/test
9. Renamed /home/guest/test to /home/guest/testing
10. Deleted
This document provides an introduction to Linux, including its history and architecture. It describes Linux's origins from Unix in the 1960s and the development of the Linux kernel by Linus Torvalds in 1991. It outlines the key components of a Linux system, including the kernel, shell, file system, processes, networking, and desktop environments. It also discusses booting a Linux system and provides resources for learning more about Linux distributions and building your own operating system.
The document provides an overview of basic and useful UNIX commands organized into categories including essential commands, valuable commands, fun commands, helpful commands, and useful commands. It describes commands for navigating directories, manipulating files, editing text, sending email, connecting to other systems, monitoring system usage, and more. The document is intended to help users get started with common tasks in UNIX.
This document provides summaries of basic, valuable, fun, helpful, and useful UNIX commands organized into categories. It introduces the UNIX operating system and notes that free versions like Linux are gaining popularity. The summaries describe 10 essential commands like ls and cd for navigating directories. Another 10 valuable commands help manage accounts, like grep to search files and chmod to change permissions. Additional categories summarize commands for tasks like printing, emailing, drawing, and monitoring system resources. The document aims to help users get started with common UNIX commands.
The document provides an introduction to Unix presented by Ananthi Murugesan. It covers:
1. The history and origins of Unix from its development at Bell Labs in the 1960s-1970s.
2. An overview of what Unix is, including its portability, multi-user capabilities, and hierarchical file structure.
3. Details about the core components of Unix including the kernel, shell, and file management system.
Unix operating system architecture with file structure amol_chavan
The document provides information about the Unix operating system, including:
- Unix was originally developed in 1969 at Bell Labs and consists of programs that link the computer and user. There are various commercial and open-source variants available.
- It allows for multi-user access where many users can use the system at once, and multitasking where users can run multiple programs simultaneously.
- The kernel manages hardware interaction, memory, processes, I/O, and enforces access permissions. The shell interprets commands for the kernel to execute programs and utilities like cp, mv, cat, and grep.
- All data is organized into files within a hierarchical directory structure called the file system, with directories like
Linux-training-for-beginners-in-mumbaiUnmesh Baile
Vibrant Technologies is headquarted in Mumbai,India.We are the best Linux training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Linux classes in Mumbai according to our students and corporates
This document summarizes the history and key aspects of Linux. It describes how Linux originated from earlier operating systems like MULTICS and UNIX. It provides an overview of Linux components like the kernel, GNU tools, and popular desktop interfaces. It also summarizes common Linux commands for file navigation, editing, and process management. Finally, it gives a brief introduction to the GNOME desktop environment.
The document discusses the UNIX operating system. It describes UNIX as a stable, multi-user operating system developed in the 1960s for servers, desktops, and laptops. The UNIX operating system consists of three main parts: the kernel, the shell, and programs. The kernel allocates resources and handles processes and communications, while the shell acts as an interface between the user and kernel. There are various versions of UNIX that share common features.
This document provides an overview of open source software and Linux. It discusses the history of UNIX and GNU/Linux and how Linux was started by Linus Torvalds. It also summarizes common Linux utilities, the LAMP stack components of Linux, Apache, MySQL, and PHP/Perl/Python, and how they work. Finally, it touches on Linux file systems and configurations, getting help resources, and troubleshooting from logs.
This document provides an overview of Linux including:
- Different pronunciations of Linux and the origins of each pronunciation.
- A definition of Linux as a generic term for Unix-like operating systems with graphical user interfaces.
- Why Linux is significant as a powerful, free, and customizable operating system that runs on multiple hardware platforms.
- An introduction to key Linux concepts like multi-user systems, multiprocessing, multitasking and open source software.
- Examples of common Linux commands for file handling, text processing, and system administration.
This document provides guidance for Linux administration practicals, including:
- An index of 17 practical topics ranging from basic Linux commands to configuring mail services.
- Detailed instructions for Practical 1 on basic commands like cat, mkdir, cp, and editors like vi. It provides an example directory and file structure to create.
- An overview of Practical 2 on installing Red Hat Linux, including selecting installation options and partitioning the hard drive to make space.
- Descriptions of changing file permissions using both binary and symbolic modes with chmod, and decoding permission codes from the ls command.
- An explanation of the different modes in the vi editor like command, insert, and ex modes,
LInux: Basics & File System:The Unix operating system was conceived and implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. First released in 1971, Unix was written entirely in assembly language, as was common practice at the time. Later, in a key pioneering approach in 1973, it was rewritten in the C programming language by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of a high-level language implementation of Unix made its porting to different computer platforms easier.
This document provides an overview of a presentation on Linux programming and administration. It covers the history of Unix and Linux, files and directories in Linux, Linux installation, basic Linux commands, user and group administration, and LILO (Linux Loader). The document introduces key topics like Unix flavors, Linux distributions, partitioning and formatting disks for Linux installation, the file system hierarchy standard, and access permissions in Linux.
This document provides an overview of the Linux operating system and commands. It begins with course objectives to introduce Unix concepts, commands, and the VI editor. It then discusses what an operating system is and why they are needed before exploring the evolution, flavors, and architecture of Unix/Linux. Key topics covered include the file system structure, absolute vs relative paths, how Unix sessions work, login sequences, command syntax, and standard input/output/error. The document also examines regular expressions, shell metacharacters, editors like VI, and permissions.
Linux is an open source operating system based on UNIX. It was created by Linus Torvalds to provide a free alternative to UNIX. Linux has many distributions including Ubuntu, CentOS, and Fedora. It has advantages like being free, portable, secure, and scalable. However, it can be confusing for beginners due to many distributions and frequent updates. The document then discusses Linux file systems, permissions, ownership, and basic commands.
The document discusses the Unix operating system. It describes Unix systems as using plain text storage, a hierarchical file system, and treating devices as files. It also discusses the Unix philosophy of using small, strung together programs instead of large monolithic programs. The document then summarizes Unix kernel subsystems like process management and memory management. It provides an overview of shell scripts, their advantages, and how to create and use variables within scripts.
Basic of and Unix and Command. More presentation you can find on www.scmGalaxy.com.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
- Linux originated as a clone of the UNIX operating system. Key developers included Linus Torvalds and developers from the GNU project.
- Linux is open source, multi-user, and can run on a variety of hardware. It includes components like the Linux kernel, shell, terminal emulator, and desktop environments.
- The document provides information on common Linux commands, files, users/groups, permissions, and startup scripts. It describes the Linux file system and compression/archiving utilities.
Linux is an open-source operating system developed by Linus Torvalds in 1991. It has a reputation for being efficient and fast-performing. The document then lists and describes 50 common Linux commands, including their syntax and usage. Examples include commands for changing directories, copying files, displaying the date/time, searching files with grep, and more.
Here are the steps to complete the assignment:
1. Logged in as guest user
2. Present working directory is /home/guest
3. Wrote the structure of root directory /
4. A few commands in /bin are ls, cp, mv. A few in /sbin are ifconfig, route
5. Guest directory is /home/guest
6. Permissions of /home/guest are drwxr-xr-x
7. Created directory test in /home/guest
8. Copied /etc/resolv.conf to /home/guest/test
9. Renamed /home/guest/test to /home/guest/testing
10. Deleted
This document provides an introduction to Linux, including its history and architecture. It describes Linux's origins from Unix in the 1960s and the development of the Linux kernel by Linus Torvalds in 1991. It outlines the key components of a Linux system, including the kernel, shell, file system, processes, networking, and desktop environments. It also discusses booting a Linux system and provides resources for learning more about Linux distributions and building your own operating system.
The document provides an overview of basic and useful UNIX commands organized into categories including essential commands, valuable commands, fun commands, helpful commands, and useful commands. It describes commands for navigating directories, manipulating files, editing text, sending email, connecting to other systems, monitoring system usage, and more. The document is intended to help users get started with common tasks in UNIX.
This document provides summaries of basic, valuable, fun, helpful, and useful UNIX commands organized into categories. It introduces the UNIX operating system and notes that free versions like Linux are gaining popularity. The summaries describe 10 essential commands like ls and cd for navigating directories. Another 10 valuable commands help manage accounts, like grep to search files and chmod to change permissions. Additional categories summarize commands for tasks like printing, emailing, drawing, and monitoring system resources. The document aims to help users get started with common UNIX commands.
The document provides an introduction to Unix presented by Ananthi Murugesan. It covers:
1. The history and origins of Unix from its development at Bell Labs in the 1960s-1970s.
2. An overview of what Unix is, including its portability, multi-user capabilities, and hierarchical file structure.
3. Details about the core components of Unix including the kernel, shell, and file management system.
Unix operating system architecture with file structure amol_chavan
The document provides information about the Unix operating system, including:
- Unix was originally developed in 1969 at Bell Labs and consists of programs that link the computer and user. There are various commercial and open-source variants available.
- It allows for multi-user access where many users can use the system at once, and multitasking where users can run multiple programs simultaneously.
- The kernel manages hardware interaction, memory, processes, I/O, and enforces access permissions. The shell interprets commands for the kernel to execute programs and utilities like cp, mv, cat, and grep.
- All data is organized into files within a hierarchical directory structure called the file system, with directories like
Linux-training-for-beginners-in-mumbaiUnmesh Baile
Vibrant Technologies is headquarted in Mumbai,India.We are the best Linux training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Linux classes in Mumbai according to our students and corporates
This document summarizes the history and key aspects of Linux. It describes how Linux originated from earlier operating systems like MULTICS and UNIX. It provides an overview of Linux components like the kernel, GNU tools, and popular desktop interfaces. It also summarizes common Linux commands for file navigation, editing, and process management. Finally, it gives a brief introduction to the GNOME desktop environment.
The document discusses the UNIX operating system. It describes UNIX as a stable, multi-user operating system developed in the 1960s for servers, desktops, and laptops. The UNIX operating system consists of three main parts: the kernel, the shell, and programs. The kernel allocates resources and handles processes and communications, while the shell acts as an interface between the user and kernel. There are various versions of UNIX that share common features.
This document provides an overview of open source software and Linux. It discusses the history of UNIX and GNU/Linux and how Linux was started by Linus Torvalds. It also summarizes common Linux utilities, the LAMP stack components of Linux, Apache, MySQL, and PHP/Perl/Python, and how they work. Finally, it touches on Linux file systems and configurations, getting help resources, and troubleshooting from logs.
This document provides an overview of Linux including:
- Different pronunciations of Linux and the origins of each pronunciation.
- A definition of Linux as a generic term for Unix-like operating systems with graphical user interfaces.
- Why Linux is significant as a powerful, free, and customizable operating system that runs on multiple hardware platforms.
- An introduction to key Linux concepts like multi-user systems, multiprocessing, multitasking and open source software.
- Examples of common Linux commands for file handling, text processing, and system administration.
This document provides guidance for Linux administration practicals, including:
- An index of 17 practical topics ranging from basic Linux commands to configuring mail services.
- Detailed instructions for Practical 1 on basic commands like cat, mkdir, cp, and editors like vi. It provides an example directory and file structure to create.
- An overview of Practical 2 on installing Red Hat Linux, including selecting installation options and partitioning the hard drive to make space.
- Descriptions of changing file permissions using both binary and symbolic modes with chmod, and decoding permission codes from the ls command.
- An explanation of the different modes in the vi editor like command, insert, and ex modes,
LInux: Basics & File System:The Unix operating system was conceived and implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. First released in 1971, Unix was written entirely in assembly language, as was common practice at the time. Later, in a key pioneering approach in 1973, it was rewritten in the C programming language by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of a high-level language implementation of Unix made its porting to different computer platforms easier.
This document provides an overview of a presentation on Linux programming and administration. It covers the history of Unix and Linux, files and directories in Linux, Linux installation, basic Linux commands, user and group administration, and LILO (Linux Loader). The document introduces key topics like Unix flavors, Linux distributions, partitioning and formatting disks for Linux installation, the file system hierarchy standard, and access permissions in Linux.
This document provides an overview of the Linux operating system and commands. It begins with course objectives to introduce Unix concepts, commands, and the VI editor. It then discusses what an operating system is and why they are needed before exploring the evolution, flavors, and architecture of Unix/Linux. Key topics covered include the file system structure, absolute vs relative paths, how Unix sessions work, login sequences, command syntax, and standard input/output/error. The document also examines regular expressions, shell metacharacters, editors like VI, and permissions.
Linux is an open source operating system based on UNIX. It was created by Linus Torvalds to provide a free alternative to UNIX. Linux has many distributions including Ubuntu, CentOS, and Fedora. It has advantages like being free, portable, secure, and scalable. However, it can be confusing for beginners due to many distributions and frequent updates. The document then discusses Linux file systems, permissions, ownership, and basic commands.
The document discusses the Unix operating system. It describes Unix systems as using plain text storage, a hierarchical file system, and treating devices as files. It also discusses the Unix philosophy of using small, strung together programs instead of large monolithic programs. The document then summarizes Unix kernel subsystems like process management and memory management. It provides an overview of shell scripts, their advantages, and how to create and use variables within scripts.
Basic of and Unix and Command. More presentation you can find on www.scmGalaxy.com.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
- Linux originated as a clone of the UNIX operating system. Key developers included Linus Torvalds and developers from the GNU project.
- Linux is open source, multi-user, and can run on a variety of hardware. It includes components like the Linux kernel, shell, terminal emulator, and desktop environments.
- The document provides information on common Linux commands, files, users/groups, permissions, and startup scripts. It describes the Linux file system and compression/archiving utilities.
The document discusses the history and characteristics of UNIX operating systems. It describes how UNIX was developed in the 1960s and has since evolved into many different versions. Some key aspects of UNIX include its multi-user and multi-tasking capabilities, large number of free and commercial applications, and importance in internet development. The document also covers UNIX system calls, memory management, process management, and file systems.
This document provides an overview of the UNIX operating system. It begins with an introduction to UNIX, noting that it was developed in 1969 at Bell Labs and is a portable, multi-user, multi-tasking operating system. The document then covers the history of UNIX, its key features including multi-user capability and security, and common shells like Bourne shell. It also discusses common UNIX distributions, basic commands like ls, cat and cp, and includes a questions and answers section and references.
Nguyễn Vũ Hưng The Unix and GNU/Linux command line - power toolsVu Hung Nguyen
The document outlines the contents of a training on the Unix and GNU/Linux command line, covering topics such as shells and file handling, I/O redirection, task control, system administration basics and LAMP administration over the course of 6 sessions. It also briefly introduces GNU/Linux and free software philosophy.
White paper MABAC (Multi Level Attribute Based Access Control) by Gustavo Gi...Gustavo Giorgetti
White Paper MABAC
(Multi Level Attribute Based Access Control)
by Gustavo Giorgetti & Claudio Vaucheret. (marzo 2008)
Introducido como una innovación necesaria para poder implementar el modelo de INTEGRABILIDAD en infraestructuras de gobierno electrónico.
After completing this section, students should be able to log into the Linux system, understand and manipulate the UNIX file system, describe the role of the shell, use basic file commands like cd, ls, cp, and rm, use standard input/output and piping, and understand the UNIX philosophy. The document provides an introduction to UNIX operating systems, shells, file systems, basic commands, and input/output redirection.
This document summarizes a survey of sentiment analysis in Arabic. It outlines that sentiment analysis analyzes opinions and emotions from text. While most systems are for English, there are few Arabic resources. Arabic is spoken by over 300 million people and is growing online. The document discusses subjectivity and sentiment processes in Arabic, including tokenization, stemming, stop words removal and sentiment classifications. It also outlines experiments on Arabic text corpora, the importance of sentiment analysis for financial markets, and challenges of unbalanced sentiment data in Arabic. Classification algorithms like Naive Bayes and SVMs are evaluated on sentiment categories with validation using confusion matrices.
Access Control: Principles and PracticeNabeel Yoosuf
Slides prepared based on the paper Access Control: Principles and Practice by Ravi S. Sandhu and Pierangela Samarati, IEEE Communications Magazine, 1994
This document lists 31 publications by Suresh P M and various co-authors between 2007-2017 related to mechanical engineering topics like modal analysis, vibration analysis, noise vibration and harshness analysis, composite materials, and more. Many of the publications appeared in international journals and conference proceedings on engineering research.
Data entry india bpo - Outsource Data Entry IndiaCamila Anderson
Our profoundly systematic and staunch team makes it a point to give our customers extraordinary administrations. Our expert group uses the most recent and dynamic devices accessible with us to give our clients incomparable consequences of unbeatable quality.
Contact us :-
E-mail: info@dataentryindiabpo.com
Website: http://www.dataentryindiabpo.com
Library of the Circus Conservatory of America Collection Development PolicyRainie Themer
The document outlines the collection development policy of the Library of the Circus Conservatory of America. It details the library's mission to support the educational programs in circus arts at the Conservatory. The collection includes books, periodicals, archival materials, and audiovisual resources on circus history and techniques. Selection criteria focus on relevance to the Conservatory's curriculum and accessibility for students, faculty, and the broader circus community. The policy establishes procedures for collection assessment, management, and addressing challenges.
The document provides details on Neil Shanks' professional experience as a site manager and supervisor for various construction projects in Scotland. It outlines his employment history working for Thomas Johnstone Ltd since 2005 on projects such as hotel refurbishments, office and lab fit-outs, and structural works valued between £250,000 to £8.6 million. It also lists his qualifications, safety certifications, and personal interests.
Sumanta Banerjee provides a resume summarizing his skills and experience. He has over 10 years of experience working with technologies like Java, Oracle SQL, and PL/SQL. His most recent role is as a team lead for a manual testing team of 10 members. He has experience working on various projects for clients like Tata Steel, Citibank, and HP.
Ryan Young summarizes his experience working at Brentwood Industries, where he completed various projects including designing molds and tooling, reverse engineering parts, updating quick change tooling, creating CAD drawings, and more. He learned skills in safety, Solidworks, prioritization, and working in a corporate environment. His experience at Brentwood helped develop his skills and will assist him in his product design studies, with long term goals of continuing to learn and obtaining a career in product design.
Mohamed Safwat Al-Mezini is a business entrepreneur seeking a challenging career opportunity in a growth-oriented company. He has a BSBA in Marketing from the American University of Sharjah with a minor in Management. His work experience includes roles in marketing and business development at several companies in Dubai and Sharjah, such as Aviareps Middle East, The Arabian Jerusalem Heavy Equipment Trading, and Fine Hygienic Papers Middle East. He is skilled in areas like market research, media liaison, press release writing, event organization, and data analysis.
The document discusses the UNIX operating system. It describes UNIX as a stable, multi-user, multi-tasking system used for servers, desktops and laptops. It also discusses the different components that make up the UNIX system, including the kernel, shell, and programs. It explains the directory structure and file hierarchy with the root directory at the top. It provides examples of different types of files and concludes by describing some basic date and time commands in UNIX.
Linux is an open-source operating system based on the Linux kernel. It is used widely in servers, desktops, embedded systems, and other devices. The Linux directory structure is organized with key directories like /bin, /etc, /home, /lib, /usr, and /var that contain essential system files, configurations, user files, libraries, applications, and variable/log files respectively. Popular Linux distributions combine the kernel with applications and provide installation and support.
- The document provides an introduction and overview of the history and structure of the Unix operating system
- It describes how Unix was developed in the 1960s and 1970s at Bell Labs and others and became widely adopted, especially in academia
- The key aspects of Unix covered include its layered design, file system structure, use of directories, files and inodes to organize data, and how programs interface with the kernel through system calls
1_Introduction_To_Unix_and_Basic_Unix_CommandsGautam Raja
This document provides a content manual for the TATA CONSULTANCY SERVICES Pre ILP – Unix LOUNGE. It contains two chapters that introduce basic Unix concepts and commands. Chapter 1 covers an overview of operating systems and the architecture of Unix, including the kernel, shell, file system structure, and flavors of Unix. Chapter 2 describes basic Unix commands such as ls, pwd, man, date, and cal. It provides examples and explanations of how to use the options for each command. The document is intended to teach users fundamental Unix knowledge and skills.
The document provides information about the Linux operating system project completed by team X.P which includes five members. It discusses what an operating system is and lists some common operating systems. It then focuses on Linux, describing its history starting from Unix, its uses in various devices, features, and advantages over other operating systems like Windows. Some key advantages highlighted are that Linux is free and open source, highly customizable, secure, and requires low resources.
The document provides an introduction to UNIX and Linux operating systems. It discusses what an operating system is and its main tasks like controlling hardware, running applications, and managing files and data. It then covers the history of UNIX, its characteristics, parts like the kernel and shell, flavors including open source like Linux and proprietary like Solaris, interfaces, and programming tools available in Linux.
This document provides an introduction to UNIX/Linux operating systems. It discusses what an operating system is and its main functions. It then covers the history of UNIX, developed in the 1960s at Bell Labs. Characteristics of UNIX include being multi-user, multi-tasking, having a large number of free and commercial applications, and being less resource intensive than other operating systems. The document outlines the main parts of the UNIX OS and popular flavors including proprietary and open source versions like Linux. It also describes graphical and command line interfaces and provides an overview of UMBC's computing environment.
This document provides an introduction to UNIX/Linux operating systems. It discusses what an operating system is and its main functions. It then covers the history of UNIX, its general characteristics, and popular flavors including Linux. The document outlines the main parts of UNIX like the kernel, shell, and utilities. It compares Linux and Windows and describes UMBC's computing environment including graphical and command line interfaces. Finally, it lists some common programming tools available under Linux.
This document provides an overview of the ITI-481 Unix Administration course at Rutgers University. The course teaches students how to install and perform system administration of Unix operating systems. Major topics include installing Unix/Linux, account management, networking, security, and more. Students will install Linux on their own workstations during class time.
Linux is an open-source operating system that provides free and secure software. It allows applications and users to access computer devices and functions through the kernel, which manages communication between hardware, software, and processes. Files, directories, programs, and devices are all treated as files in the Linux file system hierarchy, accessed through commands like ls, mkdir, and rmdir.
This document provides an introduction to UNIX and Linux operating systems. It discusses what an operating system is and its main functions. It then describes the history and development of UNIX, its general characteristics, and parts like the kernel and shell. The document outlines different flavors of UNIX including proprietary and open source variations like Linux. It also discusses graphical and command line interfaces and compares Linux to Windows. Finally, it provides an overview of UMBC's computing environment and available UNIX/Linux systems.
This document provides an overview of the UNIX environment. It begins with an introduction to UNIX, including its history and key features such as multi-tasking and multi-user capabilities. It then covers the different shells in UNIX like Bourne, C, and Korn shells. It discusses popular UNIX distributions like Linux, FreeBSD, and Solaris. It also provides examples of basic UNIX commands for file manipulation, directory navigation, and viewing system information. References for further reading on UNIX are included at the end.
Basic Information About Linux. This helps you to know about the basic details of linux, such as architecture, kernel design, process management, file management and etc.
This document provides an introduction to the UNIX operating system. It discusses the history and development of UNIX, the key components of the UNIX system architecture including the kernel, shells/GUIs, and file system. It also outlines common UNIX commands and sessions, describing how to log in and out, change passwords, and view system information. The document is intended to explain the basic concepts and components of UNIX to new users.
Every time you switch on your computer, you see a screen where you can perform different activities like write, browse the internet or watch a video. What is it that makes the computer hardware work like that? How does the processor on your computer know that you are asking it to run a mp3 file?
Well, it is the operating system or the kernel which does this work. A kernel is a program at the heart of any operating system that takes care of fundamental stuff, like letting hardware communicate with software.
So, to work on your computer you need an operating system (OS). In fact, you are using one as you read on your computer. Now, you may have used popular OS’s like Windows, Apple OS X but here we see what Linux is and what benefits it offers over other OS choices.
The document defines an operating system and describes the key components and types of operating systems. It provides details on the differences between Windows and UNIX/Linux operating systems. It also summarizes the architecture of an operating system including the shell and kernel components. Common commands used in UNIX/Linux systems such as ls, cd, pwd are also described.
This document provides an introduction to Linux, including:
- An overview of what Linux is, its history originating from UNIX, and popular Linux distributions like Red Hat, Debian, and SuSE.
- A comparison of Linux and Windows in terms of cost, open source vs proprietary software, and operating system stability.
- Details about installing Linux, including partitioning schemes, file system types, and methods of installation like using DVD/CD or a USB drive.
- An overview of basic Linux commands for navigating the file system, like cd, ls, pwd, and man, as well as copying, removing, and viewing files.
- A working example of using Backtrack Linux for phishing
I have described all about linux OS starting from basics.
I guess this PPT will really be very very helpful for you guys.
This was one of the most appreciable PPT in my time when i presented it in my class.
The Building Blocks of QuestDB, a Time Series Databasejavier ramirez
Talk Delivered at Valencia Codes Meetup 2024-06.
Traditionally, databases have treated timestamps just as another data type. However, when performing real-time analytics, timestamps should be first class citizens and we need rich time semantics to get the most out of our data. We also need to deal with ever growing datasets while keeping performant, which is as fun as it sounds.
It is no wonder time-series databases are now more popular than ever before. Join me in this session to learn about the internal architecture and building blocks of QuestDB, an open source time-series database designed for speed. We will also review a history of some of the changes we have gone over the past two years to deal with late and unordered data, non-blocking writes, read-replicas, or faster batch ingestion.
Codeless Generative AI Pipelines
(GenAI with Milvus)
https://ml.dssconf.pl/user.html#!/lecture/DSSML24-041a/rate
Discover the potential of real-time streaming in the context of GenAI as we delve into the intricacies of Apache NiFi and its capabilities. Learn how this tool can significantly simplify the data engineering workflow for GenAI applications, allowing you to focus on the creative aspects rather than the technical complexities. I will guide you through practical examples and use cases, showing the impact of automation on prompt building. From data ingestion to transformation and delivery, witness how Apache NiFi streamlines the entire pipeline, ensuring a smooth and hassle-free experience.
Timothy Spann
https://www.youtube.com/@FLaNK-Stack
https://medium.com/@tspann
https://www.datainmotion.dev/
milvus, unstructured data, vector database, zilliz, cloud, vectors, python, deep learning, generative ai, genai, nifi, kafka, flink, streaming, iot, edge
The Ipsos - AI - Monitor 2024 Report.pdfSocial Samosa
According to Ipsos AI Monitor's 2024 report, 65% Indians said that products and services using AI have profoundly changed their daily life in the past 3-5 years.
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...sameer shah
"Join us for STATATHON, a dynamic 2-day event dedicated to exploring statistical knowledge and its real-world applications. From theory to practice, participants engage in intensive learning sessions, workshops, and challenges, fostering a deeper understanding of statistical methodologies and their significance in various fields."
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeWalaa Eldin Moustafa
Dynamic policy enforcement is becoming an increasingly important topic in today’s world where data privacy and compliance is a top priority for companies, individuals, and regulators alike. In these slides, we discuss how LinkedIn implements a powerful dynamic policy enforcement engine, called ViewShift, and integrates it within its data lake. We show the query engine architecture and how catalog implementations can automatically route table resolutions to compliance-enforcing SQL views. Such views have a set of very interesting properties: (1) They are auto-generated from declarative data annotations. (2) They respect user-level consent and preferences (3) They are context-aware, encoding a different set of transformations for different use cases (4) They are portable; while the SQL logic is only implemented in one SQL dialect, it is accessible in all engines.
#SQL #Views #Privacy #Compliance #DataLake
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataKiwi Creative
Harness the power of AI-backed reports, benchmarking and data analysis to predict trends and detect anomalies in your marketing efforts.
Peter Caputa, CEO at Databox, reveals how you can discover the strategies and tools to increase your growth rate (and margins!).
From metrics to track to data habits to pick up, enhance your reporting for powerful insights to improve your B2B tech company's marketing.
- - -
This is the webinar recording from the June 2024 HubSpot User Group (HUG) for B2B Technology USA.
Watch the video recording at https://youtu.be/5vjwGfPN9lw
Sign up for future HUG events at https://events.hubspot.com/b2b-technology-usa/
2. COURSE AIMS
• By the end of the course you should be able:
• To be able to explain why we use UNIX and what we use it for
• Navigate the file system
• Create, copy, rename, move and delete files and directories
• Use redirection and pipe facilities
• To be able to explain jobs and processes
• Customise your login environment
23 December 2016, Page 2
3. AGENDA
• A Very Brief History of UNIX
• Logging On
• Getting Started
• Working With Files
• Displaying File Contents
• Working With Directories
• The vi Editor
• Redirection and Pipes
• Recalling Commands
• The Superuser, File Permissions and Access Control
• Working With Processes
• Shell Environment
• Other Useful Stuff!
23 December 2016, Page 3
5. A VERY BRIEF HISTORY OF UNIX
The forerunner to UNIX, called Multics was first developed in the
1960’s.
AT & T pulled out of the consortium but Ken Thompson continued to
develop on the GE-645 Mainframe.
With help from Dennis Ritchie of C fame, they rewrote Space Travel
in assembly to run on a DEC PDP-7.
From there it was a small step for Ken to write a new Operating
System for the PDP-7.
In the 1970s the project was named Unics as a contrast to Multics;
the spelling was later changed to Unix.
23 December 2016, Page 5
6. A VERY BRIEF HISTORY OF UNIX
In 1973 UNIX was completely rewritten in C.
At this point AT & T made UNIX available to Universities and
commercial firms under licence.
In the 1980s AT & T released a commercial version of UNIX that
would later be know as System V
University of California, Berkeley, worked on their own version of
UNIX that would later become BSD UNIX.
23 December 2016, Page 6
7. A VERY BRIEF HISTORY OF UNIX
In 1991 Linus Torvolds wrote the first version of the Operating
System Linux.
The dot-com crash in the early 2000s led to a considerable
consolidation of UNIX operating systems. All the UNIX
variations available now are based either on System V, BSD or
Linux.
Read more at http://en.wikipedia.org/wiki/Unix
23 December 2016, Page 7
8. WHY USE UNIX?
UNIX is a mature group of operating systems with a proven track
record for performance, reliability, and security in a server
environment.
The thirty years of continual development has produced a group of
operating systems, and extremely powerful multiprocessor server
hardware tailor made to its needs, that are still at the forefront of
computer processing today.
UNIX was designed to be able to run multiple processes
simultaneously and allow multiple users to use the system at the
same time and it handles these tasks superbly.
23 December 2016, Page 8
9. THE OPERATING SYSTEM MODEL
All of the different flavours of UNIX have the same architectural
model:
23 December 2016, Page 9
The Kernel
Commands and
Utilities
The Shell
10. THE KERNEL
The Kernel is the core of the Operating System. It contains routines
and procedures that control all of the hardware that is attached to
the system. Some of these my be coded into the kernel directly,
some may be in the form of software drivers.
The kernel controls many aspects of the how the machine works. It
controls all access to the hardware, allocating resources to
processes that need them. It manages disk processing and
memory, swapping processes between the two as required. It also
controls what users can access the system and what they can do.
23 December 2016, Page 10
11. COMMANDS AND UTILITIES
The Kernel does not contain any commands. A user can not call
something in the Kernel directory. Nearly all of the commands and
utilities that exist are held as executable programs on the disk.
There are a wide range of commands and utilities available that
allow us to carry out all the actions that we need to. These include:
• Extensive commands for managing files and directories
• A variety of tools for searching and manipulating data
• Administrative tools for maintaining the system and working with user accounts
• Network tools
• Performance management tools
• ... And many others!
23 December 2016, Page 11
12. THE SHELL
The Shell is a special kind of program that provides the user an
environment to work in. The shell maybe a graphical interface using
X-Windows (like the KDE or Gnome, both used in Linux) or it can be
a command line interface such as the Korn Shell. In either case it
allows the users to communicate with the system.
There are many different shells available including C, Bourne, Bash
(Bourne Again Shell), korn, zsh.
The shell environment is where we run all our commands. It also
provides us with an environment to string commands together into a
shell script.
23 December 2016, Page 12
13. FILE AND DIRECTORIES
UNIX filenames are case sensitive. This means that the following
filename examples are all different:
stuff STUFF Stuff StuFF
Since all commands and utilities are also held as files on the disk,
those command calls are also case sensitive:
ls –f is not the same as ls -F.
23 December 2016, Page 13
14. FILE AND DIRECTORIES
You can also use – (dash) and _ (underscore) in file names. Other
characters can be used (such as $ or &) but they have special
meanings to the shell and so are used infrequently.
While it is possible to create filenames with spaces in, this should be
avoided. While in a graphical environment this would be handled by
the gui, on the command line you have to remember to quote the
filenames. IT is much simpler to avoid the user of spaces
altogether..
23 December 2016, Page 14
15. FILE AND DIRECTORIES
The special character . (period) can also be used but has a special
meaning when used as the start of a file name: it denotes the file as
hidden.
By convention filenames are lowercase and with a few exceptions
this is true of all UNIX flavours
Filenames must be unique within each directory.
23 December 2016, Page 15
16. DIRECTORY STRUCTURE
The following diagram demonstrates the hierarchical structure of a
UNIX filesystem:
(root)
23 December 2016,, Page 16
/
usrdev
local
varetc homesbin bin
binsbin spoo
l
adm
ghzAbc def
17. DIRECTORY STRUCTURE
root is the topmost level of the directory structure and is referenced
by /.
/dev Contains device files which point to hardware
devices connected to the system.
/sbin Contains system administration utilities.
/bin Normally points to /usr/bin and contains
standard commands.
/usr/bin Contains System V command files.
/var Contains logs and other transient files (such as
printer spools and emails).
/etc Contains system configuration files, including
user definition files.
/home Users home directories.
23 December 2016, Page 17
18. WHEN IS A FILE NOT A FILE?
UNIX differs from most operating systems in that it is file orientated.
As far as UNIX is concerned, disk drives, terminals, modems,
network adaptors etc are all just files.
Therefore to understand UNIX you need to understand what files
are. A file is nothing more than a stream of bytes. There are no
special file structures and only a few special types (for keeping track
of disks and a few other purposes).
This means you can access hardware on the UNIX system just as if
you were accessing a file.
23 December 2016, Page 18
19. TRANSFERRING FILES
Be careful when moving UNIX files to other systems.
UNIX uses a single linefeed character between lines of text where
Windows uses carriage-return/linefeed combination.
A common problem we experience is having ^M characters in shell
scripts on UNIX. This comes from having the file in windows format
and then transferring it to UNIX. (Windows and UNIX files use
different sequences of non-printable characters as line terminators).
It’s best to convert the file before you transfer it to UNIX using
something like UltraEdit. You can convert it on the UNIX box but the
tools are not always available (dos2unix).
23 December 2016, Page 19
21. CONNECTING TO A UNIX MACHINE
Telnet is available on most UNIX boxes and allows us to connect to
that machine.
However it is an insecure protocol (passwords and commands are
sent via plain text across the network) so you should use
alternatives if they are available.
Whether you use Telnet or Secure Shell you still need to know the
name of the UNIX box you want to connect to. You can use the
physical name of the box (lupus-1 for instance) or you can use the
Call By Service name.
23 December 2016, Page 21
22. CONNECTING TO A UNIX MACHINE
The Call By Service name is something that is implemented by
Networks via the DNS. It allows users to connect to the same name
regardless of the name and address of the underlying box. If there
is a hardware failure and the standby machine is brought into action,
you don’t have to make any changes to be able to connect to it, you
still just call the Call by Service name.
PuTTY is the company’s choice of Telnet and ssh client. It is free
and is available for install on all machines. So, lets fire it up...
23 December 2016, Page 22
23. PUTTY CONFIGURATION
There are many settings that you can change in PuTTY, the window
title to the background and text colours. You can also select the
connection method that you connect with (telnet or ssh). Once you
have set up your session the way you like it you can save these
details so you don’t have to change them each time you log on.
One thing you will want to change is the backspace key. By default
PuTTY will issue a ^? each time you press backspace. You will
want to change this so that a real backspace character is issued
instead.
23 December 2016,, Page 23
24. 23 December 2016, Page 24
Setting this will mean that a
real backspace character will
be issued via PuTTY.
Click on the Keyboard menu on the right and then select Control-H
under The Backspace Key heading.
25. 23 December 2016, Page 25
Type the call by service name
for the UNIX box you want to
connect to here.
Now the backspace key has been changed you can log onto a UNIX
box.
Then hit return or click Open
26. 23 December 2016, Page 26
And now you are logged on! The administrators can change the
messages that are issued when you log on so you might not always get
what you see above.
27. To log out you type exit or hit <ctrl> + <d>.
If you are running puTTY then the window will close when you exit
otherwise you will get a message saying your connection has been
terminated.
23 December 2016, Page 27
29. COMMAND SYNTAX
The following syntax is common to the majority of UNIX and Linux
commands:
<command> [ <options> ] [ <arguments> ]
Options modify what the command will do. Arguments are what the
command will act against.
Different commands will take different options, some of which
maybe upper or lower case, depending on the command.
Normally when a command completes successfully there will be no
response back to the screen, you will just get your command prompt
back.
23 December 2016, Page 29
30. COMMAND SYNTAX
The command must be separated from the argument by spaces. If
multiple arguments are used each must be separated by spaces.
Some commands will use a default argument if none is specified.
ls /tmp /etc mysub
Lists the contents of the /tmp, /etc and mysub directories.
cat file1 file2
Concatenates the text in the files file1 and file2 and displays it.
pwd
Shows your current working directory
23 December 2016, Page 30
31. COMMAND SYNTAX
Options, often also called flags, modify how the command will
operate. Often they modify the output of the command but they can
affect any aspect of what the command is doing. When specified,
any options must be separated from the command by one or more
spaces.
Options are normally a hyphen followed by a single character.
Where multiple options are specified they can be grouped together
with a single hyphen. If an option includes some additional data
then it should immediately follow the option.
Some Linux commands give you the choice of using option words.
When an option word is used it is preceded with a double hyphen (-
-)
23 December 2016, Page 31
32. COMMAND SYNTAX
ls –a
Lists all files both hidden and non-hidden files in the current working
directory.
ps –e –f ps –ef
Both commands present a full listing of all running processes on the
system.
ls –aF /home /tmp
Lists all files in the /home and /tmp. Each entry is displayed with a
flag to indicate it’s type.
who –-users (Linux only)
Adds a column showing idle time to the standard who command.
The standard UNIX equivalent would be who –u and this also
works for Linux.
23 December 2016, Page 32
33. GETTING HELP
If you ever get stuck with a command in UNIX there is an online
manual that you can use. Not all commands are in there but most
common ones are.
To look up help on the command cat, you would run:
man cat
Of course, if the command has no manual page then you could just
try running it with a –h flag, or some random flags to force it to throw
an error and issue a help page.
23 December 2016, Page 33
34. EXERCISE 1
1. List all the files in your home directory. Are there any hidden files?
2. How do you find help on the command ps?
3. How do you read the man pages for the command man?
23 December 2016, Page 34
35. EXERCISE 1 ANSWERS
1. ls –lA
Hidden files are those starting with a period, for example .login
2. man ps
3. man man
23 December 2016, Page 35
37. LISTING FILES
ls /tmp /etc mysub
Lists the contents of the /tmp, /etc and mysub directories.
ls –l /tmp
Shows you a long listing for the /tmp directory. This includes the
following information:
-rwxr-xr-- 1 m6345 appsup 29 Jan 19 11:50
myfile
Permissions User Last modified
File type Links Group File Size
Filename
Your output may vary on different versions of UNIX.
23 December 2016, Page 37
38. COPYING FILES
Use the cp command to copy files:
cp [-i] <file-list> <destination>
The destination can be either a file or a directory. If a directory is
specified then multiple files can be listed in the <file-list>.
If a destination file is specified then it will be overwritten if it exists,
unless you specify the –i flag. If specified this causes cp to prompt
to overwrite an existing file.
23 December 2016, Page 38
39. COPYING FILES
cp file1 file2
Copies file1 to file2 in the current working directory
cp file1 /app/ice1/data
/app/ice1/data is a directory and this copies the file file1 into
it, leaving the name the same.
cp file1 file2 file3 /tmp
Copies file1, file2 and file3 to /tmp. It will prompt to
overwrite any files that already exist in /tmp.
cp /tmp/file1 /app/ice1/data/newfile
Copies /tmp/file1 to /app/ice1/data and rename it as
newfile.
23 December 2016, Page 39
40. MOVING AND RENAMING FILES
Use the mv command to move and rename files:
mv [-i] <file-list> <destination>
The destination can be either a file or a directory. If a directory is
specified then multiple files can be listed in the <file-list>.
When a directory is specified then the listed files will be moved to
that directory.
If the destination is a file then only a single file can be specified in
the <file-list> and the file will be renamed.
As with cp files will be overwritten unless the –i flag is specified.
23 December 2016, Page 40
41. MOVING AND RENAMING FILES
mv file1 file2
Renames file1 to file2 in the current directory.
mv file1 /tmp
Moves file1 to /tmp.
mv –i file1 file2 file3 /app/ice1/data
Moves file1, file2 and file3 to the directory
/app/ice1/data.
mv subdir /tmp
Moves the directory subdir to /tmp. Directories can also be
renamed by specifying a new name.
23 December 2016, Page 41
42. COPYING AND MOVING FILES
When you copy a file you create a new version of it. As such you
will be the owner of the new file and it will have permissions that
relate to your setup. If you want to preserve the ownership and
permissions of the file when you copy it, include the –p flag:
cp –p /tmp/some_file some_unchanged_file
When you move a file it will keep the same ownership and
permissions that it has when you start. However if you do not have
permission to delete the file then the move will issue an error. The
file will be copied to the target location, it just won’t be deleted from
the source location.
23 December 2016, Page 42
43. DELETING FILES
Use the rm command to delete files:
rm [-i] <file-list>
All listed files are deleted. If the –I option is used then the user is
prompted to confirm the deletion of each file before it occurs. Each
file is deleted as it is confirmed. If you change your mind part way
through a long list of files the earlier files will already have been
deleted!
DELETED FILES CAN NOT BE RECOVERED UNLESS DONE SO
FROM A BACKUP. THERE IS NO RECYCLE BIN!
23 December 2016, Page 43
44. DELETING FILES
rm /home/spike/report_data
Deletes the file report_data from the directory /home/spike.
rm –i file1 file2 file3
The files file1, file2 and file3 will be deleted from the current
directory. The user will be asked to confirm each deletion.
23 December 2016, Page 44
46. DISPLAYING FILE CONTENTS
There are various commands that you can use to view the contents
of files. The following slides deal with the commonly used ones.
cat file1 file2
Concatenates the text in the files file1 and file2. The entire
contents of the files are output to the screen. If there are more rows
in the file than there are lines on the screen then the excess output
will scroll off the top of the screen.
head [–n] file1
Displays the top n lines of file1 to the screen. If n is not specified
then the top 10 rows are shown.
23 December 2016, Page 46
47. DISPLAYING FILE CONTENTS
tail [–n –f] file1
The opposite of head, tail shows you the bottom n rows of a file.
Again if n is not specified then the bottom 10 rows will be shown. If
you wish to see lines being appended to the bottom of the file (such
as a log file) then the –f flag can be used.
tail –f /logs/script.log
Shows you lines as they are appended to the file
/logs/script.log. The command will not return until you hit
<ctrl> + <c>.
23 December 2016, Page 47
48. DISPLAYING FILE CONTENTS
more file1
Displays file1 a screen at a time. To advance by a screen press
<space>. To advance by a single line press <enter>.
less file1
less is only available on Linux. It is similar to the more command
but it allows you to move backwards through the file, as well as
forwards.
23 December 2016, Page 48
49. OTHER FILE COMMANDS
touch file1
Touch will create file1 in the current directory. If you specify a full
path (such as /tmp/file1) the file will be created there. The file
will be empty. If the file already exists then the last modified date is
updated as long as you have access permissions to that file.
wc file1
wc (word count) counts all the characters, words and lines in a file.
This can be useful to see if a file is growing without having to tail
it. If you only want to count rows use the –l flag. Other flags are
available, check the man pages to find out what.
23 December 2016, Page 49
50. EXERCISE 2
1. List the contents of the /etc directory. Is there a file called
hosts? When was it last modified?
2. How many lines are there in the /etc/hosts file?
3. Can you look at the first 20 lines of the /etc/hosts file?
4. Copy the file /etc/group to your home directory.
5. Rename the group file in your home directory to mygroup.
6. Find out how to count the number of characters in mygroup using
wc.
7. View the contents of the new mygroup file.
23 December 2016, Page 50
51. EXERCISE 2 ANSWERS
1. ls –l /etc
ls –l hosts
2. wc –l /etc/hosts
3. head -20 /etc/hosts
4. cp /etc/group /home/<username>
5. mv group mygroup
6. man wc
wc –m mygroup
7. cat mygroup
or
more mygroup
23 December 2016, Page 51
53. LISTING DIRECTORIES
Directory contents can be listed using the same ls command that is
used for files:
ls [<options>] [<filename-list>]
When a directory is specified its contents will be listed. If no
filename is specified then the current directory is listed. If only files
are specified then only details relating to those files will be shown.
23 December 2016, Page 53
54. LISTING DIRECTORIES
There are a number of flags that modify the output. They are (in no
particular order):
-F flags different file types
-a shows all files both hidden and non hidden
-l a long listing
-t sort files in modification time order (newest first)
-r sort files in reverse order (by time if –t is used or
alphabetical if not)
-R recursively list subdirectories encountered.
-d list only directory attributes
-s list size in blocks for all entries
23 December 2016, Page 54
55. LISTING DIRECTORIES
To display a long listing use the –l flag:
-rwxr-xr-- 1 m6345 appsup 29 Jan 19 11:50
myfile
Permissions User Last modified
File type Links Group File Size
Filename
Depending on your version of UNIX this output may be slightly
different (normally around the date field).
23 December 2016, Page 55
56. LISTING DIRECTORIES
The file type will be one of the following:
d a directory
b or c a block or character device
l a symbolic link or shortcut
p a named pipe or FIFO file
s a socket
- None of the above, an ordinary plain file
23 December 2016, Page 56
57. SPECIAL DIRECTORY FILES
In each directory there are two special files:
. - Refers to the current directory
.. - Refers to the parent directory
cp /tmp/file1 .
Copies the file /tmp/file1 into the current directory.
cd ..
Moves the current working directory up one level.
23 December 2016, Page 57
58. NAVIGATING DIRECTORIES
Use the cd command to navigate between directories:
cd /home/m6345
Changes the current working directory to /home/m6345.
cd /tmp
Changes the current working directory to /tmp.
cd –
Returns you to the previous directory you were in. In the case of the
previous examples, /home/m6345.
23 December 2016, Page 58
59. NAVIGATING DIRECTORIES
cd ..
Moves you one level up the directory tree. If you were in
/home/m6345, you would end up in /home.
This can be combined with further changes. For instance:
cd ../n1098
Would have moved you from /home/m6345 to /home/n1098.
cd on its own will return you to your home directory.
pwd
Shows you the current working directory.
23 December 2016, Page 59
60. CREATING DIRECTORIES
Use the mkdir command to create directories:
mkdir [-p] <directory-list>
mkdir scripts work
Creates directories called scripts and work in the current
directory.
mkdir /home/m6345/temp
Creates a directory called temp in /home/m6345. If /home/m6345
doesn’t exist an error will be reported.
mkdir –p /home/m9999/work_files
Creates a directory called work_files in /home/m9999. If either
/home or m9999 do not exist they will also be created.
23 December 2016, Page 60
61. COPYING DIRECTORIES
Use the cp command to copy directories. The –r flag must be
included:
cp –r <source-directory> <destination-directory>
The source directory and its contents are copied to the destination
directory. The destination directory should exist or an error will be
raised.
cp –r mysub /home/m6345
Copies mysub and all its contents to /home/m6345. mysub
becomes a subdirectory of /home/m6345.
23 December 2016, Page 61
62. MOVING AND RENAMING DIRECTORIES
Use the mv command for moving and renaming directories:
mv <source-directory> <destination-directory>
The source directory will be moved and become a sub-directory if
the destination directory already exists.
The source directory is renamed if the destination directory does not
exist.
mv scripts tmp
Moves scripts into tmp if tmp already exists. If tmp does not
exist then scripts will be renamed to tmp.
23 December 2016, Page 62
63. DELETING DIRECTORIES
Use the rmdir command to remove:
rmdir <directory-list>
rmdir will only remove empty directories. If the directory contains
any files the deletion will fail.
rmdir work_files test
Removes the directories work_files and test if they are empty.
If a directory has only the special files . and .. within it, it will be
removed by rmdir.
23 December 2016, Page 63
64. DELETING DIRECTORIES
The rm command can also be used to remove diretories:
rm –r work_files
No warning is issued unless the –i flag is used.
Use extreme caution when using this command. If you use an
absolute pathname then you could remove an entire filesystem.
As with all deletions: THERE IS NO UNDELETE!
23 December 2016, Page 64
65. FILENAME WILDCARDS
Most commands that deal with files will accept multiple filenames for
processing. If several files with similar names are to be referenced
this can be done in a single argument using wildcards.
• * represents zero or more matches of any character.
• ? represents a single occurrence of any character.
• [...] represent a single occurrence of any of the characters listed between the
brackets.
The exception to this is if you want to see hidden files. If either of
the first two wildcard characters are used the . must be specified.
23 December 2016, Page 65
66. FILENAME WILDCARDS
ls –l s*
Lists all files beginning with s in the current directory.
mv .???? /tmp
Moves all hidden files with 5 character names (including the leading
.) to the directory /tmp.
cp * /home/m6345
Copies all files in the current directory (except hidden files) to the
directory /home/m6345.
rm *[0-4]
Deletes all files (except hidden files) that end in the numbers 0, 1, 2,
3 or 4.
23 December 2016, Page 66
67. FILENAME WILDCARDS
To handle those times when you want everything that does NOT
match you can use an exclamation mark in the [..] wildcard
notation. It has to be specified as the first character in the class:
ls –l [!A-Z]*
Lists all non-hidden files that DO NOT start with the an uppercase
character.
23 December 2016, Page 67
68. EXERCISE 3
1. Verify you are in your home directory.
2. Create a new directory called hidden_files in your home
directory.
3. Copy one of the hidden files in your home directory to the new
directory. Rename the file so that it is not hidden.
4. Verify the file has been copied to the new directory.
5. Copy the file called issue from /etc to your directory
hidden_files. Do this without changing directory.
6. Rename the issue file in your directory to myissue (not the one
in /etc!)
7. Copy the directory hidden_files and it’s contents to a new
directory called myfiles.
8. Delete the directory hidden_files and its contents.
23 December 2016, Page 68
72. THE VI EDITOR
The vi editor is often the editor of choice when on a UNIX system.
There are others like emacs and ed but vi is the most popular.
vi allows you to edit a file from the command line. While some of
the commands appear to be quite random you need to remember
that this program was written in the day when the only keys on the
keyboard were a-z, 0-9 and a few other punctuation marks!
In Linux vi has been replaced by vim a more GUI friendly version
that makes use of today’s more advanced terminal emulators.
However we will only cover vi here.
23 December 2016, Page 72
73. THE VI EDITOR
vi operates in three distinct modes:
• Command Mode – Allows you to move around the screen and to issue editing
commands such as copy and paste.
• ex Mode – also known as last line mode, is entered from the Command Mode. It’s
main purpose is to run commands. For example text search and replace and setting
vi options.
• Input Mode – Allows you to input text. Only entering and deleting text (using
<backspace>) can be carried out in this mode. The <Esc> key terminates Input
Mode and switches back to Command Mode.
23 December 2016, Page 73
77. 23 December 2016, Page 77
Save the file by entering Ex Mode and typing :wq!
78. VI COMMANDS
vi provides a vast array of commands. The more
common are shown on the vi crib sheet that you’ve been
given.
Some vi defaults can be changed by editing your .exrc
file. However we’ll save further discussion for another
day.
23 December 2016, Page 78
79. VI ALTERNATIVES
As mentioned earlier there are alternatives to vi.
One such alternative is to use a windows based editor that
allows you to open files from a UNIX box. UltraEdit is a popular
choice and is available under licence to . It uses FTP to open
and save files on the UNIX box while allowing you to work with a
windows editor.
You will need to get UltraEdit installed on your PC as it is not part
of the standard build. You will also need an account on the UNIX
box where the files you wish to edit reside.
When saving a file back to the UNIX box make sure you have
converted the file format to UNIX (File -> Conversions -> Dos to
UNIX). This will prevent ^M’s appearing in the script.
23 December 2016, Page 79
81. INPUT/OUTPUT REDIRECTION
One of the major leaps in UNIX was the abstraction of
communication for processes. In UNIX a program does not need to
know how to write to the screen or a file, or how to get input from the
keyboard. All that communication is handled via streams that are
provided by the Kernel.
Each process has three default streams that it can interact with.
These streams, also called channels, provide input to the program
and allows two channels of output, one for errors and one for
everything else.
The three channels are:
• Standard in, also known as STDIN is the input channel, stream 0
• Standard out, also known as STDOUT is the output channel, stream 1
• Standard error, also known as STDERR is the error channel, stream 2
23 December 2016, Page 81
82. INPUT/OUTPUT REDIRECTION
Each of the three streams have default locations:
STDIN is usually input from the keyboard
STDOUT is usually output to the screen
STDERR is usually output to the screen
However, it is possible to redirect these streams so that output
comes, or goes to a different location.
Input could be taken from a file or another command while output
could be directed to a file, printer or some other device attached to
the system.
23 December 2016, Page 82
83. OUTPUT REDIRECTION
To redirect output you use the > character.
cat file1 > new_file
This cats file1 and redirects STDOUT to a file called new_file.
echo “This is a test” > test_file
Sends the string This is a test to a file called test_file.
grep ORAERR log_file > /dev/null
Grep for ORAERR and send the output to /dev/null.
run_ftp.ksh > run_ftp.log
Redirects all STDOUT from the script run_ftp.ksh to a file called
run_ftp.log.
23 December 2016, Page 83
84. ERROR REDIRECTION
As well as STDOUT a program may also generate error messages.
These are redirected by preceding the redirection character > with
the channel number for errors, 2.
cat file1 file2 2> errors1
Cats file1 and file2. If either of the files do not exist then the
error is sent to a file called errors1.
touch file1 2> /dev/null
Creates file1 and direct any errors to /dev/null.
cp file1 /tmp/file2 2> errors2
Copies file1 to /tmp/file2 and direct errors to a file called
errors2.
23 December 2016, Page 84
85. REDIRECTING BOTH OUTPUT AND ERRORS
You can redirect both STDOUT and STDERR at the same time.
cat file1 file2 > log 2> errors2
Cats file1 and file2 to a file called log and directs any errors to
errors2.
If you want to send STDOUT and STDERR to the same file you can
use the following:
cat file1 file2 > log 2>&1
Cats file1 and file2 to a file called log. Any errors are
redirected to stream 1, which is redirected to log.
23 December 2016, Page 85
86. APPENDING OUTPUT
When output is redirected to a file, if that file does not exist, it is
created. When using the > character any existing file will be
overwritten. However, you may want to append the output to an
existing file. To do that use the >> construct. Both STDOUT and
STDERR can be redirected in this way.
cat file1 >> log
Appends the contents of file1 to log.
cat file1 file2 >> log 2>> error1
Appends the contents of file1 and file2 to log and send any
errors to error1.
If sending STDOUT and STDERR to the same use:
cat file1 file2 >> log 2>>&1
23 December 2016, Page 86
87. INPUT REDIRECTION
Most processes that run will have predefined input paths set up.
The UNIX mail program for instance normally takes input from the
keyboard for the body of the email. However you can redirect that
input from a file by using the < character.
mail –sMyFile < email_text
Calls mail and uses the contents of the file email_text as the
body of the email, rather than taking input form the keyboard.
wc –l < file1
Redirects input to wc from file1. This is almost the same as
running
wc –l file1. Can you work out what the difference is?
23 December 2016, Page 87
88. PIPES
It is possible to pass the STDOUT of one command into the STDIN of
another by using pipes. The | character is used for this.
ps –ef | grep oracle
Lists all the processes running on the system and extract all those
with the work oracle in them.
cat file1 | tr 'a-z' 'A-Z‘ > newfile
Translates all lowercase characters in file1 to uppercase and
outputs the result to newfile.
Making use of input redirection this could be written as:
tr ‘a-z’ ‘A-Z’ < file1 > newfile
23 December 2016, Page 88
89. THE TEE COMMAND
The tee command can be used to redirect STDOUT to multiple
destinations. It is so called as it acts as a T-junction in the pipeline.
who | tee users | wc –l
Runs the who command. The listing is sent to a file called users
and also passed to the wc command. The number of users logged
on is output to STDOUT.
If the file you tee to already exists it will be overwritten. If you
include the
–a flag then the file will be appended to.
echo “This is a message” | tee -a log
Displays the message on the STDOUT and also sends it to a file
called log.
23 December 2016, Page 89
90. EXERCISE 4
1. Check you are in your home directory.
2. List the contents of the /etc directory and redirect the output to a
file called etc_listing. Display the contents of etc_listing.
3. Using vi, edit the etc_listing file. Add a row to the file
containing your name. Display the contents once you have exited
vi.
4. Append the date to the etc_listing file, without using vi.
Display the file to ensure it has worked.
5. Display the contents of the files mygroup and mypasswd in your
home directory to the screen. Redirect any errors to a new file
called errors1.
6. Repeat the step above but now redirect ALL output to a file called
output1.
7. What’s the minor difference between:
more output and cat output | more
23 December 2016, Page 90
91. EXERCISE 4 ANSWERS
1. pwd
2. ls –l /etc > etc_listing
more etc_listing
3. vi etc_listing
more etc_listing
4. date >> etc_listing
tail etc_listing
5. cat mygroup mypasswed 2> errors1
6. cat mygroup mypasswed > output1 2>&1
7. Involving the pipe means that you run extra processes. If
you are ever piping cat into something consider if you can use
input redirection instead!
23 December 2016, Page 91
93. RECALLING COMMANDS
You can recall previously issued commands when you are on the
command line.
To see previously issued commands run:
history
The last 16 commands will be displayed along with a number. This
is their place in the command history list. If you want to see more
then run:
history -50 | more
Since 50 commands will probably go off the top of the screen you’ll
want to pipe to more to see them a screen at a time.
23 December 2016, Page 93
94. RERUNNING COMMANDS
Once you know what command you want to rerun and it’s number in
the history list, you can easily rerun it.
In the Korn shell you can issue r 245 to rerun the command at
position 245 in the history file. To run the last command you can just
issue r on its own.
In the Bash shell you can issue !245.
!! Will run the last command issued.
23 December 2016, Page 94
95. EDITING THE HISTORY FILE
In the Korn shell you can edit the history file and commands that you
recall to the command line using the vi editor. This functionality is
not enabled by default and so you need to issue:
set –o vi
You can then use the same editing commands that you would in vi
on the command line. k will move up one line while j will move
down one line.
If you want to search for a particular command, hit <Esc>, then /
and then type part of the command you are trying to find. If the first
command returned is not the one, hit n to search for the next.
23 December 2016, Page 95
96. EDITING THE HISTORY FILE
Under the Bash shell running on Linux it is possible to use the
cursor keys to navigate the command history.
23 December 2016, Page 96
98. THE SUPERUSER - ROOT
Most of the user accounts on a UNIX system are not special. Those
accounts will be limited in what they can do and access by the group
permissions that they have.
The exception to this is the superuser account, by convention called
root.
This account has unlimited privileges on the UNIX machine. It can
look at any file, kill any process and modify any permissions. It can
also shutdown the system, mount and unmount filesystems and
carry out a variety of administrative tasks.
23 December 2016, Page 98
99. THE SUPERUSER - ROOT
The superuser account has the User ID number of 0 and Group ID
number of 0.
Some programs will bypass checks they normally make if you are
running with a User ID number of 0. For instance as root you can
change a users password without knowing it.
You are unlikely to have access to root unless you are working as
a UNIX Administrator. However if you ever reach those dizzy
heights remember, just because you can, doesn’t mean you should!
23 December 2016, Page 99
100. FILE LISTING
When a user is created it is a assigned a unique ID (UID) and is
associated with a group and given a Group ID (GID).
Every file and directory on the system have a number of attributes
associated with them. These hold the owner and group information
along with the access permissions for the file.
Running ls –l displays these attributes:
-rwxr-xr-- 1 m6345 appsup 29 Jan 19 11:50
myfile
Permissions User
File type Links Group
23 December 2016, Page 100
101. IMPORTANT FILES
There are two system files that contain the user and group
information.
/etc/passwd contains one row for each user on the system. It
contains their user ID, their password, UID, GID, user information
(that could be a name or department), their home directory and their
default shell.
/etc/group contains one row for each group on the system. It
contains the group name, GID and a list of user IDs associated with
that group.
Commands such as login and ls use these files to translate the
UID and GID into their proper names. Commands that lookup
users, such as who, logname and id also display information from
these files.
23 December 2016, Page 101
102. FILE PERMISSIONS
The permission attributes in the ls –l listing are divided into three
sets of permissions: one for the owner, one for the group and one
for everyone else (a group called others). Each set is made up of
three characters that indicate the allowed permissions:
If a permission is not permitted then a hyphen is displayed.
23 December 2016, Page 102
r Indicates Read permissions are permitted
w Indicates Write permissions are permitted
x Indicates Execute permission are permitted
103. FILE PERMISSIONS
So, the permission:
rwxr-xr--
allows read, write and execute access for the owner, read and
execute access for the group and read only for others.
23 December 2016, Page 103
104. FILE PERMISSIONS
For ordinary files:
• Read permission allows the user to read the contents of the file.
• Write permission allows the user to modify the contents of the file either by using an
editor or by redirecting output to it.
• Execute permission allows a program file or shell script to be executed from the
command line..
23 December 2016, Page 104
105. FILE PERMISSIONS
For directories:
• A directory listing can be made with only read permission. However to execute a long
ls –l listing execute permission is required.
• To create or delete files in a given directory a user must have read and execute
permission.
• To cd to a directory the user must have execute permission on that directory.
23 December 2016, Page 105
106. FILE PERMISSIONS
• A user does not need read or write permission on a file to be able to rename or delete
it. A warning before deletion will be issued by this can be confirmed.
• A user does not need read or write permission to move a file. However read
permission is required if moving to another filesystem.
• These actions can be carried out irrespective of the owner of the file concerned.
• A user can rename and delete files in any directory that has write and execute
permissions, regardless of the ownership of those files.
23 December 2016, Page 106
107. FILE PERMISSIONS
• Given the previous slides you will want to ensure that people can not access
the files in your directory detrimentally.
• To protect your home directory (stopping users renaming and deleting your files
or from copying files into or moving files out of your home directory)
• you can change the permissions on your home directory to restrict access. The
following permissions are normally used and allow read access to your files:
rwxr-xr-x
• To prevent read access a more restrictive set of permissions could be used:
• rwx------
23 December 2016, Page 107
108. CHANGING PERMISSIONS
Use the chmod command to change the permissions of a file:
chmod <permissions> <file-list>
You can specify the permissions to change to using either symbolic
or octal notation.
The permissions of a file can only be changed by the owner of that
file or by the superuser.
23 December 2016, Page 108
109. CHANGING PERMISSIONS – SYMBOLIC NOTATION
Symbolic notation has three elements:
[<who>]<operator><permissions>
Where:
• <who> is any combination of the letters u (owner), g (group) and o (others). The letter
a represents the combination ugo and this is assumed if <who> is omitted.
• <operator> is either + (add), - (remove) or = (set).
• <permissions> is any combination of the letters r, w and x.
23 December 2016, Page 109
110. CHANGING PERMISSIONS – SYMBOLIC NOTATION
chmod u+x file1
Adds execute permissions for the owner.
chmod +r file1
Adds read permissions for everyone
chmod o-rwx file1
Removes read, write and execute permissions for others.
chmod u=rwx,g=rx,o=r file1
Sets read, write and execute permissions for the owner, read and
execute for the group and read for others:
23 December 2016, Page 110
111. CHANGING PERMISSIONS – OCTAL NOTATION
You can also use octal notation. Each type of permission has a
decimal value and these are combined to give an overall
permission.
The decimal values are:
r (read) = 4
w (write) = 2
x (execute) = 1
- (no permission)= 0
Permissions can be expressed as three digits, once each for the
owner, the group and others by adding together the assigned
values.
23 December 2016, Page 111
112. CHANGING PERMISSIONS – OCTAL NOTATION
These are the most commonly used permissions for files:
chmod 644 myfile
Sets read and write permissions for the owner and read only
permissions for the group and others (rw-r--r--).
chmod 755 myfile
Sets read, write and execute permissions for the owner and read
and execute permissions for both the group and others (rwxr-xr-
x).
chmod 660 myfile
Sets read and write permissions for the owner and group and no
permissions for others (rw-rw----).
23 December 2016, Page 112
113. OTHER PERMISSIONS
There are three other permissions settings that you should be aware
of although we will not discuss them further on this course.
Set User ID (SUID) and Set Group ID (SGID) apply to executable
programs. They can be recognised in an ls –l listing by an s in
the permissions. When you run a program with SUID or SGID set,
your user accounts assumes the user ID or group of the program.
For instance, the program passwd that is used to change your
password has to write to the /etc/passwd file. However since that
file is owned by root only root can write to it. When you run
passwd you run it with root permissions (due to the SUID being set)
and can therefore write your new password to /etc/passwd.
23 December 2016, Page 113
114. OTHER PERMISSIONS
SGID can also be set on a directory. This means any files created
in that directory are owned by the same group that owns the
directory.
The Sticky Bit applies only to directories. This can be recognised in
an
ls –l listing by a t in the permissions. This prevents users from
deleting any files that don’t belong to them in a shared directory
(such as /tmp).
23 December 2016, Page 114
115. CHANGING RELATED ATTRIBUTES
As well as the access permissions you can also change the owner
and group of a file.
To change the owner issue:
chown <new_user> <files>
To change the group issue:
chgrp <new_user> <files>
On some systems only the superuser can change these
permissions. Also be aware that you won’t be able to write a
program, set the permissions to executable, set the SUID and then
pass ownership of the file to root to get round system security!
23 December 2016, Page 115
116. LINKING FILES
A single file can be accessed from multiple locations with the use of
links. You might do this for instance to provide the same profile to a
number of different users.
In many of the standard Perl binary locations link back to one binary
(check out /bin/perl for instance).
The command to create links is:
ln [-s] <source-file> < link-destination>
Two types of link can be made, Hard links and Symbolic links.
Symbolic links are created by including the –s flag in the command
call.
23 December 2016, Page 116
117. HARD LINKS
Hard Links can only be created if the source file exists. ls –l
shows the number of hard links in the listing.
Use the rm command to remove hard links. A file remains
accessible from other linked locations until all links are removed.
A hard link does not identify the source file. However changing the
ownership of permissions of either the original or linked files will
result in all files being updated.
Hard links can only point to files with the same filesystem and can
also point to directories.
23 December 2016, Page 117
118. HARD LINKS
ln /home/m6345/my_file /tmp/spikes_file
Creates a hard link for the file /home/m6345/myfile in /tmp
called spikes_file.
If /home/m6345/myfile is deleted the file in /tmp will persist until
it is deleted as well.
23 December 2016, Page 118
119. SYMBOLIC LINKS
A Symbolic Link, created by including the –s flag, is basically a
shortcut to the file. An ls –l list shows the file type as l. It will
also show you where the symbolic links points to.
Read, write and execute always apply to symbolic links. Access to
the source file is controlled by permissions on the file.
Use the rm command to remove symbolic links. The link remains
even if the source file is deleted. However you can’t create the link
if the source file does not exist.
Symbolic links can point to files in different filesystems and can also
be made for directories.
23 December 2016, Page 119
120. SYMBOLIC LINKS
ln –s /home/m6345/file1 /tmp/spikes_file
Allows /home/m6345/file1 to be accessed from
/tmp/spikes_file.
23 December 2016, Page 120
121. LINKS
Symbolic links are generally easier to manage (since you can
always see where they lead) and provide most users with the
functionality that they need.
There are Hard Links within most UNIX systems. One common use
is to allow the same program to be called with different names.
Run this command on minepw01 and you will see the two programs
have the same size and permissions. Depending on what you call,
a directory or a FIFO will be created:
ls -l /bin/mkdir /bin/mkfifo
-r-xr-xr-x 2 bin bin 20480 Nov 14 2000 /bin/mkdir
-r-xr-xr-x 2 bin bin 20480 Nov 14 2000
/bin/mkfifo
23 December 2016, Page 121
122. EXERCISE 5
1. Change the permissions on the file mygroup in your home
directory to give read permission only to the owner and no other
permissions to anyone else.
What is the result of the following actions:
Use cp to copy the file.
Try and edit the file with vi. Can you open it? What about
making changes?
Can you append STDOUT to the file? (Try and echo something
and use >> to redirect it to the file
Use rm to delete the file.
23 December 2016, Page 122
123. EXERCISE 5 (CONTINUED)
2. Change the permissions on your directory called my_files
to
r--r--r--.
What happens when you run the following commands?
ls my_files
cd my_files
cp my_files/myissue ~
rm my_files/login
23 December 2016, Page 123
124. EXERCISE 5 (CONTINUED)
3. Create a new file called show_date.ksh with the following
text in it:
echo “The date is : c”
date
Add execute permissions to the file and then run the script using:
./.show_date.ksh
4. Create a hard link to show_date.ksh called hard_date.
Create a symbolic link to show_date.ksh called soft_link.
Can you execute hard_date and soft_date? Delete
show_date.ksh. Can you still run hard_date and
soft_date?
23 December 2016, Page 124
125. EXERCISE 5 ANSWERS
1. chmod 400 mygroup OR
chmod =r mygroup
cp mygroup mygroup2 – Works
vi mygroup – Works, but you can not save any changes
echo “test” >> mygroup – Fails
rm mygroup – Prompts for deletion but can still remove the file.
2. chmod 444 my_files OR
chmod =r my_files
ls myfiles – works
cp myfiles/myissue ~ – fails
cd myfiles – fails
rm myhosts – fails
23 December 2016, Page 125
126. EXERCISE 5 ANSWERS
3. vi show_date.ksh
4. ln show_date.ksh hard_date
ln –s show_date.ksh soft_date
Once you delete show_date, only head_date works.
23 December 2016, Page 126
128. PROCESSES
A process is any program that is currently occupying memory or
swapped out to virtual memory . Processes can exist in a number of
states including running, waiting in a queue for CPU time or
sleeping.
There are two types of process:
• System processes are run in the background either by start up processes or directly by
the kernel. These processes are known as daemons and are normally owned by
root. They normally control such aspects of the system such as swapping, job
scheduling, network interfacing etc.
• User processes are run either by or on behalf of users. These processes are started at
the command prompt and are run in the foreground.
23 December 2016, Page 128
129. PROCESSES
The operating system will keep track of all running processes and
records information such as the process owner, a unique process ID
(PID) and the parent process ID (PPID). (The PPID is used to ‘wake
up’ the parent call when the child completes).
To view the process table use the ps command.
ps [<options>]
To show all the processes for the current user, run ps with no
options. It will tell you the PID, the terminal the process is running
on, the amount of CPU being used and the name of the process.
23 December 2016, Page 129
130. PROCESSES
ps –e
Lists all the processes that are currently running on the system. It
will be a long list so you’ll probably want to pipe it to more.
ps –u icebat1
Lists all the processes that are running and are owned by the user
icebat1.
Including the –f flag in any of these calls will generate a more
detailed process listing which will include the PID, PPID, the CPU
the process is running, the start time, the amount of CPU time used
and the process along with any arguments.
23 December 2016, Page 130
131. KILLING PROCESSES
Use the kill command to kill a process:
kill [<signal>] <pid-number>
There are many signals that can be used but the common ones are:
1HUP “Hang-up” Sent to all of a user’s processes when they log
out.
2INT “Interupt” Sent to a foreground process when a user hits
<ctrl>+<c>
9KILL “Kill” Sent to processes by the kill -9 command.
Terminates the process immediately, not allowing it to
tidy up.
15 TERM “Termination” Instructs the process to terminate cleanly.
A complete list can be found by running kill –l.
23 December 2016, Page 131
132. KILLING PROCESSES
kill -1 <pid-number>
Sends the Hang-up single to the listed PID. You can list multiple
PIDS if there are multiple processes you want to Hang-up. You can
also use the name of the signal.
kill -HUP <pid-number>
Has the same effect as the first example.
If no signal is supplied the -15 “Terminate” is used.
Normally when a parent process exits any child processes will be
kiiled. However this is not always the case and orphan processes
are the result. These should also be killed.
23 December 2016, Page 132
133. KILLING PROCESSES
You should only ever use the -9 signal to kill a process as a last
resort. Using this signal terminates the process immediately. The
process is not given the chance to tidy up (close files, release
sockets, tell it’s children it’s going away etc).
To kill a process you should work through the following signals in
order:
-15 : Terminate
-2 : Interrupt
-1 : Hang up
-10 : BUS Error
But try not to use -9. Don’t bring out the combine harvester to
weed a flowerpot..
23 December 2016, Page 133
134. BACKGROUND PROCESSES
As well as the kernel running background processes it is possible for
users to do the same. Any long running command that does not
output to the screen (perhaps because you have redirected STDOUT
to a file) can be run in the background.
gzip -9 * 2> gzerrors &
Runs gzip with the -9 flag on all files in the current directory,
redirecting any errors to a file called gzerrors , in the background.
Note the & - it is the character that tells the shell to run the process
in the background.
If you do not redirect the output then anything generated will go to
the screen and interrupt what the user is doing.
23 December 2016, Page 134
135. JOB CONTROL
There are a number of built in commands available in all shells
except the Bourne shell that allow you to manage running jobs.
If you have started a long running process but not placed it in the
background, you can suspend the job by issuing the ^Z signal. This
is done by using the keys <ctrl>+<z>. Your environment may not
be set up for this. To ensure it is, run the following command:
stty susp ^z
Once a job is suspended you can place it in the background, run
other jobs or bring it back to the foreground.
23 December 2016, Page 135
136. JOB CONTROL
To view all the jobs you currently have running use:
jobs [-l]
Lists all the jobs you have running in background mode or
suspended along with their job number (which is allocated by the
shell). The –l flag will include the jobs PID in the listing.
Once you know a job’s number you can bring it to the foreground:
fg [%<job-number>]
If the job number is omitted then the last job suspended will be
brought forward.
23 December 2016, Page 136
137. JOB CONTROL
To kill a job running in the background use:
kill –STOP %<job-number>
On some systems the alias stop can also be used:
stop %<job-number>
To put a job that is suspended into background mode use:
bg [%<job-number]
If no job number is included then the last suspended job will be put
into background mode.
A lower priority is given to background jobs .
23 December 2016, Page 137
138. NOHUP
If you want to run a program while you are logged off the system
you will need to ensure that the program ignores the Hang-up
signal, HUP. If it doesn’t (you’re running a shell script for instance),
then you will need to use the nohup command. This prevents the
running program from receiving the HUP signal when it is sent.
nohup my_long_script.sh &
If the job requires user input then it will hang. This applies to any
job that is running in the background.
If the job generates out output that is not already redirected it will be
written to a file called nohup.out in the directory you started the
process from.
23 December 2016, Page 138
139. PROCESS PRIORITY
Every process that runs has a priority. Priorities range from 0 – 39,
although some UNIX and Linux systems use -20 to +19. Whatever
the numbering scheme, the lower the number the higher the priority.
The higher the priority the more system resources that process will
get.
Only the superuser can increase the priority of a process. Users
can only reduce the priority of their processes.
The commands nice and renice are used for this. However they
are only mentioned here for awareness.
23 December 2016, Page 139
140. EXERCISE 6
1. Start a sleep process in the background:
sleep 100000 &
List all the processes running under your ID and find the sleep
process. Once you’ve identified it, kill it cleanly.
2. Start another sleep process but do not place it in the
background.
sleep 200000
Suspend the process and vi a new file. Suspend the vi
session and start a sleep process in the background:
sleep 300000 &
23 December 2016, Page 140
141. EXERCISE 6 (CONTINUED)
3. List all the processes that you have either running in the
background or suspended. Resume your vi session and exit it.
List all your jobs again. You should have one running and one
stopped.
4. Resume the running job in the foreground. Suspend the job again
and run the other job in the foreground.
5. Put both jobs in the background and stop them. Kill both the jobs
using their job numbers.
23 December 2016, Page 141
144. SHELL ENVIRONMENT
Everything you have done so far has been done within a shell. The
shell is a program like everything else in UNIX but it provides the
environment that you work in. Understanding the different elements
of the shell and how they can be configured will enable you to
exhibit better control over your UNIX session.
There are three main areas that you can customise within the shell:
Variables: Named data stored in memory. Variables are
important as they control how your environment is set up.
Aliases: Shortcuts to commands that can also modify it’s
actions.
Functions: Shell scripts that are held in memory.
23 December 2016, Page 144
145. VARIABLES
There are two types of variable in the shell environment.
Shell defined variables are set during login to the system and
include things like:
• Home directory location
• Username
• The terminal type
• Command line prompt
User defined variables are set by the user and can relate to
anything. There are two types of user defined variable:
• Local that are only available in the current shell
• Exported that are available in the current shell and also to children
23 December 2016, Page 145
146. SETTING VARIABLES
A variable is just a name for a location of memory holding a value.
As the name implies that value can be changed. To create a local
shell variable the syntax is:
<name>=<value>NB: there is no space around the =.
database=icepw01
Creates the variable database, if it does not already exist and
assigns it the value icepw01.
23 December 2016, Page 146
147. SETTING VARIABLES
A variable can be made up of alpha, numeric or underscore
characters, however, it must begin with a letter.
Variables names are case sensitive so DATABASE is not the same
as database. By convention shell variables are normally in upper
case.
By default a new variable will we be set as a local variable.
To view the variable use echo:
echo $database
To view all the environment variables in your shell run:
env
23 December 2016, Page 147
148. SETTING VARIABLES
The environment is split into two separate areas: a local area and an
exported area. When a child process is started from your shell (for
instance you run a new program) it will only inherit variables from
the exported area. Newly created local variables will not be
available to the program.
23 December 2016, Page 148
Local Area
Exported Area
New Shell
New Local Area
Current Shell
Copy of Exported
Area
149. SETTING VARIABLES
To make variables available to the new program you have to export
them.
database=icepw01
export database
Assigns the value icepw01 to the variable database and exports
that variable so that it is available to child processes. This can also
be achieved in a single command:
export database=icepw01
Anything that you create in your new shell will cease to exist once
that shell exits.
23 December 2016, Page 149
150. ENVIRONMENT VARIABLES
The following is a list of common environment variables found in
both the Korn and Bash shells.
LOGNAME The user’s login name as found in
/etc/passwd
HOME The user’s home directory as found in
/etc/passwd
SHELL The user’s login shell as found in
/etc/passwd
PATH A colon-separated list of directories that are
searched when a user issues a command
EDITOR The editor invoked on editing the command
line
PWD The user’s current directory
PS1 The command prompt
23 December 2016, Page 150
151. COMMAND ALIASES
A command alias is a shortcut to a command or script that you want
to run. Like all commands they are entered on the command line.
Aliases are created using the alias command which can also be
run at the command line or included in your startup scripts (profiles
are covered later).
alias ll=‘ls –l’
Creates an alias called ll that executes ls –l in the current
directory .
alias rm=‘rm –i’
Creates an alias called rm that executes rm –i when rm is called
on the command line.
To list all current aliases call alias with no arguments.
23 December 2016, Page 151
152. COMMAND ALIASES
unalias ll
Removes the ll alias from the shell.
Where you have an alias that is the same name as an existing
command, if you want to call the command then you proceed the
call with a .
rm file1
Removes file1 by calling rm directly.
23 December 2016, Page 152
153. YOUR PROFILE
It is possible to have your environment set up when you logon. This
is done through the use of profile files. There are several that
control the setup of your shell, some of which you will not be able to
change.
/etc/passwd holds the users name, home directory and shell as
well as some other user related information.
/etc/profile sets the global environment variables for all users
that log on.
.profile (Korn shell) and .bash_profile can exist in the users
home directory. They are used to set up user specific environment
variables or overwrite global values that have been set in
/etc/profile.
23 December 2016, Page 153
154. YOUR PROFILE
.kshrc (Korn shell) and .bashrc in the users home directory are
used to make changes to new shells as they are started.
The difference between the profile and the rc files is simple: the
.*profile’s get run at logon while the .*rc‘s get run when a new
shell is created.
If you need to run commands at startup they can be placed in the rc
files. While they should work if they are in the profile, if you are
using sessions such as CDE or Java Desktop then the commands
might not execute correctly.
23 December 2016, Page 154
155. .PROFILE
The .profile in your home directory can be edited to include any
environment customisations that you need. This can include
creating new shell variables, amending global ones or new aliases.
PATH=$PATH:$HOME:$HOME/bin
Adds your home directory and the bin directory in your home
directory to the PATH variable.
EDITOR=vi
Sets the command line EDITOR to be vi.
ORACLE_SID=icepw01
Sets ORACLE_SID to be icepw01.
23 December 2016, Page 155
156. .PROFILE
You can change the command prompt that you see when you logon
by changing the PS1 variable
PS1=‘$PWD > ‘
Sets the command prompt to read as the current directory. As you
change directory the prompt will change too.
This works in Linux too but it is more convenient to use bash shell
special characters. However I’ll leave that for another day (but feel
free to look them up!)
If you change your profile it is best to re-execute it by logging off and
back on again. However you can if you prefer run:
. ./.profile
23 December 2016, Page 156
157. EXERCISE 7
Using vi edit your profile:
• Change the command prompt to include the name of the UNIX box and your current working directory.
• Add your home directory to the PATH variable.
• Create an alias so that you can list the 10 most recent files in a directory.
Now log off and test your changes.
23 December 2016, Page 157
158. EXERCISE 7 ANSWER
There is no right or wrong answer...
23 December 2016, Page 158
160. SETTING YOUR ORACLE ENVIRONMENT
If you want to connect to Oracle from a UNIX session you will need
to ensure that your UNIX environment is set up correctly. Adding
the following command to your .profile will set up the appropriate
environment based on the databases that exist on that UNIX box. If
there are multiple instances then you will be able to choose the
appropriate one.
. /usr/local/oracle/user.profile
You may find it useful to have the name of the database you are
working on in your command prompt. Once the ORACLE_SID is set
above you can then use:
PS1=‘$ORACLE_SID $PWD > ‘
23 December 2016, Page 160
161. USEFUL PROGRAMS
There are many other commands and utilities available for UNIX.
Here is but a scant collection of some that you may find useful in
your day to day hacking.
All these programs have a plethora of options available. Check out
their man pages for more details.
grep <pattern> <file-list>
grep (short for Global Regular Expression Printer) searches
through the file list for <pattern> and returns all the rows that
match.
find /app/ice1 -name “file1”
Finds a file called file1, starting in the directory /app/ice1 and
searching recursively through the directory tree.
23 December 2016, Page 161
162. USEFUL PROGRAMS
sort <file>
Sorts a file into alphabetical order. DO NOT redirect the output to
your input file as the file will be overwritten! Check out the –o
option.
cut –f1 –f3 <file>
Takes input and cuts it into fields and outputs fields 1 and 3. By
default fields are delimited by whitespace, however you can change
that using –d.
finger [-m] <user-id>
Looks up a user in the /etc/passwd file. Specifying –m means
that only exact matches will be printed.
23 December 2016, Page 162
163. OTHER STUFF
set –o noclobber
Prevents the shell from overwriting existing files when using
redirection. If the file already exists the command running with
redirection will fail.
~
The shell variable ~ points to your home directory. It is the same as
using $HOME (unless you have changed it, which I wouldn’t advise!)
cp /tmp/file1 ~
Copies file1 from /tmp to your home directory.
23 December 2016, Page 163
Editor's Notes
The forerunner to UNIX, called Multics was first developed in the 1960’s by a consortium made up of Massachusetts Institute of Technology (MIT), AT&T Bell Labs, and General Electric.
AT & T’s Bell labs pulled out of the group and deployed it’s resource elsewhere. However one Bell Labs employee, Ken Thompson, continued to develop on the GE-645 mainframe and wrote a computer game called “Space Travel”. Running the game was expensive on the mainframe at $75 per instruction!
With help from Dennis Ritchie, who was at the time working on the C Programming Language, they rewrote Space Travel in assembly language for Digital Equipment Corporation's PDP-7.
This and his experience on the Multics project lead him to write a new operating system for the PDP-7.
In the 1970s the project was named Unics, and eventually could support two simultaneous users. Brian Kernighan, also of C fame, invented this name as a contrast to Multics; the spelling was later changed to Unix.
In 1973 UNIX was completely rewritten in C. This resulted in much more portable code and subsequently UNIX was ported to a number of different hardware architectures.
At this point AT & T made UNIX available to Universities and commercial firms under licence.
In the 1980s AT & T released a commercial version of UNIX that would later be know as System V. This included many enhancements that had been made by users of the original free distribution.
Due to the restrictive licensing of the new version of UNIX, University of California, Berkeley, who had contributed largely to the System V release continued to work on their own version of UNIX. This was to become BSD UNIX.
Development continued through the 1980s and 1990s of various flavours of UNIX from numerous commercial enterprises.
In 1991 a University of Helsinki student called Linus Torvolds was using an operating system called Minix. He thought he could do better and so wrote what became Linux.
The dot-com crash in the early 2000s led to a considerable consolidation of UNIX operating systems. All the UNIX variations available now are based either on System V, BSD or Linux.
This is a simplified diagram of the UNIX filesystem. On most systems there will be other OS specific directories.
You don’t have to specify a full path to a directory. If you are already in /usr then you can just cd local.
Cut & Paste: Show the candidates how cut and paste works.
If there is a failure in your command then you will normally get an error message.
Pipes, FIFOs and sockets are all used for inter-process communications.
Some commands such as lp or write don’t write to screen
Also check out /bin/dos* for examples of hard linked files.
At I’ve found that I can do all I need to at startup by just adding commands to my .profile.
There’s always a section at the end where stuff goes that didn’t quite fit anywhere else. This is that section..