This document provides a content manual for the TATA CONSULTANCY SERVICES Pre ILP – Unix LOUNGE. It contains two chapters, the first discussing basic Unix file commands like touch, cat, cp, mv, rm, and find. The second chapter covers basics of the vi text editor and environment variables. It describes vi modes, commands for navigation, editing, saving and exiting. It also explains how environment variables control the system behavior and lists some common ones like HOME, PATH, and PS1.
This document provides an overview of basic Linux commands for navigation, listing directories, reading and manipulating files. It explains commands like pwd, cd, ls, cat, cp, mv, rm, mkdir to change directories, list files, read files, copy, move and delete files/directories. It also introduces the vi editor for creating new files and mentions some other miscellaneous commands like date, chmod, user management tools.
This document provides an introduction and overview of Linux commands and Perl basics. It discusses key Linux commands for system information, user management, files/directories, permissions, processes, networking and more. It also covers Perl data types, variables, input/output, strings, arithmetic, comparisons, functions and file handling. The document aims to teach Linux commands and Perl programming basics.
we need to have a good amount of basic or in-depth knowledge on Linux Basics. This will help one's job easy in resolving the issues and supporting the projects.
Are you a system admin or database admin? Or working on any other technology which is deployed or implemented on linux/UNIX machines? Then you should be good with Linux basic concepts and commands. We will cover this section very clearly.
This document provides an overview of the GNU/Linux operating system and common commands. It discusses why GNU/Linux is useful including that it is free to use and modify. Common distributions like Red Hat, Debian and SUSE are listed. Basic commands for navigating the file system, viewing files and directories, copying/moving files are described along with options for each command. The document is intended to introduce the basics of the GNU/Linux operating system.
The document provides an overview of basic Linux commands organized into the following sections:
1. General purpose utilities such as date, echo, printf, calculator applications
2. Linux file system structure and commands for viewing file attributes, permissions, ownership
3. Commands for file handling, concatenation, pagination and comparing files
This document provides an overview of Linux commands for redirecting standard input, output, and error streams. Some key points covered include:
- Redirecting input (<), output (> and >>), and pipes (|) to send output as input to another command
- Common redirection operators like tee to send output to both a file and stdout, and xargs to expand input to command line arguments
- Redirecting standard error (2>) independently from standard output using 2>, 2>>, 2>&1
- Using command substitution (`command` and $(command)) to capture output and use as arguments
- Chaining commands together in pipelines (|) to filter and transform text streams
- Examples of
This document provides an overview of common Linux commands organized into categories such as file handling, process management, disk usage, searching, editing, and remote access. It describes the purpose and basic usage of commands like vi, ls, grep, find, scp, and more. Examples are given for piping output, redirection, appending, and searching/replacing text within files. Links to additional online resources on Linux basics and tips are also included.
The document describes various Linux commands for displaying system information, manipulating files and directories, and filtering data. It provides examples of commands like date, cal, who, ls, cat, cp, mv, rm, pwd and others along with descriptions and sample outputs. Cut, paste, sort commands are described for filtering specific fields from files based on delimiters.
This document provides an overview of basic Linux commands for navigation, listing directories, reading and manipulating files. It explains commands like pwd, cd, ls, cat, cp, mv, rm, mkdir to change directories, list files, read files, copy, move and delete files/directories. It also introduces the vi editor for creating new files and mentions some other miscellaneous commands like date, chmod, user management tools.
This document provides an introduction and overview of Linux commands and Perl basics. It discusses key Linux commands for system information, user management, files/directories, permissions, processes, networking and more. It also covers Perl data types, variables, input/output, strings, arithmetic, comparisons, functions and file handling. The document aims to teach Linux commands and Perl programming basics.
we need to have a good amount of basic or in-depth knowledge on Linux Basics. This will help one's job easy in resolving the issues and supporting the projects.
Are you a system admin or database admin? Or working on any other technology which is deployed or implemented on linux/UNIX machines? Then you should be good with Linux basic concepts and commands. We will cover this section very clearly.
This document provides an overview of the GNU/Linux operating system and common commands. It discusses why GNU/Linux is useful including that it is free to use and modify. Common distributions like Red Hat, Debian and SUSE are listed. Basic commands for navigating the file system, viewing files and directories, copying/moving files are described along with options for each command. The document is intended to introduce the basics of the GNU/Linux operating system.
The document provides an overview of basic Linux commands organized into the following sections:
1. General purpose utilities such as date, echo, printf, calculator applications
2. Linux file system structure and commands for viewing file attributes, permissions, ownership
3. Commands for file handling, concatenation, pagination and comparing files
This document provides an overview of Linux commands for redirecting standard input, output, and error streams. Some key points covered include:
- Redirecting input (<), output (> and >>), and pipes (|) to send output as input to another command
- Common redirection operators like tee to send output to both a file and stdout, and xargs to expand input to command line arguments
- Redirecting standard error (2>) independently from standard output using 2>, 2>>, 2>&1
- Using command substitution (`command` and $(command)) to capture output and use as arguments
- Chaining commands together in pipelines (|) to filter and transform text streams
- Examples of
This document provides an overview of common Linux commands organized into categories such as file handling, process management, disk usage, searching, editing, and remote access. It describes the purpose and basic usage of commands like vi, ls, grep, find, scp, and more. Examples are given for piping output, redirection, appending, and searching/replacing text within files. Links to additional online resources on Linux basics and tips are also included.
The document describes various Linux commands for displaying system information, manipulating files and directories, and filtering data. It provides examples of commands like date, cal, who, ls, cat, cp, mv, rm, pwd and others along with descriptions and sample outputs. Cut, paste, sort commands are described for filtering specific fields from files based on delimiters.
The document summarizes the usage of various Linux commands like cd, bc, man, who, whoami, pwd, mkdir, rmdir, ls, touch, mv, date, cat, more, less, print, echo, lp, rm, cp and their options. It provides the syntax and examples of using each command. The commands covered are for directory navigation, file manipulation, text processing and printing files in Linux operating system.
The document provides tips for improving productivity when using the Unix command line. It discusses advantages of the shell like flexibility and chaining commands together. It then gives examples of using shell commands in scripting languages. The majority of the document provides examples of specific Unix commands like grep, find, less and their usage for tasks like file searching, viewing files and directory listings. It concludes with tips on aliases, environment variables and symbolic links.
The document discusses internal commands in DOS. It defines internal commands as built-in commands that are loaded with the operating system into memory during booting and remain resident as long as the computer is on. It provides examples of common internal commands like DIR, COPY, DEL, TYPE, CD, MD, RD, and explains what each command does and provides sample syntax. The document also discusses conventions used in command descriptions and provides examples of using wildcards with commands.
This document provides a quick reference to useful UNIX commands organized into categories such as file commands, directory commands, symbolic links, terminal commands, help commands, and more. It includes brief descriptions and usage examples for commands like ls, cd, cp, grep, find, and others. The document is intended as a quick reference and not a replacement for manuals or books on UNIX. It recommends Unix in a Nutshell as a reference.
1. The document provides examples of common Linux commands and their usage including tar, grep, find, ssh, sed, awk, vim, diff, sort, export, xargs, ls, ifconfig, uname, ps, free, top, df, kill, rm, cp, mv, cat, mount, chmod, chown, passwd, mkdir, ifconfig, uname, whereis, whatis, and locate.
2. Examples shown include how to create, extract, and view tar archives, search files with grep, find files, login remotely with ssh, edit files with vim, compare files with diff, view processes with ps, check storage usage with df, terminate processes with kill, manage files
A command is normally entered in a line by typing from the keyboard.
Commands , options and command arguments must be seperated by white space or tabs.
This document provides descriptions of common Linux commands organized into categories including file manipulation, text processing, documentation, editors, file and directory management, file display and printing, programming tools, communications, process control, status information, and web commands. It describes what each command is used for and provides examples of some commonly used commands and their functions.
This document provides an overview of common Linux commands used to process text streams and filter output, including cat, cut, head, tail, and split. It discusses how these commands can be used to select, sort, reformat, and summarize data by printing certain parts of files like columns, lines, or characters. Redirection is also covered as a way to modify command input and output. The goal is to explain the key knowledge areas and objectives for the Junior Level Linux Certification exam related to GNU and Unix commands.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document provides information about various Linux commands. It begins by defining what a command is and explaining the different types of commands - built-in shell commands and external commands. It then discusses command navigation shortcuts and various file manipulation commands like mkdir, rmdir, touch, cp, rm, man, head, tail, cat, tac, more and files. The document also covers the Linux filesystem hierarchy standard and describes the main directories for binaries, configuration, data and memory. Overall, the document serves as a guide to common Linux commands and filesystem structure.
Server is a machine configured to accept requests from clients and respond accordingly. Linux is commonly used for servers, with distributions like Ubuntu, Redhat, and Debian. Key principles of Linux include treating everything as a file, storing configuration data in text files, and using pipes to connect programs. Common server files include /etc/group, /etc/passwd, and /etc/shadow which contain user and group information.
This document provides an index of 21 coding topics that include performing arithmetic operations, comparison of numbers, compound interest calculation, prime number checking, and palindrome checking. It also includes displaying a Fibonacci series, calculating simple interest, and swapping numbers without using three variables. The index provides the topic name and number for each item.
Piping into PHP
Not the kind of pipe you smoke :) Though traditionally used to build websites, PHP has a great deal of often unused functionality. In this talk we will explore Unix named pipes and how we can start a PHP process which listens for input while it is running.
Summary of UNIX commands used in the BTI Plant Bioinformatics Course in 2014. It includes a description of these common commands and some useful options.
GNOME Terminal is a terminal emulator for the GNOME desktop environment that allows users to access a UNIX shell while using their graphical desktop. To open Terminal, users can search for it on the Dash or press Ctrl + Alt + T. The display prompt includes the username, computer name, and current directory. Basic commands demonstrated include pwd, ls, cd, touch, mkdir, rmdir, and cat. File permissions can be viewed and modified using ls -l and chmod. Ownership of files and directories can be changed with chown.
The document provides descriptions of Linux commands including their purpose, syntax, and usage. It covers common commands like bc, cal, cat, cd, cp, date, echo, grep, id, last, lastlog, ls, man, mkdir, mv, pwd, rm, rmdir, sort, shutdown, who, whois, more, less, clear, cmp, wc, whoami, head, and tail. For each command, it lists the command name, brief description, and syntax.
Basic basic solaris quick referent cardBui Van Cuong
This document provides a quick reference for basic Solaris commands. It lists common commands for navigating the file system, viewing files, manipulating text, searching, networking, processes, shells, variables and flow control. Sections cover the file hierarchy, file types and listing, redirection, wildcards, translations, finding files, regular expressions, and shell initialization and programming.
This document contains 3 sections:
1. A confidentiality statement for a proposal from Tata Consultancy Services noting that any information received should be kept confidential.
2. A reference to Tata's Code of Conduct which all employees are expected to adhere to, including reporting any violations.
3. A table of contents for a document on Unix command usage which provides examples of commands like bc, passwd, uname, and tty.
Putty is a free SSH and telnet client for Windows systems that allows connecting to remote servers via command line. To use Putty, enter the server IP address and login credentials. Settings like background color can be changed by going to Change Settings and selecting Color from the menu. Changes are saved by giving a name to the session and clicking Save.
The document summarizes the usage of various Linux commands like cd, bc, man, who, whoami, pwd, mkdir, rmdir, ls, touch, mv, date, cat, more, less, print, echo, lp, rm, cp and their options. It provides the syntax and examples of using each command. The commands covered are for directory navigation, file manipulation, text processing and printing files in Linux operating system.
The document provides tips for improving productivity when using the Unix command line. It discusses advantages of the shell like flexibility and chaining commands together. It then gives examples of using shell commands in scripting languages. The majority of the document provides examples of specific Unix commands like grep, find, less and their usage for tasks like file searching, viewing files and directory listings. It concludes with tips on aliases, environment variables and symbolic links.
The document discusses internal commands in DOS. It defines internal commands as built-in commands that are loaded with the operating system into memory during booting and remain resident as long as the computer is on. It provides examples of common internal commands like DIR, COPY, DEL, TYPE, CD, MD, RD, and explains what each command does and provides sample syntax. The document also discusses conventions used in command descriptions and provides examples of using wildcards with commands.
This document provides a quick reference to useful UNIX commands organized into categories such as file commands, directory commands, symbolic links, terminal commands, help commands, and more. It includes brief descriptions and usage examples for commands like ls, cd, cp, grep, find, and others. The document is intended as a quick reference and not a replacement for manuals or books on UNIX. It recommends Unix in a Nutshell as a reference.
1. The document provides examples of common Linux commands and their usage including tar, grep, find, ssh, sed, awk, vim, diff, sort, export, xargs, ls, ifconfig, uname, ps, free, top, df, kill, rm, cp, mv, cat, mount, chmod, chown, passwd, mkdir, ifconfig, uname, whereis, whatis, and locate.
2. Examples shown include how to create, extract, and view tar archives, search files with grep, find files, login remotely with ssh, edit files with vim, compare files with diff, view processes with ps, check storage usage with df, terminate processes with kill, manage files
A command is normally entered in a line by typing from the keyboard.
Commands , options and command arguments must be seperated by white space or tabs.
This document provides descriptions of common Linux commands organized into categories including file manipulation, text processing, documentation, editors, file and directory management, file display and printing, programming tools, communications, process control, status information, and web commands. It describes what each command is used for and provides examples of some commonly used commands and their functions.
This document provides an overview of common Linux commands used to process text streams and filter output, including cat, cut, head, tail, and split. It discusses how these commands can be used to select, sort, reformat, and summarize data by printing certain parts of files like columns, lines, or characters. Redirection is also covered as a way to modify command input and output. The goal is to explain the key knowledge areas and objectives for the Junior Level Linux Certification exam related to GNU and Unix commands.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document provides information about various Linux commands. It begins by defining what a command is and explaining the different types of commands - built-in shell commands and external commands. It then discusses command navigation shortcuts and various file manipulation commands like mkdir, rmdir, touch, cp, rm, man, head, tail, cat, tac, more and files. The document also covers the Linux filesystem hierarchy standard and describes the main directories for binaries, configuration, data and memory. Overall, the document serves as a guide to common Linux commands and filesystem structure.
Server is a machine configured to accept requests from clients and respond accordingly. Linux is commonly used for servers, with distributions like Ubuntu, Redhat, and Debian. Key principles of Linux include treating everything as a file, storing configuration data in text files, and using pipes to connect programs. Common server files include /etc/group, /etc/passwd, and /etc/shadow which contain user and group information.
This document provides an index of 21 coding topics that include performing arithmetic operations, comparison of numbers, compound interest calculation, prime number checking, and palindrome checking. It also includes displaying a Fibonacci series, calculating simple interest, and swapping numbers without using three variables. The index provides the topic name and number for each item.
Piping into PHP
Not the kind of pipe you smoke :) Though traditionally used to build websites, PHP has a great deal of often unused functionality. In this talk we will explore Unix named pipes and how we can start a PHP process which listens for input while it is running.
Summary of UNIX commands used in the BTI Plant Bioinformatics Course in 2014. It includes a description of these common commands and some useful options.
GNOME Terminal is a terminal emulator for the GNOME desktop environment that allows users to access a UNIX shell while using their graphical desktop. To open Terminal, users can search for it on the Dash or press Ctrl + Alt + T. The display prompt includes the username, computer name, and current directory. Basic commands demonstrated include pwd, ls, cd, touch, mkdir, rmdir, and cat. File permissions can be viewed and modified using ls -l and chmod. Ownership of files and directories can be changed with chown.
The document provides descriptions of Linux commands including their purpose, syntax, and usage. It covers common commands like bc, cal, cat, cd, cp, date, echo, grep, id, last, lastlog, ls, man, mkdir, mv, pwd, rm, rmdir, sort, shutdown, who, whois, more, less, clear, cmp, wc, whoami, head, and tail. For each command, it lists the command name, brief description, and syntax.
Basic basic solaris quick referent cardBui Van Cuong
This document provides a quick reference for basic Solaris commands. It lists common commands for navigating the file system, viewing files, manipulating text, searching, networking, processes, shells, variables and flow control. Sections cover the file hierarchy, file types and listing, redirection, wildcards, translations, finding files, regular expressions, and shell initialization and programming.
This document contains 3 sections:
1. A confidentiality statement for a proposal from Tata Consultancy Services noting that any information received should be kept confidential.
2. A reference to Tata's Code of Conduct which all employees are expected to adhere to, including reporting any violations.
3. A table of contents for a document on Unix command usage which provides examples of commands like bc, passwd, uname, and tty.
Putty is a free SSH and telnet client for Windows systems that allows connecting to remote servers via command line. To use Putty, enter the server IP address and login credentials. Settings like background color can be changed by going to Change Settings and selecting Color from the menu. Changes are saved by giving a name to the session and clicking Save.
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 examples of using the find command to search for files on Linux/Unix systems based on various criteria such as name, type, size, permissions, and modification time. It demonstrates how to search for files by name using wildcards, search multiple directories, and execute actions on the search results. The find command is a powerful and flexible utility for locating files and performing operations on the files found.
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.
This document contains 3 sections that discuss shell quoting mechanisms in Unix shells:
1. It defines wildcard characters like * and ? that can represent multiple or single characters when listing files.
2. It describes different quoting mechanisms - single quotes, double quotes, and backticks. Single quotes preserve literal meaning, double quotes allow variable substitution but preserve special characters, and backticks execute commands.
3. It provides examples of using each quoting mechanism, such as using double quotes to substitute a variable value and backticks to capture the output of a date command.
The document contains a confidentiality statement indicating that the information is confidential and intended solely for the purpose of evaluating a proposal from Tata Consultancy Services Limited. It requires recipients to maintain confidentiality and not disclose the information without authorization. It also references Tata's Code of Conduct which governs dealings in an ethical manner. The document includes a table of contents listing basic UNIX commands that will be described.
This document provides instructions for using WinSCP to securely transfer files between a local computer and a remote server. It begins with an introduction to WinSCP and Secure FTP. It then outlines the steps to log in to a server, download files from the remote server to the local machine, upload files from the local machine to the remote server, and save login sessions for future use. The steps include entering host name, username, password, selecting protocol (SFTP/SCP), navigating directories, dragging and dropping or copying files between the local and remote panes.
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
This document provides an overview of Unix users and file permissions. It discusses the different types of users in Unix including root, system, and general users. It also covers file permissions in terms of ownership levels, permission types, and how to change permissions using the chmod command in both symbolic and octal modes. Examples are provided for managing users and groups as well as setting permissions on files and directories. The document contains content for a training course on Unix users and file permissions.
This document provides instructions for various exercises to be completed as part of an Operating Systems lab manual. It includes exercises on system calls like fork, exec, wait; I/O system calls; simulating commands like ls and grep; scheduling algorithms like FCFS, SJF, priority, round robin; inter-process communication using shared memory, pipes, message queues; the producer-consumer problem using semaphores; and memory management schemes including paging, segmentation, and file allocation techniques. Example code is provided for implementing different memory management algorithms using concepts like free space list, allocated space list, and block merging.
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.
The document provides summaries of various Linux commands:
- The man command displays the manual for a command, including its name, synopsis, description, options, exit status, errors, versions, examples, and more.
- The pwd command prints the path of the current working directory.
- The cal command displays the calendar for the current or specified month and year.
Linux is an open source operating system where everything can be done via commands. It was developed by Linus Torvalds and the first official version 0.02 was released in 1991. The shell is a program that takes commands from the keyboard and gives them to the operating system to perform tasks. Common shells include BASH, KSH, and TCSH. Vi is a basic text editor used on Linux systems to create, edit, and view text files. It has two modes - command mode to enter commands and insert mode to add/edit text. Basic file management, text processing and other useful commands are also described.
This document provides instructions for 27 common Linux commands: mkdir, rmdir, ls, cd, cat, touch, wc, who, pwd, rm, mv, chmod, cp, grep, cal, date, vi, tput, ps, export, type, tail, sudo, head, man, clear, and adduser. For each command, it lists the syntax and provides 1-3 examples of common uses. The document is presented over 28 pages with the commands organized topic-by-topic and includes formatting like headings and indentation to aid readability.
This document provides an overview of Linux file management basics. It discusses permissions for files and directories, essential file management tasks like creating/moving/copying files, using text editors like Nano and Vim, performing operations like viewing file timestamps and disk usage. It also covers Linux wildcards for pattern matching, and tools for finding files like locate, find, whereis etc. I/O redirection and pipes/filters are also mentioned.
This document provides an overview of the UNIX operating system and basic UNIX commands. It discusses why knowledge of UNIX is useful for testers, the multi-user and multi-tasking capabilities of UNIX, and common commands for navigating files and directories, manipulating text, and viewing processes. The document also summarizes UNIX file system structure, permissions, and compression/filtering commands like grep, sort, cut, and diff.
This document provides an overview of the UNIX operating system and basic UNIX commands. It discusses why knowledge of UNIX is useful for testers, outlines some key features of UNIX like multi-user capability and security, and describes common commands for navigating the file system, manipulating files and directories, filtering output, and running processes in the background. The document is intended as an introduction to UNIX for testers and newcomers to help increase their job opportunities.
The document provides 40 tips for using basic Linux command line commands and tricks. Some key points include: everything in Linux is a file; # and $ denote superuser and normal users respectively; Ctrl+Alt+F1-F6 switch between terminals while Ctrl+Alt+F7 switches to the GUI; tilde ~ denotes the user's home directory; hidden files start with dot; ls -a views hidden files; file permissions use rwx scheme; and variables can store long text for repeated use.
The document provides 40 tips for using basic Linux command line commands and tricks. Some key points include: everything in Linux is a file; # and $ denote superuser and normal users respectively; Ctrl+Alt+F1-F6 switch between terminals while Ctrl+Alt+F7 switches to the GUI; tilde ~ denotes the user's home directory; hidden files start with a dot; ls -a views hidden files; file permissions use rwx notation; and variables can be assigned text for repeated use.
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,
An operating system acts as an interface between hardware and software, managing resources and presenting an easier programming interface than the underlying hardware. The UNIX system is organized into three levels - the kernel which manages tasks and storage, the shell which connects programs and executes commands, and tools/applications which provide additional functionality. PuTTY is a free and open-source terminal emulator and SSH client most commonly used to access UNIX/Linux systems remotely from Windows. The course objectives are to learn UNIX commands, shell programming, process management, memory management, file organization, and implementing related algorithms.
The document provides an overview of Linux operating system concepts including:
- Linux is an open source operating system that interacts with hardware and allocates resources.
- It supports multi-tasking and multi-user environments. Common types include Debian, Ubuntu, and Redhat.
- Key components include the kernel, shell programs, file management commands, text editors, browsers, and programming tools.
The document provides an overview of basic Linux commands organized into the following sections:
1. General purpose utilities such as date, echo, printf, calculator commands etc.
2. Linux file system structure and commands for viewing file attributes, permissions and ownership.
3. Commands for file handling, concatenating, comparing, viewing and getting statistics of files.
This document discusses various UNIX commands for processing text streams and filtering text, including cat, cut, head, tail, and split. It provides examples of using each command to select, modify, or restructure the output. The commands can be used to select parts of files like lines (head/tail) or columns (cut), and to split files into multiple parts (split). Pipelines and redirection are also covered.
This document provides a summary of basic Linux commands including ls, date, pwd, cd, touch, mkdir, cat, head, tail, cp, mv, man, rm, who, w, df, du, uptime, hostname, echo, history, clear, su, and exit. It explains what each command is used for and provides examples of basic syntax.
The document provides summaries of common Linux utilities used for file and directory management. Some key utilities summarized include:
pwd displays the current working directory. cd changes directories. ls lists directory contents. cat displays file contents. mkdir creates directories. rm removes files. chmod changes file permissions. cp copies files. mv renames or moves files/directories. diff compares files.
The document also provides examples for using each utility and explains options to filter output or modify file attributes. Special characters, quoting, wildcards, and comparing/printing files are also summarized in the document.
This document discusses Linux text stream filters and provides examples of common Unix commands used to process and modify text streams. These commands include cat, head, tail, cut, and split. Cat prints the contents of files, head prints the first few lines, tail prints the last few lines, cut extracts parts of each line, and split divides files into smaller parts. The document also covers input/output redirection and how it can be used with text stream filters.
Similar to 5_File_Handling_Commands__vi_editor_and_environment_variables (20)
1. Document Number: Copy Number:
TATA CONSULTANCY SERVICES
PRE ILP – Unix LOUNGE
Content Manual Version 1.0
February 2014
A Division of Tata Sons Limited
2. DOCUMENT RELEASE NOTICE
Notice No.
Client
Project
Document details
Name Version No. Author Description
Revision details:
Action taken
(add/del/chg
)
Preceding
page No.
New
page No.
Revision
description
Change Register serial numbers covered:
The documents or revised pages are subject to document control.
Please keep them up-to-date using the release notices from the distributor of the document.
These are confidential documents. Unauthorised access or copying is prohibited.
Approved by : ________________________________ Date: _________
Authorised by: ________________________________ Date: _________
Page i
TCS PreILP - Unix Lounge Content Manual – Ver. 1.0
3. DOCUMENT REVISION LIST
Client
Project
Document Name
Release Notice Reference (for release)
Rev.
No.
Revision
date
Revision
description
Page
No.
Prev
page
No.
Action
taken
Addenda
/New
page
Release
Notice
reference
Page ii
TCS PreILP - Unix Lounge Content Manual – Ver. 1.0
4. CONTENTS
CHAPTER 5 - UNIX FILE COMMANDS........................................................................IV
5.1 Objective...........................................................................................................iv
5.2 Course Content................................................................................................iv
5.2.1 touch command........................................................................................iv
5.2.2 cat command............................................................................................iv
5.2.3 cat > and cat >> command........................................................................v
5.2.4 cp command..............................................................................................v
5.2.5 mv command............................................................................................vi
5.2.6 rm command.............................................................................................vi
5.2.7 find command...........................................................................................vii
5.3 Video 5: File Commands ..............................................................................viii
5.4 Quiz Time........................................................................................................viii
CHAPTER 6 - BASICS OF VI EDITOR AND ENVIRONMENT VARIABLES...............................IX
6.1 Objective...........................................................................................................ix
6.2 Course Content................................................................................................ix
6.2.1 The vi Editor .............................................................................................ix
6.2.1.1 Edit Mode Commands ........................................................................ix
6.2.1.2 Save and Exit from vi ..........................................................................x
6.2.1.3 Cursor Movement Commands ............................................................x
6.2.1.4 Search and Repeat-Search Commands..............................................x
6.2.1.5 Deletion and Modification Commands ...............................................xi
6.2.1.6 Commands to Move or Copy Lines ....................................................xi
6.2.1.7 Customizing vi editor environment .....................................................xi
6.2.2 Environment Variables (EVs) ..................................................................xii
6.3 Video 6: Working with vi editor.......................................................................xiii
6.4 Quiz Time.......................................................................................................xiv
5. CHAPTER 5 - UNIX FILE COMMANDS
5.1 Objective
To discuss the basic file commands.
5.2 Course Content
touch
cat
cat > and cat >>
find
cp
mv
rm
5.2.1 touch command
Touch command is used in Unix to create an empty file.
Touch command is used to change these timestamps (access time and
modification time of a file).
5.2.2 cat command
Use of cat command:
'cat' command is used to display a file content.
Syntax: $ cat filename [ filename ]
$ touch file1 file2
$ ls -l
-rw-r--r-- 1 user group 0 2014-02-08 7:14 file1
-rw-r--r-- 1 user group 0 2014-02-08 7:14 file2
$
$ cat data
This is an unix file
This is line two
$
6. 'cat' command can be used to display content of more than one file content.
The name cat originated from the word concatenate
Syntax: $ cat file1 file2 ...
Note: cat command also changes the access time of the file.
5.2.3 cat > and cat >> command
Redirection operator ( > and >>) can be used with cat command to take input
from standard input device(keyboard) and store them to a file.
Syntax: $ cat > [filename]
Press <ctrl>+d to save and exit after typing the contents of the file
cat >> command is used to append text to a file.
Syntax : $ cat >>[filename]
5.2.4 cp command
cp command is used to copy one file content to another file.
Syntax: $ cp [source filename] [destination filename]
Switches:
1. cp -i [sourcefilename] [destination filename]
$ cat > data
The file created using
cat > filename
^d
$
$ cat >> data
This line appended
^d
$ cat data
The file created using
cat > filename
This line appended
$
$ cat data1 data2
Content of file data1
Content of file data2
$
7. This command copies the content of a file interactively.
2.cp -r [source_directory] [destination_directory]
This command copies the whole file hierarchy.
3. cp -v [sourcefilename] [destination filename]
Copies in verbose mode, explains what is being done
5.2.5 mv command
mv command is used for:
1. for renaming a file in same directory.
2. for moving a file to a different directory.
Syntax:
$ mv [sourcefilename] [destinationfilename]
$ mv [source_directory] [destination_directory]
5.2.6 rm command
rm command is used to delete file.
Syntax: $ rm [filename]
Switches:
1. $ rm -i [filename]
This command is used to remove a file interactively.
2. $ rm -r [directory_name]
This command is used for delete the content of directory recursively
$ cat file1
Hello
This is an Unix file
$ mv file1 file2
$ cat file1
Cat: file1: No such file or directory
$ cat file2
Hello
This is an Unix file
$
8. 5.2.7 find command
find command is used to locate the existence of a particular file in unix.
With find command one can search file based on name, type,group and
other attributes of file.
find command is used to locate unused file also.
Syntax: find <path> <selection_criteria> <action>
$ find . -type f -print
Finds only the regular files from the current directory.
Examples:
$ cat file1
Hello
This is an Unix file
$ rm -i file1
Rm: remove regular file 'file1' ? y
$ cat file1
Cat: file1: No such file or directory
$
$ find . -type f -print
./file1
./file2
./file3
$
Command Explanation
find . -name “*.c” -print Finds files with '.c' extensions from
current directory & prints.
find / -name '[A-Z]*' -print Finds filles starting with capital A to Z
from root directory.
find . -type d -print Finds all the directories from current
directory and prints it.
find / -mtime -2 -print Find all files modified two days ago
from root.
find . -atime -2 -print Find all files accessed 2 days ago
from current directory.
find / -name a.out -print Find file named a.out from root.
9. 5.3 Video 5: File Commands
http://www.youtube.com/watch?v=BM2D6uNpMoU&list=PL8A83A276F0D85E70
5.4 Quiz Time
Q1. Which command is used to recursively copy the files?
A. cp -v
B. cp -a
C. cp -r
D. cp -all
Answer: C
Q2. Which command can be used to append some text at the end of some file?
A. append <filename>
B. cat <filename>
C. cat >> <filename>
D. cat > <filename>
Answer: C
Q3. A file's modification time can be changed by using;
A. change
B. newaccess
C. touch
D. cat
Answer: C
Q4. rm is used to _____ a file:
A. remove
B. rename
C. remodel
D. rectify
Answer:A
Q5. find command is used to:
A. locate a particular file
B. locate all similar files
C. locate all directories
D. all of these
E. none of these
Answer: D
10. CHAPTER 6 - BASICS OF VI EDITOR AND
ENVIRONMENT VARIABLES
6.1 Objective
To understand the use of vi editor and the concept of Environment
Variables.
6.2 Course Content
6.2.1 The vi Editor
It is a visual editor used to enter and edit text files. Invoking vi with/without
filename puts it in command mode:
vi [<file name>]
vi works in three different modes:
Edit Mode - where any key is entered as text
Command Mode - where keys are used as commands
Ex Mode - ex commands can be entered in last line to act on text
Relationship between 3 modes
6.2.1.1 Edit Mode Commands
Command Action
a Appends text to right of cursor
A Appends text at end of line
i Inserts text to left of cursor
I Inserts text at beginning of line
o Inserts blank line below + inserts text
O Inserts blank line above + inserts text
Command Mode Ex Mode
A/a I/i O/o
<esc> :
<enter>
11. rx Replace current character with char x
Rtext<Esc> replaces character with text
6.2.1.2 Save and Exit from vi
Save and Exit Commands of ex Mode
Command Action
:w save file and remain in edit mode
:wq save file and quit edit mode
:w <filename> write buffer to file name
:q quit editing mode when no changes are made
:q! quit editing mode, abandoning changes
:x save file and quit editing mode
6.2.1.3 Cursor Movement Commands
Command Action
h or backspace Moves Cursor Left
l or spacebar Moves Cursor Right
j Moves Cursor Down
k Moves Cursor Up
nG Go to line number n
$ Moves cursor to end of line
w Moves cursor to next word
b Moves cursor back to previous word
e Moves cursor forward to end of word
Note: W, B, E perform functions similar to w, b, e except that punctuation is
skipped)
6.2.1.4 Search and Repeat-Search Commands
Command Action
/pat Search forward for pattern pat
12. ?pat Search backward for pattern pat
n Repeat search in previous search direction
; or , Repeat last character search in same or opposite direction
(by f/F/t/T) only in current line (repeat factor works)
6.2.1.5 Deletion and Modification Commands
Command Action
dw Delete Current Word
dd Delete Current Line
d$ or D Delete from cursor to end of line
cw Change Current Word
cc Change Current Line
c$ or C Change from cursor to end of line
x Delete character in current cursor position
X Delete character before cursor
.(dot) Repeat last editing instruction
u Undo single last change
U Restore all changes to line since cursor moved to it
6.2.1.6 Commands to Move or Copy Lines
[“<named-buffer>][n]dd
Cut (delete) n lines starting from current line
[“<named-buffer>][n]yy
Copy n lines starting from current line
[“<named-buffer>]p
Put yanked text after current cursor position
[“<named-buffer>]P
Put yanked text before current cursor position
Note: Named-buffer is useful for copying an area from one file into another. Open
some files simultaneously by vi. Mark an area in one file by dd or yy; move to
another file (by :next) to paste (by p or P) the named area; then say :rewind to
return to the parent file.
13. 6.2.1.7 Customizing vi editor environment
vi can be customized as per users’ requirements using ex-mode commands.
Ex Commands Action
:set all Display all set options; those pre-fixed with no are not
operative
:set autoindent(ai) Extremely useful to programmers for indentation of
lines
:set number (nu) Display all lines with numbers which are not
preserved on saving file
:set nonumber(nonu) Reverses number setting
:set tabstop=6 (ts) Changes default tab setting (8 spaces)
:set ignorecase(ic) ignores case while pattern matching
:set showmatch (sm) Helps locate matching brackets when ) or } is entered in
input mode; beeps when no match found to alert for
correction
:set autowrite (aw) Writes current file automatically whenever switching
files with :n and escaping to shell with :sh
:next (n for short) Moves to next file opened in vi
:rewind Comes back to parent file
All sets can be stored in .exrc file used by vi for its startup instructions.
Equivalently an environment variable, EXINIT can be assigned to store the
settings:
$EXINIT=“set nu tabstop=6 ignorecase”
Assignment of these changes in the .profile will be available for all sessions.
6.2.2 Environment Variables (EVs)
Environment variables are the variables that control the behaviour of the
system. Every UNIX process runs in a specific environment . An
environment consists of a table of environment variables, each with an
assigned value. When a user logs in, some files are executed and they
initialize the table holding the environment variables for the process. This
table is accessible to the shell. A child process inherit the entire execution
environment from the parent. Environment variable names are generally
given in upper case by convention.
To get a full list of currently set environment variables, 'env' command is used.
14. Some examples of the environment variables are the USER, LOGNAME, HOME,
PATH, PS1, PS2, TERM MAIL, etc.
The HOME Variable : It specifies an associated directory with every user
in a UNIX system. If the HOME variable for the user Sita contains
/usr/sita/stores, every time Sita logs in, she is taken to the directory stores.
The variable HOME is referenced the same way: $ echo ${HOME}<Enter>
The PATH Variable : Contains a list of all full path-names (separated by a
colon) of directories that are to be searched for an executable program.
For example, the command $PATH=.:/usr/bin:/bin<Enter> specifies
directories to be searched for any executable file or a command file
(current directory, /usr/bin and /bin, in that order).
The PS1 Variable : The system prompt may be changed by setting the
value of this variable to the desired prompt:
$ PS1=“Hello>”<Enter>
The PS2 Variable
prompt string for continued command line (default ‘> ‘).
The PWD Variable
The current working directory can be displayed:
echo “${PWD}”
$IFS: String of characters which are used as word separators in command
line ( space, tab, newline chars).
The MAIL Variable : Names the standard file where your mail is kept
The .profile File
This is a startup script which is executed when the user logs in. By setting
values to environment variables, user can change the working environment
for the session. However to make the environment setting permanent , the
values to the environment variables needs to be set in the .profile file. The
.profile must be located in the home directory of the user. There is an
universal environment setting also, maintained by the administrator in
/etc/profile available to all users.
A sample .profile file would look like:
PATH=.:/bin:/usr/bin
export HOME PATH PS1 MAIL
6.3 Video 6: Working with vi editor
http://www.youtube.com/watch?v=njlQiSAbSA0
15. 6.4 Quiz Time
Q1. Which of the following is not a navigation key in vi editor?
A. h
B. k
C. l
D. g
Answer: D
Q2. vi editor does not work in which mode?
A. edit
B. command
C. ex mode
D. read only
Answer: D
Q3. Multiple lines can be deleted in vi using,
A. dd
B. ndd, where n is the number of lines to be deleted
C. rm
nrm, where n is the number of lines to be deleted
Answer: B
Q4. Which of the following is not a Environment Variable?
16. A. PATH
B. NAME
C. PS2
D. HOME
Answer: B
Q5. To customize the vi editor, the action should be prefixed with:
A. :prefix
B. :set
C. :nonull
D. :custom
Answer: B