EGR 103/UNIX Lab
Jump to navigation
Jump to search
This page has some references from the first EGR 103 lab.
Contents
Typos / Changes
- Spring 2019: None Yet!
Items Learned
During the UNIX Demonstration
pwd: print working directory - see where you are in the file systemls: list - see what files, folders, links, and other items are in the directory specified or, if nothing is specified, the current directoryls -a: list all the things, including hidden files whose names begin with a periodls -l: list the additional information about items, such as who owns them and how big they arels -laORls -al: list all the things including the additional information
cd: change directory - move from wherever you are to wherever you need to becdwith no path after it means change to the user's home directory
/is used at the very beginning of a path to indicate that the path is an absolute path from the root of the file system/is used after the name of a folder in a path to indicate that what follows is the name of a folder or a file within that folder~is used at the start of a path as an absolute shortcut for the user's home directory~IDis used at the start of a path as an absolute shortcut for ID's home directory - with CIFS, the only person's directory you can access is you so this is less useful now.is a shortcut meaning the current directory..is a shortcut meaning the directory "above" the current one in the file tree- Combinations of folder names and .. shortcuts may be strung together in any order; generally, any required .. go at the beginning.
While Creating/Using EGR103 Folder
mkdir PATH: creates a new directory. If the PATH is simply a name, the folder is created within the current folder.cp -i SOURCE(S) TARGET: safely copies the files indicated inSOURCE(S)to theTARGET. There are several variations of this:- If
SOURCEis a single file andTARGETis the name of a folder, a duplicate of SOURCE, also namedSOURCE, will be copied into TARGET - If
SOURCEis a single file andTARGETis a name that does not exist yet, a duplicate ofSOURCEwill be made and it will be called TARGETcp -i MyFile.txt ACopyOfMyFile.txt- This will take the data from
MyFile.txtand duplicate it in a file within the current directory to be namedACopyOfMyFile.txt
- This will take the data from
- If
SOURCEScontain several files, the TARGET must be the name of an existing folder. Duplicates of theSOURCESwill be copied into the TARGET and will maintain their original names
- If any of the files
cpwants to make already exist and the-aflag is used,cpwill ask before overwriting a file.
- If
- The
*symbol can be used to make a pattern for finding files; it will replace any number of characters, including no characters.ls /afs/*ath*will list all items in the/afsfolder that haveathsomewhere in the name, regardless of any characters before or after theath