Now you should have two files: file1 and file2. To make a copy of file1 and give it the name file2 (in the current working directory), use: unix> cp file1 file2 highest in the hierarchy) and what is the lowest-level directory? /home/jshafer/ecpe170/project2/src/main.cīefore doing these commands, enter the ecpe170 directory, and create two empty files using the touch command: unix> cd ecpe170 (2) In the following file pathname, what is the top-level directory (i.e. (1) What command would I type to go to the following directory? /home/jshafer/ecpe170/project1/src Download it now, make a copy, and use it to start your report for this lab. You will create a single Lab Report document for each lab.Ī Lab Report template is available. Lab Reports are to be created in OpenOffice (now "LibreOffice"), and submitted in PDF form at the completion of the lab. The full pathname will look something like /home/jshafer which means that jshafer (your home directory) is inside the directory home (the directory containing all user accounts). For example, to find out the absolute pathname of your current directory, use: unix> pwd Pathnames enable you to work out where you are in relation to the whole file system. In Unix systems, the tilde (~) character represents your home directory. To jump back to your home directory (regardless of how deep in the file tree you happen to be), use either of the two following commands: unix> cd Īt this point you should be back in your home directory. To go up one level in the directory tree, use two dots: unix> cd. To change to the directory you have just made, type unix> cd ecpe170 The current working directory may be thought of as the directory you are in, i.e. The command cd directory means change the current working directory to 'directory'. To see the directory you have just created, type unix> ls To make a directory called ecpe170 inside your current working directory, type unix> mkdir ecpe170 List all contents of your current working directory, including hidden files: unix> ls -a To list all files in your home directory including hidden files, use the -a option with the ls command. Hidden files have file names that begin with a dot (.). The ls command does not show hidden files by default. List contents of your current working directory: unix> ls (ls is short for "list") There may be no files visible in your home directory, in which case, nothing will print but the command prompt again. To find out what is in your home directory, use the ls command. Your home directory has the same name as your user-name, for example, vivek, and it is where your personal files and subdirectories are saved. When you first login, your current working directory is your home directory. Thus, it will be constantly changing as you work! To simplify these labs, this is written as "unix>" a combination of your username, computer name, and the current directory you are in. Rather, it might look something like this: i.e. The "unix>" part of the line should not be typed in, and it will not look the same on your computer. Or, you can search for "Terminal" by clicking on the Dash button in the upper-left corner (i.e., the Ubuntu equivalent of the Windows "start" button).įor the rest of this course, commands to enter at the terminal are going to be given in the following format: unix> This is the command that you should enter In Ubuntu, login and launch the command prompt (aka Terminal). (Alternate checkpoint: If you have errors when installing, you must email your instructor a detailed description of the specific error at least 12 hours before the start of class. "I couldn't get it working" is not sufficient.) (1) Submit to the Canvas "Lab 1 Prelab" assignment a screenshot of Ubuntu Linux running on your computer. Reminder to obtain pre-lab credit - due by Thursday's class: The pre-lab is easy, but the download and installation process is too time-consuming to do in class. By the end of the semester the command line should be second nature to you.īring your laptop to class (and to all future labs)īefore the start of this lab, you must complete the Virtual Machine Setup tutorial and build a working Linux system to use. You will build upon these skills for the remainder of the course. This lab is intended to give you a basic introduction to navigating on the command line and performing common tasks. The Linux command line will be used extensively in ECPE 170.
0 Comments
Leave a Reply. |