Class Notes (996,751)
US (388,650)
U of M (6,540)
ENGR (63)
ENGR 101 (52)
Lecture 13

ENGR 101 Lecture Notes - Lecture 13: Working Directory, Root Directory, Gedit

2 Pages
28 Views
Fall 2017

Department
Engineering
Course Code
ENGR 101
Professor
Jeffrey Ringenberg
Lecture
13

This preview shows half of the first page. Sign up to view the full 2 pages of the document.
The$command$line$is$a$text$interface$for$the$computer's$operating$system.$To$access$
command$line,$we$use$the$terminal.$
A$filesystem$organizes$a$computer's$files$and$directories$into$a$tree$structure.$It$starts$
with$the$root$directory.$Each$parent$directory$can$contain$more$child$directories$and$
files.$
Pwd$outputs$the$name$of$the$current$working$directory.$
Ls$lists$all$files$and$directories$in$the$working$directory.$
Cd$switches$you$into$the$directory$you$specify.$
Mkdir$creates$a$new$directory$in$the$working$directory.
Touch$creates$a$new$file$inside$the$working$directory.$
From$the$command$line,$you$can$navigate$through$files$and$folders$on$your$computer.$
-a$lists$all$contents,$including$hidden$files$and$directories.$
1.
Number$of$hard$links.$
2.
The$username$of$the$file's$owner.$
3.
The$name$of$the$group$that$owns$the$file$\.
4.
The$size$of$the$file$in$bytes.
5.
The$date$&$time$that$the$file$was$last$modified.
6.
The$name$of$the$file$or$directory.
7.
The$columns'$meanings:
-l$lists$all$contents$of$a$directory$in$long$format.$
-t$order$files$and$directories$by$the$time$they$were$last$modified.$
-alt$lists$all$contents,$including$hidden$files$and$directories,$in$long$format,$
ordered$by$the$date$and$time$they$were$last$modified.$
To$copy$a$file$into$a$directory,$use$cp$with$the$source$file$as$the$first$
argument$and$the$destination$directory$as$the$second$argument.$
The$cp$command$copied$files$or$directories.$
-a$is$an$option$that$modifies$the$behavior$of$the$ls$command.$It$lists$the$files$and$
directories$starting$with$a$dot.$
M*.txt$selects$all$files$in$the$working$directory$starting$with$"m"
Ex.$
*selects$all$files$in$the$working$directory
We$can$use$special$characters$to$select$ groups$of$files.$
The$mv$command$moves$files.$To$move$files$into$a$directory,$use$mv$with$the$source$
file$as$the$first$argument$and$the$destination$directory$as$the$second$argument.$
To$rename$a$file,$use$mv$with$the$old$file$as$the$first$argument$and$the$new$file$as$the$
second$argument.$
The$rm$command$deletes$files$and$directories.$-r$is$used$to$delete$a$directory$and$all$
of$its$child$directories.$
To$compile$(translate$the$program)$a$program:$g++$<input$filw$with$.cpp$extension>$-o$
<output$file$name>
To$execute$ (run$the$program):$./$<output$file$name>
Gedit$filename$opens$the$file$
Command'Line
Monday,$October$30,$2017
3:15$PM

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
Command Line Monday, October 30, 2017 3:15 PM The command line is a text interface for the computer's operating system. To access command line, we use the terminal. A filesystem organizes a computer's files and directories into a tree structure. It starts with the root directory. Each parent directory can contain more child directories and files. From the command line, you can navigate through files and folders on your computer. Pwd outputs the name of the current working directory. Ls lists all files and directories in the working directory. Cd switches you into the directory you specify. Mkdir creates a new directory in the working directory. Touch creates a new file inside the working directory. -a is an option that modifies the behavior of the ls command. It lists the files and directories starting with a dot. -a lists all contents, including hidden files and directories. -l lists all contents of a directory in long format. The columns' meanings: 1. Access rights. 2. Number of hard links. 3. The username of the file's owner. 4. The name of the group that owns the file \ 5. The size of the file in bytes. 6. The date & time that the file was last modified. 7. The name of the file or directory. -t order files and directories by the time they were last modified. -alt lists all contents, including hidden files and directories, in long format, ordered by the date and time they were last modified. The cp command copied files or directories. To copy a file into a directory, use cp with the source file as the first argument and the destination directory as the second argument. We can use special characters to select groups of files. ordered by the date and time they were last modified. The cp command copied files or directories. To copy a file into a directory, use cp with the source file as the first argument and the destination directory as the second argument. We can use special characters to select groups of files. *selects all files in the working directory Ex. M*.txt selects all files in the working directory starting with "
More Less
Unlock Document
Start your 2 week free trial

Only half of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
Start your 2 week free trial
You're Reading a Preview

Unlock to view full version

Unlock Document
Start your 2 week free trial

Share with your friends

Get 2 friends to sign-up for a free trial as well, and get an additional free week

Next

You've reached the limit of 4 previews this month

Create an account for unlimited previews.

Already have an account?

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit