11/10/2011. Directory Structures (continued)

Size: px
Start display at page:

Download "11/10/2011. Directory Structures (continued)"

Transcription

1 Guide to Parallel Operating Systems with Chapter 6 Directory Commands Objectives Describe directory structures Display directory structures Navigate directory structures Work with directories Work with file management commands Use removable drives for the storage of application data Directory Structures Scenario: organize five buildings on a campus map Problem 1: adding departments creates clutter Problem 2: adding course information not possible Solution: organize campus information in a directory Creating a directory structure: Begin with Campus as the main directory Add buildings in alphabetical order Place the departments with the correct building Directories can be manipulated with various tools Windows 7 and Linux 5 6 Directory Structures (continued) Displaying Directory Structures Displaying directory structures in the Windows 7 CLI Using the command-line interface (CLI): User types a command at a visual (command) prompt OS sends back a response Two-way interaction continues as long as needed Use TREE or DIR command to view a directory Option for locating a single file or a set of files: Specify which characters your search must match Windows command prompt to open: Click Start, pointing to All Programs, click Accessories, and click Command Prompt Using the TREE Command to Display the Directory Structure TREE: creates graphical view of disk directories Shows current directory and all subdirectories below Command syntax: TREE [drive:][path] [/F] [/A] /F: displays filenames in each folder /A: uses ASCII characters (not extended characters) Example: TREE C:\Documents and Settings\ User01\My Documents 1

2 To include filenames add the /F switch Use the /A switch to exclude extended characters Use the pipe symbol ( ) to pass the output tree and tree /f command Displaying Filenames in the Windows 7 CLI DIR command: displays filenames and subdirectories Syntax: DIR [drive:][path][filename] [/O[[:]sortorder]] [/P] [/S] [/W] [drive:][path][filename]: specifies drive, directory, files /O: lists files in sorted order Sortorder: followed by one of six values: N, S, E, D, G,- /P: pauses after each screen of information /S: shows files in specified directory and subdirectories /W: uses wide list format Example: DIR C:\Users\User01\Documents\homework.doc Using Wildcard Characters in the Windows 7 CLI Two wildcard characters identify groups of files: The question mark (?): represents any character The asterisk (*), or star: represents any string Using the? wildcard in DIR mem???.txt: Lists files named in form mem + three characters Valid matches: memo.txt, memory.txt, mem49.txt Using the * wildcard in DIR *.DOC: Lists all files in current directory with.doc extension Using Wildcard Characters in the Windows 7 CLI (continued) Displaying the Directory Structure with Windows Explorer Windows Explorer is a graphic user interface Two panes used in layout of Windows Explorer: Left pane displays the directory structure of drives Right pane displays the structure of selected entry Basic operation: Expand Computer to display available drives Files and folders view options: Four icon views, List view, Details view, Tiles, Content view Displaying the Directory Structure in Fedora 13 Directories and files are organized hierarchically Ability to manipulate directory defined by rights: Superuser: arranges information anywhere Regular user: is confined to a particular branch Fedora 13: Might be configured to open command line Can open a Terminal console from a GUI Home directory is starting directory for regular users Example: /home/user01 2

3 Example: /home/user01 Linux Command Syntax Command [options] [parameter1] [parameter2] [parameter3] Executed command produces three data streams stdin (input) stdout (output) stderr (error) Data streams for ls -l, a sample command Current directory is the stdin Detailed long listing is the stdout Resulting errors are the stderr Commands may be used conjointly using redirection(><), sequential commands(;) or piping( ) REDIRECTION Under Linux, all programs that run are given three open files (3 file descriptors) when they are started by a shell: 0. Standard in, or STDIN 1. Standard out, or STDOUT 2. Standard error, or STDERR. 0. Standard in, or STDIN. This is where input comes from, and it normally points at your terminal device. To find out what device is your terminal, use the tty command. student12@cis12:~$ tty /dev/pts/0 student12@cis12:~$ REDIRECTION You can arrange to run any command and pass it input from a file in the following way: $ some-command < /path/to/some/file Note, the '$' is your prompt. Note also, you can always specify a complete path name for a file. For example: $ grep -i Student12 < /etc/passwd Would search for the string Student12' in /etc/passwd, regardless of the case of the characters. student12@cis12:~$ grep -i Student12 < /etc/passwd student12:x:1000:1000:student12,,,:/home/student12:/bin/bash student12@cis12:~$ REDIRECTION 1. Standard out, or STDOUT. This is where the normal output from a program goes. It normally points at your terminal 3

4 This is where the normal output from a program goes. It normally points at your terminal as well, but you can redirect it. You can redirect output in the following way: $ some-program > /path/to/some/file For example: $ grep -i Student12 /etc/passwd > /tmp/results REDIRECTION 2. Standard error, or STDERR. This is where error output from your program goes. This normally points at your terminal as well, but you can redirect it. Why have different output places for standard out and standard error? Well, as you will see when you come to writing shell scripts, you often do not want error messages cluttering up the normal output from a program. The numbers 0, 1, and 2 used to list STDIN, STDOUT and STDERR are IO 'channels, called file descriptors (FDs), that have exactly those numbers. That is, STDIN is FD 0, while STDOUT is FD 1, and STDERR is FD 2. REDIRECTION When the shell runs a program for you, it opens STDIN as FD 0, STDOUT as FD 1, and STDERR as FD 2, and then runs the program (technically, it almost always does a fork(2) and then an exec(3) or one of the exec?? calls). If you have redirected one of STDIN, STDOUT or STDERR, your shell opens that file as the appropriate FD before running the program. Now, what does this all have to do with you, I hear you ask? Well, there are lots of neat things you can do, but some things to watch out for as well. REDIRECTION A lot of inexperienced Linux users assume that they can redirect a file into a program and use the same name for redirecting the output: $ some-program < mega-important-data-file > mega-important-data-file They become very upset after doing the above, especially if that mega-important data file has never been backed up anywhere. Why is this? The shell opens the mega-important-data-file for reading and associates it with FD 0 (or STDIN), and then opens it for writing, but truncates it to zero length, and associates it with FD 1 (or STDOUT) as well. So, if you want to do something like the above, use a different file name for the output file. You should also back up the files as well. REDIRECTION Now, there are lots of redirection symbols that you can use, and here are some of them: < file means open a file for reading and associate with STDIN. << token Means use the current input stream as STDIN for the program until token is seen. This is something that would be used when doing scripting. > file means open a file for writing and truncate it and associate it with STDOUT. 4

5 25 > file means open a file for writing and truncate it and associate it with STDOUT. >> file means open a file for writing and seek to the end and associate it with STDOUT. This is how you append to a file using a redirect. n>& means redirect FD n to the same places as FD m. Eg, 2>&1 means send STDERR to the same place that STDOUT is going to. OK, here are some tricks that you might want to use in various places. If you are gathering evidence for a bug report, you might want to redirect the output from a series of programs to a text file. So you might do the following: $ some-buggy-program > important-evidence.txt $ echo ' MARKER ' >> important-evidence.txt $ some-buggy-program some-params >> important-evidence.txt The second and subsequent lines append the output from the commands issues to the evidence file rather than overwriting them. Try the following: $ echo This is a line of text > /tmp/file.txt $ echo This is another line > /tmp/file.txt What do you get? > file means open a file for writing and truncate it and associate it with STDOUT. The file.txt will only contain This is another line Now try: $ echo This is a line of text > /tmp/file.txt $ echo This is another line >> /tmp/file.txt What do you get this time? OK, for the last few tricks here. Sometimes you want to append STDOUT and STDERR to a file. How do you do it? $ some-command >> /tmp/log.log 2>&1 The 2>&1 says make STDERR point to the same places as STDOUT. Since STDOUT is open already, and the shell has done a seek to the end, STDERR will also be appended to STDOUT. If you want to append a line to a file, you can echo the line you want with a redirect, rather than firing up an editor: $ echo Some text >> /path/to/some/file It turns out that you can cause the shell to redirect to other file descriptors as well. REDIRECTION Why is redirecting so important? Well, it is used in many shell scripts, it is a simple and convenient mechanism to sending output to any file without the programmer having to add code for handling command line instructions, and it is the Linux way of doing things. It is also the same as piping, where you redirect output to, or input from, a pipe device. The pipe device has a process living on the other side, and you will see this on subsequent slides. 5

6 Fedora 13 Command Syntax Command [options] [parameter1] [parameter2] [parameter3] ls l (the l is a lowercase L): Provides a detailed list of directories, files, and any errors ls l Documents: Provides a list of files in the Documents directory Linux Command Syntax (continued) Three methods for executing commands Same line, sequential command-line processing Example: ls l /etc ; pwd Semicolon (;) separates commands Piped, sequential command processing Example: ls l /etc more Pipe symbol pipes output from ls to more Batch file sequential processing Example: ls l /etc Commands saved for later execution as a batch file Displaying Directories and Files in the Fedora 13 CLI Use ls command to view list of directories and files ls default: display directory with files alpha sorted ls command syntax: ls [options] [location] Some ls command options: -a :shows hidden files -l :a long-listing format -R :list subdirectories recursively A few examples of useful ls commands: ls l /etc/hosts :list details about hosts file ls is /etc/hosts :list the size and inode number pwd Displaying Directories and Files in the Fedora 13 CLI (continued) Use more with ls to list hidden and unhidden files Example: ls Ra /etc more -R, --recursive - list subdirectories recursively Use sort with ls to control order item appears in list Example: ls l /etc sort -r k8 (sort by 8 th field in list name field, reverse order) sort command syntax: sort [options] [files] pwd command syntax: pwd [options]: Displays full path filename of the current directory more command syntax: more [options] ls l /etc sort r k Using the tree Command to Display the Directory Structure in the Fedora 13 CLI Tree: Recursive directory listing program 6

7 Produces an indented listing of files tree command: Shows files in current directory and its subdirectories Used to list contents of directories in tree-like format When directory information is given: Tree lists all files and/or subdirectories found in the given directories Using Wildcard Characters in the Fedora 13 CLI Uses same wildcard characters as Windows 7 Two wildcard characters identify groups of files: The question mark (?): represents any character The asterisk (*), or star: represents any string Example with? wildcard: ls host???? Lists files consisting of host plus any four characters Possible matches: hostuser, hosthome, host1234 Example using * wildcard: *.* Represents all filenames with any extension Navigating the Directory Structure Analogize operation to climbing a tree: Before climbing, look up and view the limbs Climb the limbs, move to smaller limbs; retrace steps Discussion of navigation techniques to follow Navigating the Directory Structure in the Windows 7 CLI Working directory: current directory (location) To change current directory: CHDIR, CD Syntax of CD command: CD [/D] [drive:][path] Three choices used with the CD command: CD..: backs up one subdirectory CD path: changes to the relative location CD \path: changes to the absolute location Scenario: change relative location of E:\User01 Enter CD College at the command prompt Command prompt changes to E:\User01\College Navigating Directory Structures in Windows Explorer Navigating directories in Windows Explorer: Click a folder in the left pane of Windows Explorer The location changes, the right pane is refreshed For example: To make Science the current folder Click Science in the left pane 40 7

8 41 42 Navigating Directory Structures in Fedora 13 Use the cd command to change current directory: Page definition options are beyond scope of book cd command syntax: cd [options] [location path] Using Absolute and Relative Paths in the Fedora 13 CLI Two methods: change absolute path or relative path Other directory symbols:. entry: points to the current directory.. entry: points to the parent directory Change the directory with the absolute path method: Type cd /college/business/accounting Refer to previous directory using the relative path: Type cd../../business/accounting Type cd.. To back up one subdirectory and move up higher Working with Directories Creating directories in the Windows 7 CLI Use MD or MKDIR to create a subdirectory in Windows MD command syntax: MD [drive:]path MD interprets drive and path like CD: MD path: creates subdirectory in a relative location MD \path: creates subdirectory in absolute location Creating Physics subdirectory relative to Science: Navigate to Science with the CD command Type MD Physics (relative path method) or Type MD \User01\College\Science\Physics Working with Directories (continued) Creating Directories in the Windows 7 GUI Navigate to the parent folder Science in left pane Click Science Right-click the white space Point to New Click Folder and type Physics Press Enter Creating Directories in Fedora 13 Users authorized to create directories with mkdir: Superuser 8

9 Regular user with write permission in parent directory mkdir syntax: (md does not work in Linux) mkdir [options] [directory name] mkdir command options: -p: makes parent directories as needed -v: displays a message for each created directory Navigating to arts directory, adding printing directory: cd /college/arts mkdir printing Removing Directories in the Windows 7 CLI Use RMDIR or RD (remove directory) command RD command syntax: RD [/S] [/Q] [drive:]path: /S: removes directories and files in specified location /Q: quiet mode (confirmation not requested) Two choices for removing a directory: RD path: removal relative from current location RD \path: removal absolute from current location Removing the Science directory: Type RD /S \User01\College\Science Press Enter and then type Y to confirm Removing Directories in the Windows 7 GUI To remove a directory: Navigate to target folder and right-click Click Delete Confirm choice by clicking the Yes button Removing the Music folder: Right-click Music in the right pane Click Delete, and then confirm the deletion A deleted item is placed in the Recycle Bin: Items can be restored or permanently deleted Removing Directories in Fedora 13 Ownership permission or superuser logon required rmdir command syntax: rmdir [options] directory[s] rmdir command options: (rm does work work) -p: tries to remove components in path as needed Cannot be used if directories contain files -v: displays a message for each removed directory Navigate to Printing directory, remove component: cd /college/arts rmdir printing Working with Files To keep your files up to date: Copy one or more files to an alternative location Move files or directories to another folder or drive Rename files and directories 9

10 Delete files from the computer Working with Files in the Windows 7 CLI Copying files in the Windows 7 CLI COPY command: copies files to alternative location XCOPY: a more powerful version of COPY Using the COPY Command in the Windows 7 CLI Command syntax: COPY [/V] source [destination]: source: specifies the file(s) to be copied destination: specifies target directory and/or filename /V: verifies that new files are written correctly About the /V switch: Used to verify that data has been accurately recorded Slows down COPY as OS must check all disk sectors Using the XCOPY Command in the Windows 7 CLI see page 259 Similar to COPY command, but has more switches Use XCOPY command to: Copy files in bulk from one directory or drive to another Copy whole directories to a new destination XCOPY syntax: XCOPY source [destination] [/P] [/S] [/E] [/V] [/Q] [/F] [/L] Making a backup of College subdirectories and files: XCOPY /S \User01\College \User01\Backup /S option excludes empty directories from operation Moving Files in the Windows 7 CLI Command syntax for moving files: MOVE [/Y /-Y] [drive:] [path]filename1[,...] [destination] Command syntax for renaming a directory: MOVE [/Y /-Y] [drive:][path]dirname1 dirname2 MOVE similar to COPY with one exception: Source file is always removed from the disk Rename the Dental subdirectory to Dental Assistant: MOVE \User01\College\Technology\Dental \User01\College\Technology\Dental Assistant Renaming Files in the Windows 7 CLI RENAME command syntax for renaming files: RENAME [drive:][path]filename1 filename2 REN command syntax for renaming files: REN [drive:][path]filename1 filename2 Renaming the Budget.xls file: Type REN Budget.xls Budget2006.xls Wildcards (* and?) used to change set of filenames: Restriction: old and new name lengths stay the same Change.txt extension to.bak : REN *.txt *.bak Deleting Files in the Windows 7 CLI DEL syntax: DEL [/P] [/S] [/Q] names 10

