L INUX C OMMAND L INE I NTERFACE 15-09-2013 G UNAANBAN.G

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
UnixUnix Basic. Convention Italic text indicates text displayed by the computer system. For example, login: indicates a login prompt displayed by the.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
Linux Commands LINUX COMMANDS.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
© Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
The UNIX development environment CS 400/600 – Data Structures.
Working with Linux Lab 1 1. Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit,
CS240 Computer Science II Introduction the Unix File System and File Related Utilities Based on “UNIX for Programmers and Users” by G.Class and K. Ables.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Week 8: Linux / ubuntu Dr. I. H. Shah. / CSCS 301 Fall 2009.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Introduction to Programming Using C An Introduction to Operating Systems.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
1 Linux Commands. 2 Path You specify a file or directory by its path name:  the full, or absolute, path name or the one relative to a location. The full.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
Prepared by: Eng. Maryam Adel Abdel-Hady
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Shell Script Assignment 1.
Ubuntu Working in Terminal
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Tutorial of Unix Command & shell scriptS 5027
Lecture #3 Modern OS characteristics
Unix : Introduction and Commands
Operating Systems and Using Linux
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
Presentation transcript:

L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G

What is Command Line Interface in Linux?  Actually it’s a terminal. Which is a command prompt in Windows.  Two kind of terminals are there. They are,  Terminal Emulator GUI (Alt+Ctrl+T)  Text Based terminal (Alt+Ctrl+F1 / F2 / F3 / F4 / F5 / F6) “ / ” - represents ‘or’

Text based terminal can be used by six or less no. of users at a time. While entering into each terminal it will ask for user name and password to identify particular user. Same user can work on different terminals at a time. To exit from terminal to Graphical User Interface the below shortcut key is used “ Alt+Ctrl+F7 ”

C OMMANDS Starting with the basic Command “ man ” ‘ man ’ represents Manual. This command used to give the instructions about the command.

For example, man sudo command gives the instructions about sudo command.

Command “ dir “ ‘ dir ‘ stands for directory. It is used to display the files and folders within that directory. It displays file with its extension.

Command – “ mkdir “ ‘ mkdir ‘ stands for make directory. This command is used to create a directory. The syntax is, mkdir foldername

Command – ”rmdir” “rmdir” stands for remove directory. This is used to remove the directory. Make sure that the directory should be empty. The syntax is, rmdir directory_name

Command - “ ls “ It displays a list of files in the current directory in alphabetical order. It also differentiate the file name using colors with respect to their permissions.  This command can be used with some options like “ ls –a ” and “ ls –l ”.  Command ls –a : ( It displays all directory including hidden files)

 Command ls –l : It displays all directory and files along with their user access permissions.

Command – “ clear ” “ clear ” command is used to clean the screen of the terminal window. Before clearing, After clearing the screen,

Command - “ cd “ cd. It is used to change the directory. ‘ cd ‘ stands for change directory. Example given below as cd gisak. ““ The command “ cd. “ is used to stay on the same directory. “ “ The command “ cd.. “ is used to go back to the previous directory. “ ” The command “ cd ” is also used to redirect to the home directory.

Command – “ pwd “ ‘ pwd ‘ stands for print working directory. It is used to display the path of current working directory. The syntax is, pwd

Command – ”date” “date” command is used to display the current system date and time.

Command – “ cat ” ‘ ’ ‘ cat ’ command is used to create a file. The syntax is cat > filename “ text here “ Ctrl + d Example is,

Command – ”sh” “ sh” command is used to run the program in the file. The syntax is, sh file_name

Command – mv Command – “ mv “ ‘ mv ‘ command is used to rename the file and also move a file from one directory to another. The syntax for renaming a file, mv old_name new_name

‘ mv ‘ command used for moving files. The syntax is, mv path1/file path2/

‘ cat ‘ command is used to view the content of the file. The syntax is, cat filename ‘ cat ‘ command also used to concatenate two files and redirect the output to another file. The syntax is, cat file1 file2 > outputfile

Command – cmp Command – “ cmp ” ‘ cmp ‘ command is used to display the difference between the contents of the two files. The syntax is, cmp file1 file2 In the above example, the output shows that, “ the variation starts from the sixth character(byte 6) in the first line(line 1) ”.

Command – “ diff ” ‘ diff ‘ command is used to give the changes in the files while copying one directory to another. It have three different ways in describing difference between the files. They are, Changed to, Addition to, Deleted to. The syntax is, diff original_file copied_file

