Files and Directories Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See

Slides:



Advertisements
Similar presentations
DOS & Windows O/s Prof. Sujata Rao Less 5.
Advertisements

RH030 Linux Computing Essentials
Directory and File Paths Copyright © Software Carpentry and The University of Edinburgh This work is licensed under the Creative Commons Attribution.
Using Linux Commands Lab 4 1. Create empty files To create an empty file $ touch apple banana grape grapefruit watermelon $ ls -l Using file-matching.
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -
Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)
Exploring the UNIX File System and File Security
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.
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
The UNIX File System.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
UNIX Files and Security Software Tools. Slide 2 File Systems l What is a file system? A means of organizing information on the computer. A file system.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Using Linux Commands 2 Lab#5
2 $ command Command Line Options ls –a –l hello hi Command Arguments.
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
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”
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.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Ch 21 Command Syntax Using the DIR Command with Parameters and Wildcards.
Unix System Administration Rootly Powers Chapter 3.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
An Introduction to Unix Shell Scripting
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
The Secure Shell Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Browsing Directories Copyright © Software Carpentry and The University of Edinburgh This work is licensed under the Creative Commons Attribution.
Pipes and Filters Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Advanced Shell Tricks Copyright © The University of Southampton 2011 This work is licensed under the Creative Commons Attribution License See
Unix Shell Basics Edited from Greg Wilson's "Software Carpentry"
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Shell Advanced Features. Module 8 Shell Advanced Features ♦ Introduction In Linux systems, the shells are often referred to as command line interfaces.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Λειτουργικά Συστήματα - Lab1 Γιάννης Πετράκης. The Operating System  Unix is a layered operating system  The innermost layer is the hardware that provides.
Using Linux Commands Lab 4. Using the Shell in Linux Commands Syntax  Options: could be added to the commands to change their behavior (-a, -la, --help)
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
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)
Compunet Corporation Introduction to Unix (CA263) Your Environment By Tariq Ibn Aziz Dammam Community College.
Querying Directory Contents Copyright © The University of Edinburgh 2011 This work is licensed under the Creative Commons Attribution License See
Finding Things Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Configuration your environment Many user-configurable Unix programs (such as your shell) read configuration files when they start up. These configuration.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
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.
The Command Prompt Commands are the way to “do things” in Unix
Using Linux Commands Lab 3.
The Linux Command Line Chapter 2
(Chapter 2) John Carelli, Instructor Kutztown University
CSCI The UNIX System Shell Startup and Variables
Module 6 Working with Files and Directories
What is Unix? A multi-user networked operating system
Lab 2: Terminal Basics.
FEniCS – workflow Start the Docker Quickstart terminal / terminal
January 26th, 2004 Class Meeting 2
Presentation transcript:

Files and Directories Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See for more information. The Unix Shell

Files and DirectoriesIntroduction Communicate with each other Interact with us Run Programs Store Data

Files and DirectoriesIntroduction Communicate with each other Interact with us Run Programs Store Data shell

Files and DirectoriesIntroduction Store Data shell

Files and DirectoriesIntroduction Store Data shell file system

Files and DirectoriesIntroduction Store Data shell file system files

Files and DirectoriesIntroduction Store Data shell file system filesdirectories

Files and DirectoriesIntroduction Store Data shell file system filesdirectories Use the shell to view and change the file system

Files and DirectoriesIntroduction Store Data shell file system filesdirectories Use the shell to run commands to view what's in the file system

Files and DirectoriesIntroduction login:

Files and DirectoriesIntroduction login:computer prompt in bold

Files and DirectoriesIntroduction login:computer prompt in bold explanatory text in blue

Files and DirectoriesIntroduction login: vladuser input in green

Files and DirectoriesIntroduction login: vlad password: ******** password

Files and DirectoriesIntroduction login: vlad password: ******** $ shell prompt

Files and DirectoriesIntroduction login: vlad password: ******** $ shell prompt like Python's >>> and …

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami check user ID

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami check user ID shell finds the whoami program

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami check user ID shell finds the whoami program runs it

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad check user ID shell finds the whoami program runs it prints its output

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ check user ID shell finds the whoami program runs it prints its output displays a new prompt

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd what is the working directory

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd what is the working directory the directory used when no other directory is explicitly specified

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bin / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindata / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatausers / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root imhoteplarryvlad

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root imhoteplarryvlad

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root imhoteplarryvlad

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ bindatauserstmp / root imhoteplarryvlad

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ ls stands for "listing"

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ ls stands for "listing" sadly more memorable than most command names

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ ls bin data mail music notes.txt papers pizza.cfg solar solar.pdf swc $

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ an argument or flag modifying the command's behavior

Files and DirectoriesIntroduction login: vlad password: ******** $ whoami vlad $ pwd /users/vlad $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ adds a trailing '/' to directory names

Files and DirectoriesIntroduction $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ vlad binmusicmail papers data solar notes.txt pizza.cfg solar.pdf swc

Files and DirectoriesIntroduction $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ By convention, use filename extension to indicate file type

Files and DirectoriesIntroduction $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ By convention, use filename extension to indicate file type.txt for text,.pdf for PDF,.cfg for configuration file, etc.

Files and DirectoriesIntroduction $ ls -F bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ By convention, use filename extension to indicate file type.txt for text,.pdf for PDF,.cfg for configuration file, etc. But this is only a convention, not a guarantee

Files and DirectoriesIntroduction $ ls –F data

Files and DirectoriesIntroduction $ ls –F data amino_acids.txt elements/ morse.txt pdb/ planets.txt sunspot.txt $

Files and DirectoriesIntroduction vlad data a relative path $ ls –F data amino_acids.txt elements/ morse.txt pdb/ planets.txt sunspot.txt $

Files and DirectoriesIntroduction vlad data a relative path relative to current working directory $ ls –F data amino_acids.txt elements/ morse.txt pdb/ planets.txt sunspot.txt $

Files and DirectoriesIntroduction $ ls –F /data access.log backup/ hardware.cfg network.cfg $

Files and DirectoriesIntroduction an absolute path $ ls –F /data access.log backup/ hardware.cfg network.cfg $

Files and DirectoriesIntroduction an absolute path leading '/' means "from root" $ ls –F /data access.log backup/ hardware.cfg network.cfg $

Files and DirectoriesIntroduction bindatauserstmp / imhoteplarryvlad an absolute path leading '/' means "from root" so it always refers to this directory $ ls –F /data access.log backup/ hardware.cfg network.cfg $

Files and DirectoriesIntroduction $ pwd /users/vlad $

Files and DirectoriesIntroduction $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $

Files and DirectoriesIntroduction $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data

Files and DirectoriesIntroduction $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data change directory

Files and DirectoriesIntroduction change directory actually doesn't change the directory $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data

Files and DirectoriesIntroduction change directory actually doesn't change the directory changes the shell's idea of which directory we are in $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data

Files and DirectoriesIntroduction $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data $ pwd /users/vlad/data $

Files and DirectoriesIntroduction $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data $ pwd /users/vlad/data $ ls amino_acids.txt elements/ morse.txt pdb/ planets.txt sunspot.txt $

Files and DirectoriesIntroduction because we're now "in" this directory $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ cd data $ pwd /users/vlad/data $ ls amino_acids.txt elements/ morse.txt pdb/ planets.txt sunspot.txt $

Files and DirectoriesIntroduction $ pwd /users/vlad/data $

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd..

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. the directory above the current one

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. the directory above the current one its parent directory

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ ls -F -a./../ bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ ls -F -a./../ bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ "show all"

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ ls -F -a./../ bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ parent directory

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ ls -F -a./../ bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ parent directory /users

Files and DirectoriesIntroduction $ pwd /users/vlad/data $ cd.. $ pwd /users/vlad $ ls bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ $ ls -F -a./../ bin/ data/ mail/ music/ notes.txt papers/ pizza.cfg solar/ solar.pdf swc/ this directory itself

Files and DirectoriesIntroduction Things are different on Windows

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Drive letter

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Drive letter Each drive is a separate file system

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Backslash \ as separator

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Backslash \ as separator Unix uses \ to escape special characters in names like my\ files.txt

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Case insensitive

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Case insensitive c:\users\vlad C:\USERS\VLAD C:\uSeRs\VlAd

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Cygwin: /cygdrive/c/Users/vlad Map drive letters to "directories"

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Cygwin: /cygdrive/c/Users/vlad Map drive letters to "directories" And use / instead of \

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Cygwin: /cygdrive/c/Users/vlad Map drive letters to "directories" And use / instead of \ But still case insensitive

Files and DirectoriesIntroduction Things are different on Windows C:\Users\vlad Cygwin: /cygdrive/c/Users/vlad Map drive letters to "directories" And use / instead of \ But still case insensitive Can't put backup.txt and Backup.txt in a directory

Files and DirectoriesIntroduction pwd print working directory cd change working directory ls listing. current directory..parent directory

August 2010 created by Greg Wilson Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See for more information.