Download presentation
Presentation is loading. Please wait.
Published byTania Lummis Modified over 9 years ago
1
CSE1222: Unix IntroThe Ohio State University1
2
Common Directory Commands lsList directory contents cd {dir}Change working directory to {dir} pwdPrint working directory mkdirMake a new directory rmdir {dir}Delete directory {dir} CSE1222: Unix IntroThe Ohio State University2
3
Example > cd lab1 > pwd /home/3/yourusername/lab1 > ls a.out first.cppfirst.cpp~ > cd > pwd /home/3/yourusername CSE1222: Unix IntroThe Ohio State University3
4
Example > cd > pwd /home/3/yourusername > mkdir lab2 > cd lab2 > pwd /home/3/yourusername/lab2 > ls > CSE1222: Unix IntroThe Ohio State University4
5
Common File Commands cp {f1} {f2}Copy file {f1} into {f2} mv {f1} {f2}Move file {f1} to {f2} rm {f1}Delete file {f1} g++ {f1} Compile C++ file {f1} using g++ compiler. CSE1222: Unix IntroThe Ohio State University5
6
Example > cd > pwd /home/3/yourusername > mkdir lab2 > cp lab1/first.cpp lab2/second.cpp > cd lab2 > ls second.cpp > CSE1222: Unix IntroThe Ohio State University6
7
Example > cd lab2 > ls second.cpp > g++ second.cpp > ls a.outsecond.cpp > rm a.out > ls second.cpp > CSE1222: Unix IntroThe Ohio State University7
8
More File Commands more {f1}View file {f1} less {f1}View file {f1} emacs {f1}Edit file {f1} using emacs lp –d lj_cl_112_a {f1} Print file {f1} on printer lj_cl_112_a. CSE1222: Unix IntroThe Ohio State University8
9
More Unix Commands control-CInterrupt a program or command control-ZSuspend a program bgPlace suspended program in background. fgPlace suspended program in foreground. jobsList background programs. CSE1222: Unix IntroThe Ohio State University9
10
Example of Background Jobs > emacs first.cpp & [1] 29943 > jobs [1] + Running emacs first.cpp > emacs second.cpp & [2] 29945 > jobs [1] + Runningemacs first.cpp [2] – Runningemacs second.cpp CSE1222: Unix IntroThe Ohio State University10
11
Example of Background Jobs > jobs [1] + Runningemacs first.cpp [2] – Runningemacs second.cpp > fg emacs first.cpp Suspended > bg [1] emacs first.cpp & CSE1222: Unix IntroThe Ohio State University11
12
emacs Example > emacs first.cpp g++ first.cpp CSE1222: Unix IntroThe Ohio State University12
13
emacs Example > emacs first.cpp g++ first.cpp ls CSE1222: Unix IntroThe Ohio State University13
14
emacs Example > emacs first.cpp g++ first.cpp ls Why won’t my computer respond? What’s wrong? CSE1222: Unix IntroThe Ohio State University14
15
emacs Example > emacs first.cpp g++ first.cpp ls Why won’t my computer respond? What’s wrong? Please help me Mr. Instructor. CSE1222: Unix IntroThe Ohio State University15
16
emacs Example Either: Use the ‘&’ to place the emacs program in background, i.e.: > emacs first.cpp & [1] 29943 > Or: Close the emacs window before issuing any other commands. > emacs first.cpp > CSE1222: Unix IntroThe Ohio State University16
17
List of Common Unix Commands lsList directory contents cd {dir}Change working directory to {dir} pwdPrint working directory mkdirMake a new directory rmdir {dir}Delete directory {dir} cp {f1} {f2}Copy file {f1} into {f2} mv {f1} {f2}Move file {f1} to {f2} rm {f1}Delete file {f1} g++ {f1}Compile C++ file {f1} using g++ compiler more {f1}View file {f1} less {f1}View file {f1} emacs {f1}Edit file {f1} using emacs lp –d lj_cl_112_a {f1}Print file {f1} on printer lj_cl_112_a control-CInterrupt a program/command control-ZSuspend a program bgPlace suspended program in background. fgPlace suspended program in foreground. jobsList background programs. CSE1222: Unix IntroThe Ohio State University17
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.