The Unix File System
Types of Files Ordinary files Directory Files Special Files Contains data, text, program, instructions. Directory Files Also known as “folders” in other operating systems. Special Files Device files used to communicate with hardware.
Unix FileSystem
Working with Files $ pwd $ ls $ cat <argument> the directory you are currently working on $ ls lists the files stored on your directory $ cat <argument> examines the content based on arguments found on the file
Working with Files (cont.) wc <argument> counts the number of words in the argument: -l counts only the number of files contained -c counts the number of characters in a file -w counts the number of words in a file
Working with Files (cont.) cp <source> <destination> copies the file from the <source> to <destination> mv <source> <destination> used to rename a file rm <argument> used to remove a file from the system
Directories
Directories (cont.)
Directories (cont.)
Working with Directories $ pwd prints the current working directory $ cd <argument> moves you to the directory in the argument $ cd.. takes you one level up to the file system
Working with Directories (cont.) $ cd <directory>/<directory> will take you to the directory specified $ cd../.. will take you two levels down the system $ mkdir <argument> creates a directory in the file system
Working with Directories (cont.) $ ln <from> <to> links to files together; will not occupy twice as much disk space; will carry the changes created in one file to the other file.
Working with Directories (cont.) $ rmdir <path> Removes the specified directory; directory should not contain any files before it can be removed
File Name Substitution * The asterisk One powerful feature of UNIX is using the asterisk. Example: cat file1 file2 file3 = cat *
Matching Characters ? The Question Mark The question mark is used to match the number of characters in the file Example: echo??
The Brackets [!0] – not zero [!a-z] – not a-z [a-np-z]* - all files except 0
Thank You Any questions?