11 DEL syntax: DEL [/P] [/S] [/Q] names ERASE syntax: ERASE [/P] [/S] [/Q] names Options for both commands: /P: prompts for confirmation before deleting each file /S: deletes specified files from all subdirectories /Q: operates in quiet mode Delete one or more files using DEL command To remove the homework.doc file: DEL \User01\homework.doc Working with Files in the Windows 7 GUI Copying files in the Windows 7 GUI: Example: copying the homework.doc file Navigate to the subdirectory that contains the file Right-click homework.doc Click Copy Navigate to the new location in the left pane Right-click the white space of the right pane Click Paste Moving Files in the Windows 7 GUI Similar to copying files in Windows Explorer Example: to move the homework.doc file Navigate to the subdirectory that contains the file Right-click homework.doc Click Cut Navigate to the new location in the left pane Right-click the white space of the right pane Click Paste Renaming Files in the Windows 7 GUI Example: to rename the homework.doc file Navigate to the subdirectory that contains the file Right-click homework.doc Click Rename Type a new name over homework.doc Press Enter to save the name Attempt to change extension generates warning: Enter Yes to indicate that new extension is acceptable Deleting Files in the Windows 7 GUI Example: to delete the homework.doc file Navigate to the subdirectory that contains the file Right-click homework.doc Click Delete Confirm File Delete message generated: To delete the file, click the Yes button 11