In the above output, 3c1 says that 3 line changed to a single line while copying the file. 1c1 says that 1 line is changed upto 3 line.

In the above output, 1a2 says that 1 st line is equal and addition to 2 and 3 lines. In the above output, 3d1 says that 2 nd and 3 rd line are deleted while copying the file.

Command – “ cp “ ‘ cp ‘ stands for copy. This command is used to copy the content of the one file to another file. The syntax is, cp source_file destination_file

Command – “ wc “ ‘ wc ‘ stands for word count. It is used to count the content of the file. The syntax is, wc filename ‘ wc –l ‘ is used to display no. of line in the file. ‘ wc –c ‘ is used to display no. of characters in the file. ‘ wc –w ‘ is used to display no. of words in the file.

Command – ” find “ “find” command used to search a file with some constraints. The syntax is, find

Command – “ more “ ‘ more ‘ command is used display the large content file in the terminal window by percentage basis. The syntax is, more filename The percentage based examples for more command is given below.

Just click enter to see next line… Finally it automatically return to normal window…. It can be stopped by clicking ‘ Ctrl+z ‘.

Command – “sort” ‘ sort ‘ command is used to display the content of the file in ascending order. The syntax is, sort filename

‘ sort –b ‘ command ignores the blank space and displays the content of the file in ascending order. The syntax is, sort –b filename

Command – “ greb “ ‘ greb ‘ command is used to display the same content in 2 different files. The syntax is, greb file1 file2

Command – “ paste “ ‘ paste ‘ command is used to combine two various file contents. The syntax is, paste file1 file2

Command – ” vi “ ‘ vi ‘ command used to open a file using Command Line Editor.

We can edit the file by clicking the ‘insert’ button on the keyboard. After editing the file, click the ‘insert’ button again. After changing text in the file, save the file and exit. enter “ :wq “.

To discard the changes and exit the file, enter “ :q “.

Make sure that the file has the permission to write….. Otherwise below output will be shown.

Command – “ rm “ ‘ rm ‘ command is used to delete a file. The syntax is, rm filename

Command – “ whoami “ ‘ whoami ‘ command is used to show the current login user name. The syntax is, whoami

Command – “ su ” ‘ su ‘ stands for super user. It is used for login from one user to another. More likely log off method. ‘ su –l’ command is used for switch user login to root login. Then it ask for root password. To come back to normal use the command ‘ logout ‘.

Command – “ who “ ‘ who ‘ command is used to display the login users with their terminal details. The syntax is, who

Command – “ chmod “ ‘ chmod ‘ stands for change mode. This command is used to change the file permissions. This command offers symbolic and numerical way for changing the modes. The syntax is, chmod filename

File before changing the permissions.

Restricting the reading and writting permission of the file in numerical way.

Opening the file, after restricting the permissions.

Providing permissions to the file in numerical way. Removing permissions of the file in symbolic way.

Providing permissions to the file in symbolic way. In changing the group, it has 3 types. They are, User, Group, Other. In Operations,it also has 3 types. They are, +, -, = In changing the modes, it also has 3 types. They are, read(4), write(2), and execute(1)

Command – “ | “ ‘ | ‘ is a pipeline command. It is used to join 2 commands. It displays 4 users are working on different terminals at the same time.

Command – “ wall “ ‘ wall ‘ command is used to display messages to all the users on different terminals at a same time. The syntax is, wall Sender side… Receiver side….

Command – ” adduser “ ‘ adduser ‘ command is used to add a new user to the system. The syntax is, adduser username

Command – “ passwd “ ‘ passwd ‘ command used to change the password of the user. The syntax is, passwd username

Command – “ userdel “ ‘ userdel ‘ command is used to delete the user id. The Syntax is, userdel username

Command – ”sudo passwd root” ‘sudo passwd root’ command is used to change the passwd of the root from the user by using super user facility. In this user must have the administrator permissions. Guest users are not allowed to change this.

Command – ”shutdown” “shutdown” command is used to halt or stop all the system processes. The syntax is, shutdown “shutdown –r now” command is used to restart the computer. “shutdown –h now” command is used to shutdown or suspend the computer. The Admin user “root” can only use this commands.

Command – ”init” ‘init’ command is also used in halting the system performance. The syntax is, init “init 0” Command is used to shutdown or suspend the computer. This command is also only used by the root user.

Thank you