BIF713 Basic Unix/Linux Commands Getting Help with Commands.

Slides:



Advertisements
Similar presentations
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Advertisements

Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
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.
Linux+ Guide to Linux Certification, Second Edition
CS 497C – Introduction to UNIX Lecture 12: - The File System Chin-Chih Chang
Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Linux Installation and Administration Lesson 2 Tutor: George Papamarkos.
Learning basic Unix command IT 325 operating system.
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.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
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 Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Guide To UNIX Using Linux Fourth Edition
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Linux+ Guide to Linux Certification, Second Edition
Interacting with a UNIX computer: Navigating through the directory tree.
Chapter Two Exploring the UNIX File System and File Security.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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.
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.
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:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
The Genome Analysis Centre Building Excellence in Genomics and Computational Bioscience.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
Agenda The Linux File System (chapter 4 in text)
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Learning basic Unix command It 325 operating system.
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.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
ULI101 Week 02. Week Overview ● Unix file system ● Types of files ● File naming rules ● Hidden files ● Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm.
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.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Lecture 2 Working with Files and Directories
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Assignment Preliminaries
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Operating Systems and Using Linux
Tutorial of Unix Command & shell scriptS 5027
The Unix File System.
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Tutorial Unix Command & Makefile CIS 5027
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
Presentation transcript:

BIF713 Basic Unix/Linux Commands Getting Help with Commands

Basic Unix/Linux Commands All of the commands you will learn in this course will work in Linux and Unix operating systems. The commands taught in this lesson will provide the basics to get practice issuing Unix/Linux commands.

pwd / cd  pwd Used to display the user’s current (present) working directory. A user may need to where they are located on the computer system in order to build directories, copy files, etc…  cd directorypath Used to change to a directory. Entering the cd command without the directorypath will change to the user’s home directory.

ls  ls Used to display the contents of a directory (eg. Regular files or sub-directories). By default, the ls command displays non- hidden filenames only (i.e. files not beginning with a period). The following are options associated with the ls command:  -a short display of hidden & non-hidden files  -l detailed display of files (excl. hidden files)  -al detailed display of hidden & non-hidden files  -F displays / after directory, * after executable file

mkdir / rmdir  mkdir directorypath Used to create a subdirectory with a directory. Multiple arguments can be used to create many subdirectories. The option –p allows for parent directories to be created.  rmdir directorypath Used to remove only non-empty directories (i.e. directories that contain no subdirectories or regular files). A user cannot remove a directory from within the directory location itself. The user must at least be located in the parent directory.

mv / cp  mv sourcepath destinationpath Used to move a file from one location to another and/or rename the file. The mv command can be used to move non-empty directories as well as files. The –i option asks for confirmation if the destination filename already exists.  cp sourcepath destinationpath Used to copy a file from one location to another. The cp command can be used to backup important files, or get sample files from their instructors. The –i option asks for confirmation if the destination filename already exists.

rm, rm –r, rm -ri  rm filepath Used to remove a regular file.  rm -r filepath Used to recursively remove a directory file. Recursive means to descend to lower levels, which in this case, indicates that subdirectories and it contents are also removed. Note: it is a good idea to include the –i option to confirm deletion of subdirectories and its contents!

cat  cat filepath Used for a couple of purposes: 1. To join files (i.e. to concatenate files to be displayed on screen). For example, cat file1 file2 file3 would display the contents of file1 and file2 and file3 on the screen at the same time. 1. To display the contents of small files (between 1 and 24 lines). For example, issuing the command cat.bash_profile in your home directory would display the contents of your setup file.

more / less  more filepath Used to display the contents of large regular files one screen at a time. The user can navigate throughout the file by pressing keys such as:  spacebar Move to next screen b Move to previous screen enter Move to next line /car Search for pattern "car" q Exit to shell  less filepath Works like more command, but contains more navigation features.

touch  touch path Used to update the date and time of existing files. The touch command is also used for creating empty files. You will be using the touch command to create empty files when you practice the file management online tutorial later in this course...

Filename Expansion Many of the commands discussed so far make reference to a filename – e.g. and regular file to store data, or a directory. Sometimes the user may not know the exact name of a file, or the user wants to use a command to apply to a number of files that have a similar filename For example: work.txt, work2.txt, work3.txt

Filename Expansion Special characters can be used to expand a general filename and use them if they match. You may have heard about “Wildcard Characters” – this is a similar concept. Filename expansion Symbols: * (star) – Represents zero or more characters that could any anything. ? (question mark) – Represents any single character [ ] (character class) – Represents a single character that only represents a group or class of characters (i.e. group or “class” contained within square brackets – placing a ! Symbol after first square bracket means “opposite”).

Filename Expansion To demonstrate filename expansion, let’s assume the following regular files are contained in our current directory: work1.txt work2.txt work3.txt work4.c worka.txt working.txt Note the results from using filename expansion: ls work* work1.txt work2.txt work3.txt work4.c worka.txt working.txt ls work?.txt work1.txt work2.txt work3.txt worka.txt ls work[1-3].txt work1.txt work2.txt work3.txt ls work[!1-3].txt worka.txt

Other Unix/Linux Commands  whoami Used to display the username of the account’s owner.  finger username Used to display additional information regarding the user (regardless whether or not the user is currently logged onto the system).  who Used to display a list of other users currently logged on to the same system is the user. Useful options with the who command are –i and -T

Other Unix/Linux Commands  passwd Used to change an owner’s password. After issuing this command, the system will prompt the user for their existing password – if that password verifies, then the user is asked to enter and re-enter their new passwords, the user’s password is stored in the system database file /etc/passwd. A few thing to consider with the passwd command: While entering in the new password, feedback may be provided to reject unsuitable passwords (see previous notes on how to create a valid password) The –f option can be used with the passwd command to change the user’s name in the /etc/passwd database file.

Other Unix/Linux Commands  date Used to display the current date and time of the server. The super- user (i.e. root-user) can use this command to set the date and time. Refer to the online manual to format date display.  cal Used to display the current month’s calendar (by default). The user can also display the yearly calendar (year as the first argument), or a specific month for a specific year (month number as the first argument, and year as the second argument).

Getting Help with Commands A comprehensive online manual for common UNIX/Linux commands exists on your server The online manual is a command called man Command Structure: man [options] command Options: -k provides short (one-line) explanation relating to the commands matching the character string. This can be used if user doesn’t know name of command. eg. man -k calendar