12 Working with Files in Fedora 13 Copying files in the Fedora 13 CLI Three variations on the cp command syntax: cp [options] [source path] [target path] cp [options] [source path] [target directory] cp [options] [source directory] [target directory] Some cp command options: -l: makes hard links instead of copying them -R or -r: copies directories recursively -s: makes symbolic links instead of copying files To copy a branch with deep, nested directories: cp -r /college/science/chemistry/* /college/arts/ Understanding UNIX / Linux filesystem Inodes The inode (index node) is a fundamental concept in the Linux and UNIX file system. Each object in the file system is represented by an inode. But what are the objects? Let us try to understand it in simple words. Inode (Object) Attributes: All the information listed below is stored in an inode. In short the inode identifies the file and its attributes. => File type (executable, block special etc) => Permissions (read, write etc) => Owner => Group => File Size => File access, change and modification time (remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux sys admin job interview) => File deletion time => Number of links (soft/hard) => Extended attribute such as append only or no one can delete file including root user (immutability) => Access Control List (ACL) Inode Attributes All the above information is stored in an inode. In short the inode identifies the file and its attributes (as above). Each inode is identified by a unique inode number within the file system. Inode is also know as index number. inode definition An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An inode stores basic information about a regular file, directory, or other file system objects

13 69 Hard and Soft Links Symbolic links (also called symlinks or softlinks) most resemble Windows shortcuts. They contain a pathname to a target file. Hard links are a bit different. They are listings that contain information about the file. Linux files don't actually live in directories. They are assigned an inode number, which Linux uses to locate files. So a file can have multiple hardlinks, appearing in multiple directories, but isn't deleted until there are no remaining hardlinks to it. Here are some other differences between hardlinks and symlinks: 1. You cannot create a hardlink for a directory. 2. If you remove the original file of a hardlink, the link will still show you the content of the file. 3. A symlink can link to a directory. 4. A symlink, like a Windows shortcut, becomes useless when you remove the original file Hardlinks Let's do a little experiment to demonstrate the case. Make a new directory called Test and then move into it. to do that, type: $ mkdir Test $ cd Test Then make a file called FileA: $ vi FileA Press the i key to enter Insert mode: i Then type in some funny lines of text (like "Why did the chicken cross the road?") and save the file by typing: Esc ZZ So, you made a file called FileA in a new directory called "Test" in your /home. It contains an old and maybe not so funny joke. Now, let's make a hardlink to FileA. We'll call the hardlink FileB. (The logical link command is used.) $ ln FileA FileB Then use the "i" argument to list the inodes for both FileA and its hardlink. Type: $ ls -il FileA FileB This is what you get: rw-r--r-- 2 bruno bruno 21 May 5 15:55 FileA rw-r--r-- 2 bruno bruno 21 May 5 15:55 FileB You can see that both FileA and FileB have the same inode number ( ). Also both files have the same file permissions and the same size. Because that size is reported for the same inode, it does not consume any extra space on your HD! Next, remove the original FileA: $ rm FileA And have a look at the content of the "link" FileB: $ cat FileB You will still be able to read the funny line of text you typed. 13

14 You will still be able to read the funny line of text you typed Symlinks Staying in the same test directory as above, let's make a symlink to FileB. Call the symlink FileC: $ ln -s FileB FileC Then use the i argument again to list the inodes. $ ls -il FileB FileC This is what you'll get: rw-r--r-- 1 bruno bruno 21 May 5 15:55 FileB lrwxrwxrwx 1 bruno bruno 5 May 5 16:22 FileC -> FileB You'll notice the inodes are different and the symlink got a "l" before the rwxrwxrwx. The link has different permissions than the original file because it is just a symbolic link. Its real content is just a string pointing to the original file. The size of the symlink (5) is the size of its string. (The "-> FileB" at the end shows you where the link points to.) Now list the contents: $ cat FileB $ cat FileC They will show the same funny text. Now if we remove the original file: $ rm FileB and check the Test directory: $ ls You'll see the symlink FileC is still there, but if you try to list the contents: $ cat FileC It will tell you that there is no such file or directory. You can still list the inode. Typing: $ ls -il FileC will still give you: lrwxrwxrwx 1 bruno bruno 5 May 5 16:22 FileC -> FileB But the symlink is obsolete because the original file was removed, as were all the hard links. So the file was deleted even though the symlink remains. (Hope you're still following.) OK. The test is over, so you can delete the Test directory: $ cd.. $ rm -rf Test (r stands for recursive and f is for force) Note: Be cautious using "rm -rf"; it's very powerful. If someone tells you to do "rm -rf /" as root, you might loose all your files and directories on your / partition! Not good advice. Now you know how to create (and remove) hardlinks and symlinks it will make it easier to access files and run programs. 14

15 Summary - Hard vs. Soft link in Linux Hard link vs. Soft link in Linux or UNIX Hard links cannot links directories Cannot cross file system boundaries Soft or symbolic links are just like hard links. It allows to associate multiple filenames with a single file. However, symbolic links allows: To create links between directories Can cross file system boundaries These links behave differently when the source of the link is moved or removed. Symbolic links are not updated. Hard links always refer to the source, even if moved or removed. Moving Files in the Fedora 13 CLI Two variations on the command syntax: mv [options] [source] [target] mv [options] [source] [target directory] Command options: -f: displays a prompt before overwriting -I: also displays a prompt before overwriting but is used in interactive processing -v: displays command activity as it occurs mv similar to cp with one exception: The source file is always removed from its directory Renaming the Files in the Fedora 13 CLI Use the mv command To change Dental Department to Dental Assistant: Type mv /User01/college/technology/dental /User01/college/technology/dental assistant Use quotes to enclose filenames with spaces Deleting Files in the Fedora 13 CLI Use the rm command to delete one or more files rm command syntax: rm [options] file[s] rm command options: -I: prompts before any removal -R or -r: removes contents of directories recursively -v: displays command activity as it occurs To remove all of the.doc files from /User01: Type rm /mnt/sdb1/user01/* Using Removable Drives for Application Data Storage Using Removable Drives in the Windows 7 CLI Format disk before use: To remove any existing files To improve the odds that the USB drive will accept new files without write errors After formatting disk: 15

16 You can copy the files from the hard drive Formatting Removable Drives in the Windows 7 CLI FORMAT syntax: FORMAT volume [/V:label] [/Q] volume: specifies drive letter (followed by a colon) /V:label: specifies the volume label /Q: performs a quick format To format a USB drive as the H drive: Type FORMAT H: and press Enter Specify up to 11 volumes using the /V switch Use the /Q switch to perform a quick format Copying Files to a Removable Drive in the Windows 7 CLI Copy files to formatted disk with COPY or XCOPY To copy the homework.doc file: Navigate to the subdirectory that contains the file Enter the command COPY homework.doc H: Using Removable Drives in the Windows 7 GUI Formatting removable drives in the Windows 7 GUI: To format a USB drive: Place it in the USB port From Windows Explorer, right-click the USB option and then click Format Format USB dialog box appears Click the Quick Format check box Click the Start button to start the format Using Removable Drives in the Windows 7 GUI (continued) Copying files to a Disk in the Windows 7 GUI Windows Explorer: Can copy files to a formatted disk Storing files from an application Click File ->Save As Click the Save in list box, click the USB drive Type filename then click Save Using Removable Drives in the Fedora 13 CLI To prepare a disk for use: Unmount the disk and format it Mount the disk drive and copy files from hard drive Formatting removable drives in the Fedora 13 CLI: Use floppy command to format removable drives Syntax: floppy [options] [target device] Using Removable Drives in the Fedora 13 CLI (continued) 16

17 Formatting removable drives in the Fedora 13 CLI (continued): Some options used with floppy command: probe, -p: probes for available floppy drives -format, -f: formats the disk in the floppy drive Copying files to a removable drive in the Fedora 13 CLI To copy a file called homework.doc: Navigate to subdirectory that contains file, then use cp homework.doc /dev/fd0 or cp homework.doc /dev/sda Summary Use directory structures to: Organize and maintain information in files and folders Use a command-line interface (CLI): To help you display the contents of a directory To manage the directory structure: Create new directories to categorize folder information Remove directories that are obsolete When you navigate directory structures: Each operating system has its own syntax Summary (continued) When navigating the absolute path: Provide the drive and the full path name When navigating with a relative path: The current directory path is implied Use a command prompt or a GUI to: Copy, move, rename, and delete files Removable drives: Provide portability for file management and processing 17

Files and Directories

Files and Directories CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on

More information

Filesystem and common commands

Filesystem and common commands Filesystem and common commands Unix computing basics Campus-Booster ID : **XXXXX www.supinfo.com Copyright SUPINFO. All rights reserved Filesystem and common commands Your trainer Presenter s Name Title:

More information

Files

Files http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably

More information

5/8/2012. Creating and Changing Directories Chapter 7

5/8/2012. Creating and Changing Directories Chapter 7 Creating and Changing Directories Chapter 7 Types of files File systems concepts Using directories to create order. Managing files in directories. Using pathnames to manage files in directories. Managing

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Internal Commands COPY and TYPE

Internal Commands COPY and TYPE Internal Commands COPY and TYPE Ch 5 1 Overview Will review file-naming rules. Ch 5 2 Overview Will learn some internal commands that can be used to manage and manipulate files. Ch 5 3 Overview The value

More information

CSCI 2132 Software Development. Lecture 5: File Permissions

CSCI 2132 Software Development. Lecture 5: File Permissions CSCI 2132 Software Development Lecture 5: File Permissions Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 14-Sep-2018 (5) CSCI 2132 1 Files and Directories Pathnames Previous

More information

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan DATA 301 Introduction to Data Analytics Command Line Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Why learn the Command Line? The command line is the text interface

More information

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line DATA 301 Introduction to Data Analytics Command Line Why learn the Command Line? The command line is the text interface to the computer. DATA 301: Data Analytics (2) Understanding the command line allows

More information

5/20/2007. Touring Essential Programs

5/20/2007. Touring Essential Programs Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.

More information

Std: XI CHAPTER-3 LINUX

Std: XI CHAPTER-3 LINUX Commands: General format: Command Option Argument Command: ls - Lists the contents of a file. Option: Begins with minus sign (-) ls a Lists including the hidden files. Argument refers to the name of a

More information

Introduction to Linux

Introduction to Linux Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons

More information

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms: Processes The Operating System, Shells, and Python Shell Commands a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms: - Command prompt - Shell - CLI Shell commands

More information

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80 CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

Linux Command Line Primer. By: Scott Marshall

Linux Command Line Primer. By: Scott Marshall Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and

More information

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB Student Name: Lab Section: Boot Process and GRUB 1 Due Date - Upload to Blackboard by 8:30am Monday April 16, 2012 Submit the completed lab to Blackboard following the Rules for submitting Online Labs

More information

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )

More information

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

Chapter 1 - Introduction. September 8, 2016

Chapter 1 - Introduction. September 8, 2016 Chapter 1 - Introduction September 8, 2016 Introduction Overview of Linux/Unix Shells Commands: built-in, aliases, program invocations, alternation and iteration Finding more information: man, info Help

More information

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt

More information

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands 1 What is an Operating System? A computer program that: Controls how the CPU, memory

More information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one] Data and Computer Security (CMPD414) Lab II Topics: secure login, moving into HOME-directory, navigation on Unix, basic commands for vi, Message Digest This lab exercise is to be submitted at the end of

More information

Lab Working with Linux Command Line

Lab Working with Linux Command Line Introduction In this lab, you will use the Linux command line to manage files and folders and perform some basic administrative tasks. Recommended Equipment A computer with a Linux OS, either installed

More information

The Directory Structure

The Directory Structure The Directory Structure All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection 1 CSE 390a Lecture 2 Exploring Shell Commands, Streams, and Redirection slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/390a/ 2 Lecture summary Unix

More information

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt ULI101 Week 03 Week Overview Absolute and relative pathnames File name expansion Shell basics Command execution in detail Recalling and editing previous commands Quoting Pathnames A pathname is a list

More information

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

18-Sep CSCI 2132 Software Development Lecture 6: Links and Inodes. Faculty of Computer Science, Dalhousie University. Lecture 6 p.

18-Sep CSCI 2132 Software Development Lecture 6: Links and Inodes. Faculty of Computer Science, Dalhousie University. Lecture 6 p. Lecture 6 p.1 Faculty of Computer Science, Dalhousie University CSCI 2132 Software Development Lecture 6: Links and s 18-Sep-2017 Location: Goldberg CS 127 Time: 14:35 15:25 Instructor: Vlado Keselj Previous

More information

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 Introduction to Linux Part 1 Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system kp001 kp002. kpxxx FastX

More information

Links, basic file manipulation, environmental variables, executing programs out of $PATH

Links, basic file manipulation, environmental variables, executing programs out of $PATH Links, basic file manipulation, environmental variables, executing programs out of $PATH Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP The $PATH PATH (which

More information

Command Line Interface The basics

Command Line Interface The basics Command Line Interface The basics Marco Berghoff, SCC, KIT Steinbuch Centre for Computing (SCC) Funding: www.bwhpc-c5.de Motivation In the Beginning was the Command Line by Neal Stephenson In contrast

More information

Advanced Linux Commands & Shell Scripting

Advanced Linux Commands & Shell Scripting Advanced Linux Commands & Shell Scripting Advanced Genomics & Bioinformatics Workshop James Oguya Nairobi, Kenya August, 2016 Man pages Most Linux commands are shipped with their reference manuals To view

More information

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

More information

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version... Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing

More information

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010 Lecture 2 Fall 2010 Hussam Abu-Libdeh based on slides by David Slater September 10, 2010 Last Time We had a brief discussion On The Origin of Species *nix systems Today We roll our sleeves and get our

More information

UNIX System Programming Lecture 3: BASH Programming

UNIX System Programming Lecture 3: BASH Programming UNIX System Programming Outline Filesystems Redirection Shell Programming Reference BLP: Chapter 2 BFAQ: Bash FAQ BMAN: Bash man page BPRI: Bash Programming Introduction BABS: Advanced Bash Scripting Guide

More information

Lec 1 add-on: Linux Intro

Lec 1 add-on: Linux Intro Lec 1 add-on: Linux Intro Readings: - Unix Power Tools, Powers et al., O Reilly - Linux in a Nutshell, Siever et al., O Reilly Summary: - Linux File System - Users and Groups - Shell - Text Editors - Misc

More information

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CSC209H Lecture 1. Dan Zingaro. January 7, 2015 CSC209H Lecture 1 Dan Zingaro January 7, 2015 Welcome! Welcome to CSC209 Comments or questions during class? Let me know! Topics: shell and Unix, pipes and filters, C programming, processes, system calls,

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

Linux & Shell Programming 2014

Linux & Shell Programming 2014 Unit -1: Introduction to UNIX/LINUX Operating System Practical Practice Questions: Find errors (if any) otherwise write output or interpretation of following commands. (Consider default shell is bash shell.)

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

UNIX File Hierarchy: Structure and Commands

UNIX File Hierarchy: Structure and Commands UNIX File Hierarchy: Structure and Commands The UNIX operating system organizes files into a tree structure with a root named by the character /. An example of the directory tree is shown below. / bin

More information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book). Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating

More information

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual Objective This lab is all about running commands in Ubuntu Terminal and compiling C program in Ubuntu Table of

More information

Command-line interpreters

Command-line interpreters Command-line interpreters shell Wiki: A command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to the program in the form of successive

More information

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2 CSE Linux VM For Microsoft Windows Based on opensuse Leap 42.2 Dr. K. M. Flurchick February 2, 2017 Contents 1 Introduction 1 2 Requirements 1 3 Procedure 1 4 Usage 3 4.1 Start/Stop.................................................

More information

Lab - Common Windows CLI Commands

Lab - Common Windows CLI Commands Introduction In this lab, you will use CLI commands to manage files and folders in Windows. Recommended Equipment A computer running Windows Step 1: Access the Windows command prompt. a. Log on to a computer

More information

CSC UNIX System, Spring 2015

CSC UNIX System, Spring 2015 CSC 352 - UNIX System, Spring 2015 Study guide for the CSC352 midterm exam (20% of grade). Dr. Dale E. Parson, http://faculty.kutztown.edu/parson We will have a midterm on March 19 on material we have

More information

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes CSE 390a Lecture 2 Exploring Shell Commands, Streams, Redirection, and Processes slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/390a/ 1 2 Lecture

More information

Essential Linux Shell Commands

Essential Linux Shell Commands Essential Linux Shell Commands Special Characters Quoting and Escaping Change Directory Show Current Directory List Directory Contents Working with Files Working with Directories Special Characters There

More information

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME Introduction to the Unix command line History Many contemporary computer operating systems, like Microsoft Windows and Mac OS X, offer primarily (but not exclusively) graphical user interfaces. The user

More information

Find out where you currently are in the path Change directories to be at the root of your home directory (/home/username) cd ~

Find out where you currently are in the path Change directories to be at the root of your home directory (/home/username) cd ~ CIS 105 Working with directories You have using directories in a Windows environment extensively. Often in Windows we are calling them folders. They are important in order to organize our files. It is

More information

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Unix tutorial Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Terminal windows You will use terminal windows to enter and execute

More information

Introduction. File System. Note. Achtung!

Introduction. File System. Note. Achtung! 3 Unix Shell 1: Introduction Lab Objective: Explore the basics of the Unix Shell. Understand how to navigate and manipulate file directories. Introduce the Vim text editor for easy writing and editing

More information

Lab 2: Linux/Unix shell

Lab 2: Linux/Unix shell Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When

More information

A Brief Introduction to the Linux Shell for Data Science

A Brief Introduction to the Linux Shell for Data Science A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like

More information

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems This is Worksheet and Assignment 12 This is a combined Worksheet and Assignment.. Quizzes and tests may refer to work done in this Worksheet and Assignment; save your answers. You will use a checking program

More information

Full file at https://fratstock.eu

Full file at https://fratstock.eu Guide to UNIX Using Linux Fourth Edition Chapter 2 Solutions Answers to the Chapter 2 Review Questions 1. Your company is discussing plans to migrate desktop and laptop users to Linux. One concern raised

More information

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~ Introduction to Open Source Software Development Spring semester, 2017 School of Computer Science and Engineering, Pusan National University Joon-Seok Kim LINUX: COMMANDS Review Lab #1 2 Create Directories

More information

Computer Architecture Lab 1 (Starting with Linux)

Computer Architecture Lab 1 (Starting with Linux) Computer Architecture Lab 1 (Starting with Linux) Linux is a computer operating system. An operating system consists of the software that manages your computer and lets you run applications on it. The

More information

Chapter 6. Linux File System

Chapter 6. Linux File System Chapter 6 Linux File System 1 File System File System management how to store informations on storage devices The Hierarchical Structure Types of file Common File system Tasks 2 The Hierarchical Structure

More information

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers

More information

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny. Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny stefano.gaiarsa@unimi.it Linux and the command line PART 1 Survival kit for the bash environment Purpose of the

More information

Welcome to Linux. Lecture 1.1

Welcome to Linux. Lecture 1.1 Welcome to Linux Lecture 1.1 Some history 1969 - the Unix operating system by Ken Thompson and Dennis Ritchie Unix became widely adopted by academics and businesses 1977 - the Berkeley Software Distribution

More information

This is Lab Worksheet 13 - not an Assignment. Boot Process and GRUB

This is Lab Worksheet 13 - not an Assignment. Boot Process and GRUB This is Lab Worksheet 13 - not an Assignment This Lab Worksheet contains some practical examples that will prepare you to complete your Assignments. You do not have to hand in this Lab Worksheet. Make

More information

Unix Introduction to UNIX

Unix Introduction to UNIX Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands Week 2 Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands mkdir, cd, cls, del, copy, attrib, date, path, type, format, exit. Basic commands in LINUX - cat, ls, pwd,,

More information

CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND

CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND Prof. Michael J. Reale Fall 2014 Finding Files in a Directory Tree Suppose you want to find a file with a certain filename (or with a filename matching

More information

Module 8 Pipes, Redirection and REGEX

Module 8 Pipes, Redirection and REGEX Module 8 Pipes, Redirection and REGEX Exam Objective 3.2 Searching and Extracting Data from Files Objective Summary Piping and redirection Partial POSIX Command Line and Redirection Command Line Pipes

More information

Shell Programming Overview

Shell Programming Overview Overview Shell programming is a way of taking several command line instructions that you would use in a Unix command prompt and incorporating them into one program. There are many versions of Unix. Some

More information

Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (http://www.ee.surrey.ac.uk/teaching/unix/).

Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (http://www.ee.surrey.ac.uk/teaching/unix/). Ubuntu tutorial Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (http://www.ee.surrey.ac.uk/teaching/unix/). 1 Installing Ubuntu About Ubuntu For our lab sessions

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the

More information

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CENG 334 Computer Networks. Laboratory I Linux Tutorial CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction

More information

The Unix Shell. Pipes and Filters

The Unix Shell. Pipes and Filters The Unix Shell Copyright Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information. shell shell pwd

More information

Scripting Languages Course 1. Diana Trandabăț

Scripting Languages Course 1. Diana Trandabăț Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

UNIX ASSIGNMENT 1 TYBCA (Sem:V)

UNIX ASSIGNMENT 1 TYBCA (Sem:V) UNIX ASSIGNMENT 1 TYBCA (Sem:V) Given Date: 06-08-2015 1. Explain the difference between the following thru example ln & paste tee & (pipeline) 2. What is the difference between the following commands

More information

Introduction to UNIX command-line

Introduction to UNIX command-line Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

CS246 Spring14 Programming Paradigm Notes on Linux

CS246 Spring14 Programming Paradigm Notes on Linux 1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for

More information

Physics REU Unix Tutorial

Physics REU Unix Tutorial Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component

More information

Working with Basic Linux. Daniel Balagué

Working with Basic Linux. Daniel Balagué Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration

More information

Practical 4. Linux Commands: Working with Directories

Practical 4. Linux Commands: Working with Directories Practical 4 Linux Commands: Working with Directories 1. pwd: pwd stands for Print Working Directory. As the name states, command pwd prints the current working directory or simply the directory user is,

More information

Linux Command Line Interface. December 27, 2017

Linux Command Line Interface. December 27, 2017 Linux Command Line Interface December 27, 2017 Foreword It is supposed to be a refresher (?!) If you are familiar with UNIX/Linux/MacOS X CLI, this is going to be boring... I will not talk about editors

More information

CSE115 Lab exercises for week 1 of recitations Spring 2011

CSE115 Lab exercises for week 1 of recitations Spring 2011 Introduction In this first lab you will be introduced to the computing environment in the Baldy 21 lab. If you are familiar with Unix or Linux you may know how to do some or all of the following tasks.

More information