The document provides an overview of the vi text editor and basic shell scripting. It describes vi's two modes - command mode and insert mode. It also outlines common vi commands for navigating, editing, saving, and quitting. Additionally, it covers shell script basics like variables, comments, and I/O redirection. Pipes and filters are discussed as a way to connect commands. The nice command is introduced as a method for changing a process's priority.
The vi editor is a powerful text editor installed by default in most Unix systems. It has two modes: command mode for taking actions and insert mode for inserting text. Common commands in vi include i to enter insert mode, Esc to exit insert mode, hjkl to navigate, dd to delete lines, p to paste, and :wq to save and quit. Vi is case sensitive and requires using keyboard commands rather than a mouse to edit files.
This document provides a summary of basic Unix commands for participants of the SOI Asia Workshop 2008. It includes commands for user accounts, manual pages, processes, directories, files, networking and vi text editing. Participants are instructed to practice the commands on the SOI Asia server under guidance of senior operators to become familiar with Unix basics needed for the workshop lectures.
The document provides instructions on using filename completion and describes examples of completing filenames in the C shell (csh). It then provides a summary of commands to use the vi text editor, including inserting, deleting, searching for, and editing text. Finally, it outlines what to expect and prepare for on the first exam, including that it will be closed book and notes and cover all material discussed so far.
This document provides information about the vi text editor in Unix-based systems. It discusses vi's three modes: command mode, insert mode, and ex mode. It describes basic cursor movement, editing, searching, and file saving commands. The document is intended to help users understand how to use the vi editor to create, edit, and save text files on Unix systems.
This document provides an overview of system administrator tasks and basic UNIX concepts. It discusses the roles and responsibilities of system administrators, the structure and components of UNIX operating systems, basic commands for navigating the file system, managing files and directories, editing text, and running processes. It also covers shells, variables, and cron jobs for scheduling automated tasks. The document concludes with introductions to AIX operating systems and IBM pSeries servers.
This document discusses text processing tools in Linux. It covers using regular expressions with grep, sed, and awk to search and manipulate text files. It also covers using vi to edit text files with features like search/replace, screen repositioning, and setting options. Common text processing tasks like examining, sorting, filtering, and formatting text are demonstrated using tools like head, tail, wc, sort, uniq, and awk.
This document provides a summary of vi editor commands organized into sections on general startup, counts, cursor movement, screen movement, inserting, deleting, copying code, find commands, miscellaneous commands, line editor mode, ex commands, substitutions, reading files, write file, moving, and shell escape. It explains how to start and exit vi, move the cursor, search for text, edit text, and use ex commands.
The document discusses shells and shell programming. It provides information on:
- Shells provide an interface to run commands and programs and display outputs. Common shells include Bourne, C, and other derivative shells.
- Shells prompt for commands and interpret them, passing commands to the kernel for execution and displaying outputs.
- Shell scripts allow automated execution of commands through programming constructs like variables, conditionals, loops, and functions.
The vi editor is a powerful text editor installed by default in most Unix systems. It has two modes: command mode for taking actions and insert mode for inserting text. Common commands in vi include i to enter insert mode, Esc to exit insert mode, hjkl to navigate, dd to delete lines, p to paste, and :wq to save and quit. Vi is case sensitive and requires using keyboard commands rather than a mouse to edit files.
This document provides a summary of basic Unix commands for participants of the SOI Asia Workshop 2008. It includes commands for user accounts, manual pages, processes, directories, files, networking and vi text editing. Participants are instructed to practice the commands on the SOI Asia server under guidance of senior operators to become familiar with Unix basics needed for the workshop lectures.
The document provides instructions on using filename completion and describes examples of completing filenames in the C shell (csh). It then provides a summary of commands to use the vi text editor, including inserting, deleting, searching for, and editing text. Finally, it outlines what to expect and prepare for on the first exam, including that it will be closed book and notes and cover all material discussed so far.
This document provides information about the vi text editor in Unix-based systems. It discusses vi's three modes: command mode, insert mode, and ex mode. It describes basic cursor movement, editing, searching, and file saving commands. The document is intended to help users understand how to use the vi editor to create, edit, and save text files on Unix systems.
This document provides an overview of system administrator tasks and basic UNIX concepts. It discusses the roles and responsibilities of system administrators, the structure and components of UNIX operating systems, basic commands for navigating the file system, managing files and directories, editing text, and running processes. It also covers shells, variables, and cron jobs for scheduling automated tasks. The document concludes with introductions to AIX operating systems and IBM pSeries servers.
This document discusses text processing tools in Linux. It covers using regular expressions with grep, sed, and awk to search and manipulate text files. It also covers using vi to edit text files with features like search/replace, screen repositioning, and setting options. Common text processing tasks like examining, sorting, filtering, and formatting text are demonstrated using tools like head, tail, wc, sort, uniq, and awk.
This document provides a summary of vi editor commands organized into sections on general startup, counts, cursor movement, screen movement, inserting, deleting, copying code, find commands, miscellaneous commands, line editor mode, ex commands, substitutions, reading files, write file, moving, and shell escape. It explains how to start and exit vi, move the cursor, search for text, edit text, and use ex commands.
The document discusses shells and shell programming. It provides information on:
- Shells provide an interface to run commands and programs and display outputs. Common shells include Bourne, C, and other derivative shells.
- Shells prompt for commands and interpret them, passing commands to the kernel for execution and displaying outputs.
- Shell scripts allow automated execution of commands through programming constructs like variables, conditionals, loops, and functions.
The document discusses shells and shell programming. It provides information on:
- Shells provide an interface to run commands and programs and display outputs. Common shells include Bourne, C, and other derivative shells.
- Shells prompt for commands and interpret them, passing commands to the kernel for execution and displaying outputs.
- Shell scripts allow automated execution of commands through programming constructs like variables, conditionals, loops, and functions.
The document provides an overview of the vi text editor, describing how to navigate and edit files, add and delete text, search for text, and save files. Vi has two modes - command mode for navigation and append/insert mode for adding text. It allows moving cursor, searching, deleting lines/characters, undoing changes, and quitting to save files. Advanced features include substituting text globally and marking blocks to move or copy.
Vi is a basic text editor that is included with Linux and allows users to create, modify, and view text files. It has three main modes: command mode to enter commands, insert mode to add/edit text, and Ex mode to manage files. Some key vi commands allow users to move around files, delete/copy text, save files, and search/replace text. Vi is a powerful but minimal editor that is useful for modifying configuration files and writing code.
This document provides an introduction to using the command line interface in UNIX/Linux systems. It explains the basic format of UNIX commands, common conventions, and examples of familiar commands like ssh, passwd, quota, and oitcleaner. It also discusses the man pages for getting help on commands and demonstrates some common commands for navigating files and directories, copying/moving files, viewing file contents, and more. The document concludes with an overview of the pipe character and commands like ps and kill for managing processes.
This document provides an introduction to using the command line interface in UNIX/Linux systems. It explains the basic format of UNIX commands, common conventions, and examples of familiar commands like ssh, passwd, quota, and oitcleaner. It also discusses the man pages for getting help on commands and summarizes common commands like ls, cd, mkdir, rm, mv, cp, cat, more, less, head, tail, lpr, date, who, hostname, whoami, and ps. Finally, it covers the UNIX pipe operator and using nice to modify process priorities.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access as the superuser. The su command allows switching to other users including root with proper privileges.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access on a system. The su command allows switching to another user, like root, with root privileges.
Operating System Practice : Meeting 7- working with bash shell-a-slideSyaiful Ahdan
This document discusses practicing with the Bash shell in Linux. It covers the history feature of Bash, creating Bash shell scripts, and using the vi editor. The objectives are to understand the shell, use Bash history, configure scripts to run automatically, and create/execute scripts in vi. The document provides basics on shells, profiles, history, job control, and vi commands before describing experiments on Bash profiles and history features.
This document provides instructions on using various Linux commands and editors. It is divided into multiple sessions across weeks:
Week1 covers logging in and out of the system, using the vi editor to create and modify files, and basic vi commands.
Week2 demonstrates using cat to create and display files, sorting and cutting fields using sort and cut, and logging out.
Week3 explains checking the login shell, viewing user information in /etc/passwd, and redirecting command output. It also covers sed commands to modify text.
Week4 introduces AWK for parsing files and printing fields, and provides an example awk script to interactively count word matches in a file.
vi is a simple text editor included in Red Hat Linux that can be used from the shell prompt. It opens files in Normal mode where you can view and run commands but not edit, and Insert mode where you can make edits. Common vi commands include h/j/k/l to move the cursor, i to insert text, dd to delete lines, :wq to save and exit, and :q! to exit without saving. The advantages of vi are that it has minimal system resource usage and works over slow connections.
changing and deleting text ,change word and line under vi editorShourya Puri
This document provides an overview of commands for changing, deleting, copying, and advanced functions in the vi text editor. It lists commands for changing text like cw to change a word or r to replace a character. Deleting commands include x to delete a character, dd to delete a line, and D to delete from the cursor to the end of the line. Copy and paste is done with yy to copy a line and p to paste. Advanced commands allow joining lines with J, shifting text with < and >, toggling case with ~ and viewing file info with ^G.
The document discusses various C programming concepts like algorithms, flowcharts, tokens, data types, operators, functions, and hardware components of a computer. It includes questions and answers on these topics. Key points covered are definition of algorithm and flowchart, different types of tokens in C, differences between while and do-while loops, definition of software and its types, and examples of standard header files.
This document provides an overview and introduction to using UNIX and the bash shell. It covers connecting to a remote UNIX system using SSH, the anatomy of the command window, basic command structure and examples. It also discusses getting help, working with files and directories including wildcards and redirection, creating and editing files using redirection, pipes and the vim editor. The objectives are to familiarize users with basic UNIX commands, files/directories, and the vim editor.
Linux is an open-source alternative to Microsoft Windows that is freely available and reliable. It has a command line interface and features like virtual memory, networking capabilities, multiple users, and graphical user interfaces. Common Linux commands include ls, cd, mkdir, rmdir, cat, cp, and editors like vi, emacs, nano are used to create and edit files. The Linux directory structure is hierarchical with key directories being /, /home, /usr, /var, and editors allow editing files in different modes like insert and command modes.
- The document discusses various text editing and file transfer tools available in Unix systems including Emacs, vi, FTP, pine, and lpr. It focuses on using Emacs as a text editor, including how to open and save files, navigate text, and get help. It also covers using FTP and pine to transfer files between systems and access email from within Unix.
This document provides an overview of editors in Linux. It discusses the main types of editors, including console-based (emacs, nano, vim), GUI-based (gedit, gvim), and structured text editors. Gedit is introduced as the default GNOME editor. Vi and Vim are covered in more detail, including modes, navigation, editing text, searching, and exiting. The document concludes with a brief introduction to using external commands in vi.
The document discusses UNIX shells and their functions as an interface between users and the operating system hardware, including how shells allow for command execution, scripting, and redirection of standard input/output/error. It also covers common shell features like tab completion, history, aliases, environment variables, job control, and process management using commands like ps, kill, and pgrep.
Introduction to Reinforcement Learning.pptxHarsha Patel
Reinforcement learning is a machine learning technique where an agent learns to achieve a goal by trial and error interactions with its environment. The agent performs actions and receives positive or negative feedback in the form of rewards and penalties, allowing it to learn over time which actions yield the most reward. Some key applications of reinforcement learning include robotics, game playing, industrial automation, and personalized education systems.
Introduction to Association Rules.pptxHarsha Patel
The document discusses association rule learning and the Apriori algorithm. It begins by defining association rule learning and its applications, such as market basket analysis. It then explains the key concepts of support, confidence and lift used to measure rule strength. The document proceeds to describe the Apriori algorithm, including its candidate generation and frequent itemset determination steps. An example is provided to demonstrate how the Apriori algorithm is applied to generate association rules from a transactional dataset.
The document discusses shells and shell programming. It provides information on:
- Shells provide an interface to run commands and programs and display outputs. Common shells include Bourne, C, and other derivative shells.
- Shells prompt for commands and interpret them, passing commands to the kernel for execution and displaying outputs.
- Shell scripts allow automated execution of commands through programming constructs like variables, conditionals, loops, and functions.
The document provides an overview of the vi text editor, describing how to navigate and edit files, add and delete text, search for text, and save files. Vi has two modes - command mode for navigation and append/insert mode for adding text. It allows moving cursor, searching, deleting lines/characters, undoing changes, and quitting to save files. Advanced features include substituting text globally and marking blocks to move or copy.
Vi is a basic text editor that is included with Linux and allows users to create, modify, and view text files. It has three main modes: command mode to enter commands, insert mode to add/edit text, and Ex mode to manage files. Some key vi commands allow users to move around files, delete/copy text, save files, and search/replace text. Vi is a powerful but minimal editor that is useful for modifying configuration files and writing code.
This document provides an introduction to using the command line interface in UNIX/Linux systems. It explains the basic format of UNIX commands, common conventions, and examples of familiar commands like ssh, passwd, quota, and oitcleaner. It also discusses the man pages for getting help on commands and demonstrates some common commands for navigating files and directories, copying/moving files, viewing file contents, and more. The document concludes with an overview of the pipe character and commands like ps and kill for managing processes.
This document provides an introduction to using the command line interface in UNIX/Linux systems. It explains the basic format of UNIX commands, common conventions, and examples of familiar commands like ssh, passwd, quota, and oitcleaner. It also discusses the man pages for getting help on commands and summarizes common commands like ls, cd, mkdir, rm, mv, cp, cat, more, less, head, tail, lpr, date, who, hostname, whoami, and ps. Finally, it covers the UNIX pipe operator and using nice to modify process priorities.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access as the superuser. The su command allows switching to other users including root with proper privileges.
The document discusses Unix commands and processes. It describes:
1. There are two types of processes - foreground processes which are interactive and initiated by the user, and background processes which are non-interactive and initiated by the system or user.
2. External commands are located in directories like /bin or /usr/bin and require spawning a new process when executed.
3. The type command describes if a command is an alias, keyword, builtin, or external file. The man command displays manuals for commands, divided into sections.
4. The root login provides the highest access on a system. The su command allows switching to another user, like root, with root privileges.
Operating System Practice : Meeting 7- working with bash shell-a-slideSyaiful Ahdan
This document discusses practicing with the Bash shell in Linux. It covers the history feature of Bash, creating Bash shell scripts, and using the vi editor. The objectives are to understand the shell, use Bash history, configure scripts to run automatically, and create/execute scripts in vi. The document provides basics on shells, profiles, history, job control, and vi commands before describing experiments on Bash profiles and history features.
This document provides instructions on using various Linux commands and editors. It is divided into multiple sessions across weeks:
Week1 covers logging in and out of the system, using the vi editor to create and modify files, and basic vi commands.
Week2 demonstrates using cat to create and display files, sorting and cutting fields using sort and cut, and logging out.
Week3 explains checking the login shell, viewing user information in /etc/passwd, and redirecting command output. It also covers sed commands to modify text.
Week4 introduces AWK for parsing files and printing fields, and provides an example awk script to interactively count word matches in a file.
vi is a simple text editor included in Red Hat Linux that can be used from the shell prompt. It opens files in Normal mode where you can view and run commands but not edit, and Insert mode where you can make edits. Common vi commands include h/j/k/l to move the cursor, i to insert text, dd to delete lines, :wq to save and exit, and :q! to exit without saving. The advantages of vi are that it has minimal system resource usage and works over slow connections.
changing and deleting text ,change word and line under vi editorShourya Puri
This document provides an overview of commands for changing, deleting, copying, and advanced functions in the vi text editor. It lists commands for changing text like cw to change a word or r to replace a character. Deleting commands include x to delete a character, dd to delete a line, and D to delete from the cursor to the end of the line. Copy and paste is done with yy to copy a line and p to paste. Advanced commands allow joining lines with J, shifting text with < and >, toggling case with ~ and viewing file info with ^G.
The document discusses various C programming concepts like algorithms, flowcharts, tokens, data types, operators, functions, and hardware components of a computer. It includes questions and answers on these topics. Key points covered are definition of algorithm and flowchart, different types of tokens in C, differences between while and do-while loops, definition of software and its types, and examples of standard header files.
This document provides an overview and introduction to using UNIX and the bash shell. It covers connecting to a remote UNIX system using SSH, the anatomy of the command window, basic command structure and examples. It also discusses getting help, working with files and directories including wildcards and redirection, creating and editing files using redirection, pipes and the vim editor. The objectives are to familiarize users with basic UNIX commands, files/directories, and the vim editor.
Linux is an open-source alternative to Microsoft Windows that is freely available and reliable. It has a command line interface and features like virtual memory, networking capabilities, multiple users, and graphical user interfaces. Common Linux commands include ls, cd, mkdir, rmdir, cat, cp, and editors like vi, emacs, nano are used to create and edit files. The Linux directory structure is hierarchical with key directories being /, /home, /usr, /var, and editors allow editing files in different modes like insert and command modes.
- The document discusses various text editing and file transfer tools available in Unix systems including Emacs, vi, FTP, pine, and lpr. It focuses on using Emacs as a text editor, including how to open and save files, navigate text, and get help. It also covers using FTP and pine to transfer files between systems and access email from within Unix.
This document provides an overview of editors in Linux. It discusses the main types of editors, including console-based (emacs, nano, vim), GUI-based (gedit, gvim), and structured text editors. Gedit is introduced as the default GNOME editor. Vi and Vim are covered in more detail, including modes, navigation, editing text, searching, and exiting. The document concludes with a brief introduction to using external commands in vi.
The document discusses UNIX shells and their functions as an interface between users and the operating system hardware, including how shells allow for command execution, scripting, and redirection of standard input/output/error. It also covers common shell features like tab completion, history, aliases, environment variables, job control, and process management using commands like ps, kill, and pgrep.
Introduction to Reinforcement Learning.pptxHarsha Patel
Reinforcement learning is a machine learning technique where an agent learns to achieve a goal by trial and error interactions with its environment. The agent performs actions and receives positive or negative feedback in the form of rewards and penalties, allowing it to learn over time which actions yield the most reward. Some key applications of reinforcement learning include robotics, game playing, industrial automation, and personalized education systems.
Introduction to Association Rules.pptxHarsha Patel
The document discusses association rule learning and the Apriori algorithm. It begins by defining association rule learning and its applications, such as market basket analysis. It then explains the key concepts of support, confidence and lift used to measure rule strength. The document proceeds to describe the Apriori algorithm, including its candidate generation and frequent itemset determination steps. An example is provided to demonstrate how the Apriori algorithm is applied to generate association rules from a transactional dataset.
Clustering is an unsupervised machine learning technique that groups unlabeled data points into clusters based on similarities. It can be used for tasks like market segmentation, image segmentation, and anomaly detection. The k-means clustering algorithm is a common partitioning clustering method that divides data into k predefined clusters by minimizing distances between data points and cluster centroids.
The document discusses classification algorithms, which are supervised machine learning techniques used to categorize new observations based on patterns learned from training data. Classification algorithms learn from labeled training data to classify future observations into a finite number of classes or categories. The document provides examples of classification including spam detection and categorizing images as cats or dogs. It describes key aspects of classification algorithms like binary and multi-class classification and discusses specific algorithms like logistic regression and support vector machines (SVM).
The document discusses regression analysis and different types of regression models. It defines regression analysis as a statistical method to model the relationship between a dependent variable and one or more independent variables. It explains linear regression, multiple linear regression, and polynomial regression. Linear regression finds the linear relationship between two variables, multiple linear regression handles multiple independent variables, and polynomial regression models nonlinear relationships using polynomial functions. Examples and code snippets in Python are provided to illustrate simple and multiple linear regression analysis.
Intro of Machine Learning Models .pptxHarsha Patel
There are four main types of machine learning:
1. Supervised learning uses labelled data to map inputs to outputs. It includes classification and regression.
2. Unsupervised learning uses unlabeled data to find hidden patterns in data by clustering them. It includes association and clustering.
3. Semi-supervised learning uses a combination of labelled and unlabeled data.
4. Reinforcement learning involves an agent learning through trial-and-error interactions with an environment. The agent receives rewards or penalties to maximize rewards.
The document discusses various aspects of machine learning including:
- Machine learning involves extracting knowledge from data to enable machines to learn without being explicitly programmed. It uses algorithms to model data and make predictions.
- The machine learning process includes data acquisition, processing, modeling, execution, and deployment. Algorithms are used to model the data and refine solutions.
- Machine learning has applications in healthcare, finance, retail, travel, and media by providing personalized recommendations, detecting fraud, optimizing prices and improving customer service.
- Data preprocessing is required to clean and transform raw data before training machine learning models. This includes data integration, cleaning, and transformation techniques.
Unit-V-Introduction to Data Mining.pptxHarsha Patel
Data mining involves extracting useful patterns from large data sets to help businesses make informed decisions. It allows organizations to obtain knowledge from data, make improvements, and aid decision making in a cost-effective manner. However, data mining tools can be difficult to use and may not always provide precise results. Knowledge discovery is the overall process of discovering useful information from data, which includes steps like data cleaning, integration, selection, transformation, and mining followed by pattern evaluation and presentation of knowledge.
Unit-IV-Introduction to Data Warehousing .pptxHarsha Patel
Data warehousing combines data from multiple sources to ensure data quality and accuracy. It separates analytics processing from transactional databases. A data warehouse stores historical data and allows fast querying of all data, using OLAP, while a database stores current transactions for online processing using OLTP. A multidimensional data model organizes data into cubes with dimensions and facts to allow analyzing data from different perspectives. Key components of a data warehouse architecture include external data sources, a staging area using ETL, the data warehouse, and data marts containing subsets of warehouse data.
Unit-III-AI Search Techniques and solution'sHarsha Patel
Informed search algorithms use domain knowledge to guide the search for a solution more efficiently than uninformed searches. Some common informed search algorithms are greedy search and A* search, which uses a heuristic function to estimate distance to the goal. Uninformed searches like breadth-first search and depth-first search do not use additional information beyond how to traverse the search tree.
Unit-II-Introduction of Artifiial Intelligence.pptxHarsha Patel
The document discusses artificial intelligence (AI) and intelligent systems. It defines AI as creating machines that can think and act like humans by learning, reasoning, and problem-solving. It discusses early work in AI from the 1940s-1950s and provides examples of current applications of AI such as self-driving cars, virtual assistants, robots, and more. The document also covers the goals, advantages, and disadvantages of AI as well as its use in domains including healthcare, gaming, transportation, and others.
Unit-I-Introduction to Recent Trends.pptxHarsha Patel
The document provides an introduction to recent trends in artificial intelligence, data warehousing, data mining, and Spark. It defines each topic and discusses their goals, types, advantages, and uses. For artificial intelligence, it outlines what AI is, why it is used, its goals, and the advantages and disadvantages. For data warehousing, it defines what a data warehouse is, its goals and needs. For data mining, it defines what it is, its types, advantages, and disadvantages. Finally, for Spark, it defines what Spark is, its history, features, and common usages.
The document discusses Unix processes and process management. It defines a process as a program under execution. A parent process can create child processes using the fork() system call. The shell is typically the parent of commands run in the foreground, while background processes may have the init process as their parent. Processes have various states like running, ready, sleeping, and zombie. Commands like ps, nice, kill, and top can be used to view and manage processes.
This document provides an introduction to the UNIX operating system. It discusses that UNIX was initially developed in 1970 and is widely used in academic and research institutions. The document then describes key features of UNIX including multitasking, being multi-user, portability, file security, communication tools, and accounting utilities. It also outlines the architecture of UNIX including the kernel, shell, commands/utilities, and user applications. Finally, it covers the UNIX file system structure and permissions.
This document provides information on handling files under Unix. It discusses what files are, Unix filenames and conventions, and important Unix commands and tools for working with files, including cat, head, tail, cut, paste, uniq, tr, wc, sort, grep, egrep, fgrep, and tar. Special features like I/O redirection, piping, and standard files are also covered.
An operating system acts as an intermediary between the user and computer hardware. It provides an environment for users to run programs conveniently and efficiently by managing computer resources and hardware. An operating system performs important functions like process management, I/O operations, file system manipulation, communication, error detection, resource allocation, and protection. It uses process control blocks to store information about running processes and manages their different states which include new, ready, running, waiting, blocked, and terminated.
This document provides an introduction to the UNIX operating system. It discusses that UNIX was initially developed in 1970 and is widely used in academic and research institutions. The document then describes key features of UNIX including multitasking, being multi-user, portability, file security, communication tools, and accounting utilities. It also outlines the architecture of UNIX including the kernel, shell, commands/utilities, and user applications. Finally, it covers the UNIX file system structure and permissions.
The vi editor has two modes: command mode and insert mode. Command mode is for taking actions on a file like deleting or copying text, while insert mode allows entered text to be inserted. The document describes the basic commands and functions of the vi editor, including how to save, quit, move the cursor, delete text, and perform searches. It also covers more advanced topics like shell scripts, variables, and mathematical expressions that can be used with vi.
The document discusses processes in Unix. It defines a process as a program under execution. A parent process can generate child processes. The shell creates processes like cat and grep. A process goes through various states like running, ready, sleeping, and zombie. Commands like ps, kill, nice, renice, bg and fg are used to manage processes. Top displays process information while df and free report disk space and memory usage.
This document provides information on handling files under Unix. It discusses what files are, Unix filenames and conventions, and important Unix commands and tools for working with files, including cat, head, tail, cut, paste, uniq, tr, wc, sort, grep, egrep, fgrep, and tar. Special features like I/O redirection, piping, and standard files are also covered.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
This presentation provides valuable insights into effective cost-saving techniques on AWS. Learn how to optimize your AWS resources by rightsizing, increasing elasticity, picking the right storage class, and choosing the best pricing model. Additionally, discover essential governance mechanisms to ensure continuous cost efficiency. Whether you are new to AWS or an experienced user, this presentation provides clear and practical tips to help you reduce your cloud costs and get the most out of your budget.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Tatiana Kojar
Skybuffer AI, built on the robust SAP Business Technology Platform (SAP BTP), is the latest and most advanced version of our AI development, reaffirming our commitment to delivering top-tier AI solutions. Skybuffer AI harnesses all the innovative capabilities of the SAP BTP in the AI domain, from Conversational AI to cutting-edge Generative AI and Retrieval-Augmented Generation (RAG). It also helps SAP customers safeguard their investments into SAP Conversational AI and ensure a seamless, one-click transition to SAP Business AI.
With Skybuffer AI, various AI models can be integrated into a single communication channel such as Microsoft Teams. This integration empowers business users with insights drawn from SAP backend systems, enterprise documents, and the expansive knowledge of Generative AI. And the best part of it is that it is all managed through our intuitive no-code Action Server interface, requiring no extensive coding knowledge and making the advanced AI accessible to more users.
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
A Comprehensive Guide to DeFi Development Services in 2024Intelisync
DeFi represents a paradigm shift in the financial industry. Instead of relying on traditional, centralized institutions like banks, DeFi leverages blockchain technology to create a decentralized network of financial services. This means that financial transactions can occur directly between parties, without intermediaries, using smart contracts on platforms like Ethereum.
In 2024, we are witnessing an explosion of new DeFi projects and protocols, each pushing the boundaries of what’s possible in finance.
In summary, DeFi in 2024 is not just a trend; it’s a revolution that democratizes finance, enhances security and transparency, and fosters continuous innovation. As we proceed through this presentation, we'll explore the various components and services of DeFi in detail, shedding light on how they are transforming the financial landscape.
At Intelisync, we specialize in providing comprehensive DeFi development services tailored to meet the unique needs of our clients. From smart contract development to dApp creation and security audits, we ensure that your DeFi project is built with innovation, security, and scalability in mind. Trust Intelisync to guide you through the intricate landscape of decentralized finance and unlock the full potential of blockchain technology.
Ready to take your DeFi project to the next level? Partner with Intelisync for expert DeFi development services today!
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
2. What is vi
The vi editor is elaborated as visual editor. It is installed in every Unix system.
In other words, it is available in all Linux distros. It is user-friendly and works
same on different distros and platforms. It is a very powerful application. An
improved version of vi editor is vim.
The vi editor has two modes:
Command Mode: In command mode, actions are taken on the file. The vi
editor starts in command mode. Here, the typed words will act as commands in
vi editor. To pass a command, you need to be in command mode.
Insert Mode: In insert mode, entered text will be inserted into the file.
The Esc key will take you to the command mode from insert mode.
By default, the vi editor starts in command mode. To enter text, you have to be
in insert mode, just type 'i' and you'll be in insert mode. Although, after
typing i nothing will appear on the screen but you'll be in insert mode. Now
you can type anything.
To exit from insert mode press Esc key, you'll be directed to command mode.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
3. If you are not sure which mode you are in, press Esc key twice and you'll be in
command mode.
Using vi
The vi editor tool is an interactive tool as it displays changes made in the file on
the screen while you edit the file.
In vi editor you can insert, edit or remove a word as cursor moves throughout
the file.
Commands are specified for each function like to delete it's x or dd.
The vi editor is case-sensitive. For example, p allows you to paste after the
current line while P allows you to paste before the current line.
vi syntax: vi <fileName>
In the terminal when you'll type vi command with a file name, the terminal will
get clear and content of the file will be displayed. If there is no such file, then a
new file will be created and once completed file will be saved with the
mentioned file name.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
4. To save and quit
You can save and quit vi editor from command mode. Before writing save or
quit command you have to press colon (:). Colon allows you to give instructions
to vi.
exit vi table:
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
Commands Action
:wq Save and quit
:w Save
:q Quit
:w fname Save as fname
ZZ Save and quit
:q! Quit discarding changes made
:w! Save (and write to non-writable file)
5. To exit from vi, first ensure that you are in command mode. Now, type
:wq and press enter. It will save and quit vi.
Type :wq to save and exit the file.
If you want to quit without saving the file, use :q. This command will
only work when you have not made any changes in the file.
Vi Commands
Linux vi editor is different from other editors. You have to use different
keys to use different functions. Although, it's quite easy and interesting
to use vi editor.
The vi editor commands are case sensitive.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
6. To switch from command to insert mode:
Command Action
i Start typing before the current character
I Start typing at the start of current line
a Start typing after the current character
A Start typing at the end of current line
o Start typing on a new line after the current line
O Start typing on a new line before the current line
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
7. Commands Action
j To move down
k To move up
h To move left
l To move right
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
To jump lines:
Commands Action
G Will direct you at the last line of the
file
`` Will direct you to your last position in
the file
8. To delete:
Commands Action
x Delete the current character
X Delete the character before the
cursor
r Replace the current character
xp Switch two characters
dd Delete the current line
D Delete the current line from current
character to the end of the line
dG delete from the current line to the
end of the file
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
9. To repeat and undo:
Commands Action
u Undo the last command
. Repeat the last command
Command to cut, copy and paste:
Commands Action
dd Delete a line
yy (yank yank) copy a line
p Paste after the current line
P Paste before the current line
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
10. Start and end of line:
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
Commands Action
θ Bring at the start of the current
line
^ Bring at the start of the current
line
$ Bring at the end of the current line
dθ Delete till start of a line
d$ Delete till end of a line
11. Joining lines:
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
Commands Action
J Join two lines
yyp Repeat the current line
ddp Swap two lines
12. Move forward or backward:
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
Commands Action
w Move one word forward
b Move one word backward
<n>w Move specified number of
words forward
dw Delete one word
yw Copy one word
<n>dw Delete specified number of
words
13. Search a string:
Commands Action
/string Forward search for given string
?string Backward search for given string
/^string Forward search string at beginning
of a line
/string$ Forward search string at end of a
line
n Go to next occurrence of searched
string
/<he> Search for the word he (and not for
there, here, etc.)
/pl[abc]ce Search for place, plbce, and plcce
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
14. 3. Merge Redirection:
This allows you to redirect the output of a command or a program to a specific
file descriptor instead of standard output. the syntax for using this is “>&”
operator followed by the file descriptor number.
“p >& q” Merges output from stream p with stream q
“p <& q” Merges input from stream p with stream q
Connecting commands: Pipe.
A pipe is a form of redirection (transfer of standard output to some other
destination) that is used in Linux and other Unix-like operating systems to
send the output of one command/program/process to another
command/program/process for further processing.
The Unix/Linux systems allow stdout of a command to be connected to stdin of
another command. You can make it do so by using the pipe character ‘|’. Pipe is
used to combine two or more commands, and in this, the output of one
command acts as input to another command, and this command’s output may
act as input to the next command and so on.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
15. It can also be visualized as a temporary connection between two or more
commands/ programs/ processes. The command line programs that do the
further processing are referred to as filters.
This direct connection between commands/ programs/ processes allows them
to operate simultaneously and permits data to be transferred between them
continuously rather than having to pass it through temporary text files or
through the display screen.
Pipes are unidirectional i.e data flows from left to right through the
pipeline.
Syntax : command_1 | command_2 | command_3 | .... | command_N
Example :
1. Listing all files and directories and give it as input to more command.
$ ls -l | more
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
16. Shell Scripts:
The basic concept of a shell script is a list of commands, which are listed in the
order of execution. A good shell script will have comments, preceded by a
pound sign, #,describing the steps.
There are conditional tests, such as value A is greater than value B, loops
allowing us to go through massive amounts of data, files to read and store data,
and variables to read and store data, and the script may include functions.
Shell scripts and functions are both interpreted. This means they are not
compiled.
It supports less features. It supports input and output redirection operators.
Example Script:
Assume we create a test.sh script. Note all the scripts would have .sh
extension.
Before you add anything else to your script, you need to alert the system that a
shell
script is being started. This is done using the shebang construct.
For example:
#!/bin/sh
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
17. This tells the system that the commands that follow are to be executed by the
Bourne shell. It's called a shebang because the # symbol is called a hash, and
the !symbol is called a bang.
To create a script containing these commands, you put the shebang line first
and then add the commands:
#!/bin/bash
pwd
ls
Shell Comments:
You can put your comments in your script as follows:
#!/bin/bash
# this is sscasc
# Copyright (c)
sscasc.com #
Script follows
here: pwd
ls
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
18. Now you save the above content and make this script executable as follows:
$chmod +x test.sh
Now you have your shell script ready to be executed as
follows: $./test.sh
Extended Shell Scripts:
The shell is, after all, a real programming language, complete with variables,
control structures, and so forth. No matter how complicated a script gets,
however, it is still just a list of commands executed sequentially.
Following script use the read command which takes the input from the
keyboard and assigns it as the value of the variable PERSON and finally prints
it on STDOUT.
echo "What is your name?"
read PERSON
echo "Hello,$PERSON"
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
19. Job ID Versus Process ID
Background and suspended processes are usually manipulated via job number
(job ID). This number is different from the process ID and is used because it is
shorter.
In addition, a job can consist of multiple processes running in a series or at the
same time, in parallel. Using the job ID is easier than tracking individual
processes.
Nice command:-
It is used to change or set the priority of a process
syntax: $nice-value cat filename
The default priority of a process in unix is 20
The value range from 0 to 39, in linux-9 to 20.where 0 is high and 39 is lower
value.
the default value of reduction is 10.
The priority of a process can be increased only by administrator using double
minus(--).
eg:-$nice--15catlast.txt
The priority of a process can be made lower using the nice command.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
20. Here is sample run of the script:
$./test.sh
What is your
name? vvfgc
Hello, vvfgc
Variables:
Variable is value that always changes during execution of a program. It is an
integral part of shell programming. They provide the ability to store and
manipulate information.
There are 2 types of variables. They are
• Environment variables
• User defined variables
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
21. Environment variables:
These variables are the part of the system and these are created and maintained
by the
system itself. These variables always in capital letters only.
Variable meaning
PS1- this is first prompt setting in Unix ($)
PS2- this is second prompt setting in Unix (>)
PATH- whether we are used absolute or relative path.
HOME- it stores the current root directory.
LOGNAME-it stores the login name of the user.
User defined variable:
Variables are defined as follows::
variable_name = variable_value
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
22. For example:
NAME = "sscasc"
Above example defines the variable NAME and assigns it the value "sscasc".
Variables of this type are called scalar variables. A scalar variable can hold only
one value at a time.
The shell enables you to store any value you want in a variable. For example:
VAR1="ssczsc "
VAR2=100
Accessing Values to variables:
To access the value stored in a variable, prefix its name with the dollar sign ( $):
For example, following script would access the value of defined variable NAME
and would print it on STDOUT:
NAME="vvfgc "
echo $NAME
This would produce following value:
Output: vvfgc
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
23. Read-only Variables:
The shell provides a way to mark variables as read-only by using the “read
only”command. After a variable is marked read-only, its value cannot be
changed.
For example, following script would give error while trying to change the value
of NAME:
NAME="vvfgc “
readonly NAME
NAME="Qadiri“
This would produce following result:
/bin/sh: NAME: This variable is read only.
Unsetting Variables:
Unsetting or deleting a variable tells the shell to remove the variable from the
list of variables that it tracks. Once you unset a variable, you would not be able
to access stored value in the variable.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
24. Following is the syntax to unset a defined variable using the unset
command: unset variable_name
Above command would unset the value of a defined variable. Here is a simple
example
NAME="vvfgc"
unset
NAME
echo $NAME
Above example would not print anything. You cannot use the unset command to
unset variables that are marked readonly.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
25. Read command :
This command is used to take the input from the user.
Syntax: $read var1 var2 var3 ….. var n
Syntax: $ read var1
The variable used along with the read command need not be preceded by the
$ symbol.
Ex: clear echo “enter ur name”
read name
echo “hello $name”
Output: enter ur name :vvfgc
Hello vvfgc
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
26. Expr command:
This command is used to perform mathematical caluculations.
Syntax: ` expr operand1 operator operand2 `
Where ( ` ) this symbol is known as grep symbol. There is always must a space
between symbol and the expr command.
Ex: clear echo “enter 2 numbers”
read a b
echo “ sum of 2 numbers is ` expr $a + $b ` “
echo “ sub of 2 numbers is ` expr $a - $b ` “
echo “ product of 2 numbers is ` expr $a * $b ` “
echo “ quotient of 2 numbers is ` expr $a /$b ` “
Note: In unix multiplication purpose we use the symbol of “*” because only * is
wild card character.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
27. Test operator [numerical test]
Arithmetic Operators:
There are following arithmetic operators supported by
Bourne Shell.
Assume variable “a” holds 10 and variable “b” holds 20
then:
Show Examples
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
28. Operator Description Example
+ Addition - Adds values on either side of the operator `expr $a + $b` will give 30
- Subtraction - Subtracts right hand operand from left hand operand `expr $a -
$b` will give 10
* Multiplication - Multiplies values on either side of the operator `expr $a * $b`
will give 200/
/ Division - Divides left hand operand by right operand `expr $b / $a` will give 2
% Modulus - Divides left hand operand by right hand operand and returns
remainder `expr $b % $a` will give 0
=Assignment - Assign right operand in left a=$b would assign value of b into a
operand
= = Equality - Compares two numbers, if both are [ $a == $b ] would return same
then returns true. false.
!=Not Equality - Compares two numbers, if both [ $a != $b ] would return are
different then returns true. true.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
29. It is very important to note here that all the conditional expressions would be
put inside
square braces with one spaces around them, for example [ $a == $b ] is correct
where as
[$a==$b] is incorrect.
All the arithmetical calculations are done using long integers.
Relational Operators:
Bourne Shell supports following relational operators which are specific to
numeric values.
These operators would not work for string values unless their value is numeric.
For example, following operators would work to check a relation between 10
and 20 as well as in between "10" and "20" but not in between "ten" and
"twenty".
Assume variable “a” holds 10 and variable “b” holds 20 then:
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
30. Operator Description Example:
-eq Checks if the value of two operands is equal or not, if yes then condition
becomes true. [ $a -eq $b ] is not true.
-ne Checks if the value of two operands is equal or not, if values are not equal
then condition becomes true [ $a -ne $b ] is true.
-gt Checks if the value of left operand is greater than the value of right operand, if
yes then condition becomes true. [ $a -gt $b ] is not true.
-lt Checks if the value of left operand is less than the value of right operand, if yes
then condition becomes true.[ $a -lt $b ] is true.
-ge Checks if the value of left operand is greater than or equal to the value of right
operand, if yes then condition becomes true.[ $a -ge $b ] is not true.
-le Checks if the value of left operand is less than or equal to the value of right
operand, if yes then condition becomes true [ $a -le $b ] is true.
Note here that all the conditional expressions would be put inside square
braces with one spaces around them, for example [ $a <= $b ] is correct where as
[$a <= $b] is incorrect.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
31. Boolean Operators (or) logical operators:
There are following Boolean operators supported by
Bourne Shell.
Assume variable “a” holds 10 and variable “b” holds 20
then:
Show Examples
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
32. Operator Description Example
! This is logical negation. This inverts a true condition into false and vice versa.[ !
false ] is true.
-o This is logical OR. If one of the operands is true then condition would be true.[
$a -lt 20 - $b -gt 100 ] is true.
-a This is logical AND. If both the operands are true then condition would be true
otherwise it would be false.[ $a -lt 20 -a $b -gt 100 ] is false.
String test Operators
There are following string operators supported by Bourne Shell.
Assume variable a holds "abc" and variable b holds "efg" then:
Show Examples
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
33. Operator Description Example
= Checks if the value of two operands is equal or not, if yes then condition
becomes true. [ $a = $b ] is not true.
!= Checks if the value of two operands is equal or not, if values are not equal then
condition becomes true.[ $a != $b ] is true.
-z Checks if the given string operand size is zero. [ -z $a ] is not true. If it is zero
length then it returns true.
-n Checks if the given string operand size is non- zero. If it is non-zero length
then it returns true. [ -n $a ] is true.
Check if str is not the empty string. If it is str empty then it returns false.[ $a ] is
not false.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
34. File Test Operators
There are following operators to test various properties associated with a Unix
file.
Assume a variable file holds an existing file name "test" whose size is 100
bytes and has read, write and execute permission on:
Show Examples
Operator Description Example
b file Checks if file is a block special file if yes then condition becomes true. [ -b
$file ] is false.
-c file Checks if file is a character special file if yes then condition becomes true.[
-b $file ] is false.
-d file Check if file is a directory if yes then condition becomes true.[ -d $file ] is
not true.
-f file Check if file is an ordinary file as opposed to a directory or special file if yes
then condition becomes true. [ -f $file ] is true.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
35. -g file Checks if file has its set group ID (SGID) bit set if yes then condition
becomes true. [ -g $file ] is false.
-k file Checks if file has its sticky bit set if yes then condition becomes true. [ -k
$file ] is false.
-p file Checks if file is a named pipe if yes then condition becomes true.[ -p $file ]
is false.
-t file Checks if file descriptor is open and associated
with a terminal if yes then condition becomes true.[ -t $file ]is false.
-u file Checks if file has its set user id (SUID) bit set if yes then condition
becomes true.[ -u $file ] is false.
-r file Checks if file is readable if yes then condition becomes true.[ -r $file ] is
true.
-w file Check if file is writable if yes then condition becomes true.[ -w $file ] is
true.
-x file Check if file is execute if yes then condition becomes true.[ -x $file ] is true.
-s file Check if file has size greater than 0 if yes then condition becomes true.[ -s
$file ] is true.
-e file Check if file exists. Is true even if file is a directory but exists.[ -e $file ] is
true.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
36. Control statements
The ability to control the flow of execution of program is known as control
statements . The different types of control structures are
Sequence control structure
Selection control structure
Looping control structure
Selection control structure
This type of instruction allows the shell script to be executed depending on the
condition. There are mainly 4 types of decision making instructions. They are
if-then-fi statement
if-then-else-fi statement
if-then-elif-then-else-fi statement case-esac statement
if-then-fi statement:
in this first check the condition. That condition is true then only the if block
statements will be executed otherwise the cursor transfer outside the if
condition.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
37. Syntax: ex:
if [ condition ] if [ $a –gt 18 ]
then then
statements echo “eligible for vote”
fi fi
if-then-else-fi statement:
in this first check the condition. That condition is true then only the if block
statements will be executed otherwise the else block statements will be executed.
Syntax: ex:
if [ condition ] if [ $a –gt $b ]
then then
statements echo “a is larger than b”
else else
statements echo “b is larger than a”
fi fi
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
38. if-then-elif-then-else-fi statement:
in this first check the condition. That condition is true then only the if block
statements will be executed otherwise the cursor checks the next condition
then the second condition will be true then inside that statements will be
executed and so on. If any conditions were not true then the else block
statements will be executed.
Syntax: ex:
if [ condition 1 ] if [ $a –gt $b –a $a –gt $c]
then then
statements echo ”a is larger”
elif [ condition 2] elif [ $b –gt $c ]
then then
statements echo “ b is larger”
else else
statements echo “c is larger”
fi fi
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
39. Case-esac statement:
Syntax: case $variable in
[match1] )statements ; ;
[match2] statements ; ;
[match3] statements ; ;
: :
: :
*) statements ; ;
esac
here match1,match2 etc are the case labels.
• When a case statement is evaluated the value of variable is matched in any one
of the choices.
• When a match is found then shell executes that corresponding match
statements.
• The pair of semicolon at the end of every choices. It identifies break.
• *) indicates default class. Ex: clear echo “enter a character”
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
40. read ch
case $ch in
[a-z]) echo “entered character is lowercase letters” ; ;
[A-Z] echo “entered character is uppercase letters” ; ;
[0-9] echo “entered character isdigit” ; ;
*) echo “invalid choice” ;;
esac
Looping Control statements
In this all statements are executed repeatedly again and again as long as
condition is true.
This is also known as repetition or iteration.
Shell allows various types of looping. They are
• While loop
• Until loop
• For loop
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
41. While loop:
This is the pretested loop or entry controlled loop. In this first check the
condition, if that condition was true then control enter inside the loop
otherwise control transferred outside the loop.
Syntax: ex:
while [ condition ] while [ i –le 10 ]
do do
Statements echo “$i”
done i =` expr $i + 1 `
done
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
42. until loop:
This is also pretested loop or entry controlled loop. In this first check the
condition, if that condition was false then control enter inside the loop
otherwise control transferred outside the loop.
Syntax: ex:
until [ condition ] until [ i -ge 10 ]
do do
Statements echo “$i”
done i =`expr $i + 1 `
done
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
43. for loop:
This is a fixed execution loop. This loop is allow to execute list of statements
certain period of time.
Syntax:
for variable in value1 value2 value3….. value n do
statements
done
ex:
for i in 1 2 3 4 5
do
echo $i
i=` expr $i + 1 `
done
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
44. Command line arguments.
The Unix shell is used to run commands, and it allows users to pass run time
arguments to these commands.
These arguments, also known as command line parameters, that allows the
users to either control the flow of the command or to specify the input data for
the command.
While running a command, the user can pass a variable number of parameters
in the command line.
Within the command script, the passed parameters are accessible using
‘positional parameters’. These range from $0 to $9, where $0 refers to the name
of the command itself, and $1 to $9 are the first through to the ninth parameter,
depending on how many parameters were actually passed.
Example:
$ sh hello how to do you do
Here $0 would be assigned sh
$1 would be assigned hello
$2 would be assigned how
And so on …
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
45. Some additional commands to process these parameters.
1)Set
This command can be used to set the values of the positional parameters on
the command line.
Example:
$ set how do you do
$ echo $1 $2
how do
Here, “how” was assigned to $1 and “do” was assigned to $2 and so on.
2) shift
This command is used to shift the position of the positional parameters. i.e. $2
will be shifted to $1 all the way to the tenth parameter being shifted to $9. Note
that if in case there are more than 9 parameters, this mechanism can be used to
read beyond the 9th.
Example:
$ set hello good morning how do you do welcome to Unix tutorial.
Here, ‘hello’ is assigned to $1, ‘good’ to $2 and so on to ‘to’ being assigned to
$9. Now the shift command can be used to shift the parameters ‘N’ places.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
46. Example:
$ shift 2
$ echo $1
Now $1 will be ‘morning’ and so on to $8 being ‘unix’ and $9 being ‘tutorial’.
Special Parameters $* and $@
There are special parameters that allow accessing all the command-line
arguments at once. $* and $@ both will act the same unless they are enclosed
in double quotes, "".
Both the parameters specify the command-line arguments. However, the "$*"
special parameter takes the entire list as one argument with spaces between
and the "$@" special parameter takes the entire list and separates it into
separate arguments.
We can write the shell script to process an unknown number of command line
arguments with either the $* or $@ special parameters −
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune
47. Exit Status
The $? variable represents the exit status of the previous command.
Exit status is a numerical value returned by every command upon its
completion. As a rule, most commands return an exit status of 0 if they were
successful, and 1 if they were unsuccessful.
Some commands return additional exit statuses for particular reasons. For
example, some commands differentiate between kinds of errors and will return
various exit values depending on the specific type of failure.
Mrs.Harsha V Patil, MIT ACSC Alandi , Pune