Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

Similar documents
First derivative analysis

priority queue ADT heaps 1

Homework #3. 1 x. dx. It therefore follows that a sum of the

Higher order derivatives

Search sequence databases 3 10/25/2016

Section 11.6: Directional Derivatives and the Gradient Vector

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

UNTYPED LAMBDA CALCULUS (II)

Status of LAr TPC R&D (2) 2014/Dec./23 Neutrino frontier workshop 2014 Ryosuke Sasaki (Iwate U.)

Basic Polyhedral theory

Strongly Connected Components

Final Exam Solutions

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012

CPE702 Algorithm Analysis and Design Week 11 String Processing

perm4 A cnt 0 for for if A i 1 A i cnt cnt 1 cnt i j. j k. k l. i k. j l. i l

y = 2xe x + x 2 e x at (0, 3). solution: Since y is implicitly related to x we have to use implicit differentiation: 3 6y = 0 y = 1 2 x ln(b) ln(b)

CS 361 Meeting 12 10/3/18

Addition of angular momentum

Indexed Search Tree (Trie)

Image Filtering: Noise Removal, Sharpening, Deblurring. Yao Wang Polytechnic University, Brooklyn, NY11201

1 Minimum Cut Problem

GEOMETRICAL PHENOMENA IN THE PHYSICS OF SUBATOMIC PARTICLES. Eduard N. Klenov* Rostov-on-Don, Russia

That is, we start with a general matrix: And end with a simpler matrix:

Problem Set 6 Solutions

As the matrix of operator B is Hermitian so its eigenvalues must be real. It only remains to diagonalize the minor M 11 of matrix B.

Basic Logic Review. Rules. Lecture Roadmap Combinational Logic. Textbook References. Basic Logic Gates (2-input versions)

Objective Mathematics

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA

ECE602 Exam 1 April 5, You must show ALL of your work for full credit.

What are those βs anyway? Understanding Design Matrix & Odds ratios


Math 34A. Final Review

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

Unit 6: Solving Exponential Equations and More

Week 3: Connected Subgraphs

A central nucleus. Protons have a positive charge Electrons have a negative charge

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

(Upside-Down o Direct Rotation) β - Numbers

Chapter 6 Folding. Folding

Association (Part II)

Need to understand interaction of macroscopic measures

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages:

Pair (and Triplet) Production Effect:

Abstract Interpretation: concrete and abstract semantics

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH.

Hydrogen Atom and One Electron Ions

The Transmission Line Wave Equation

International Journal of Foundations of Computer Science c World Scientic Publishing Company Searching a Pseudo 3-Sided Solid Orthoconvex Grid ANTONIO

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Addition of angular momentum

Quasi-Classical States of the Simple Harmonic Oscillator

Pipe flow friction, small vs. big pipes

Collisions between electrons and ions

2008 AP Calculus BC Multiple Choice Exam

INTEGRATION BY PARTS

Background: We have discussed the PIB, HO, and the energy of the RR model. In this chapter, the H-atom, and atomic orbitals.

Physics in Entertainment and the Arts

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

Direct Approach for Discrete Systems One-Dimensional Elements

4. (5a + b) 7 & x 1 = (3x 1)log 10 4 = log (M1) [4] d = 3 [4] T 2 = 5 + = 16 or or 16.

cycle that does not cross any edges (including its own), then it has at least

Lenses & Prism Consider light entering a prism At the plane surface perpendicular light is unrefracted Moving from the glass to the slope side light

EEO 401 Digital Signal Processing Prof. Mark Fowler

ORDER OF PLAY START OF ROUND

10. EXTENDING TRACTABILITY

The Frequency Response of a Quarter-Wave Matching Network

SCALING OF SYNCHROTRON RADIATION WITH MULTIPOLE ORDER. J. C. Sprott

(1) Then we could wave our hands over this and it would become:

Computing and Communications -- Network Coding

Slide 1. Slide 2. Slide 3 DIGITAL SIGNAL PROCESSING CLASSIFICATION OF SIGNALS

Mathematics. Complex Number rectangular form. Quadratic equation. Quadratic equation. Complex number Functions: sinusoids. Differentiation Integration

Math-3. Lesson 5-6 Euler s Number e Logarithmic and Exponential Modeling (Newton s Law of Cooling)

The Matrix Exponential

EEO 401 Digital Signal Processing Prof. Mark Fowler

CLONES IN 3-CONNECTED FRAME MATROIDS

4. Money cannot be neutral in the short-run the neutrality of money is exclusively a medium run phenomenon.

From Elimination to Belief Propagation

Alpha and beta decay equation practice

ECE 344 Microwave Fundamentals

3 Finite Element Parametric Geometry

Derivation of Electron-Electron Interaction Terms in the Multi-Electron Hamiltonian

Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover

The Matrix Exponential

There is an arbitrary overall complex phase that could be added to A, but since this makes no difference we set it to zero and choose A real.

EXST Regression Techniques Page 1

SCHUR S THEOREM REU SUMMER 2005

Chapter 8: Electron Configurations and Periodicity

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

Linked-List Implementation. Linked-lists for two sets. Multiple Operations. UNION Implementation. An Application of Disjoint-Set 1/9/2014

Physical Organization

Applied Statistics II - Categorical Data Analysis Data analysis using Genstat - Exercise 2 Logistic regression

surface of a dielectric-metal interface. It is commonly used today for discovering the ways in

DIFFERENTIAL EQUATION

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

Lecture 37 (Schrödinger Equation) Physics Spring 2018 Douglas Fields

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C

Transcription:

m E x. N o. 3 F I L E M A N A G E M E N T Aim To manag ils and dirctoris using Linux commands. I. F i l M a n a g m n t 1. il Examins th typ o th givn il or dirctory i l i l n a m > ( o r ) < d i r c t o r y n a m. > < 2. pwd Displays th currnt working dirctory p w d 3.cat Displays a il. It can tak ilnams or its argumnts. It outputs th contnts o thos ils dirctly to th standard output, which, by dault, is dirctd to th scrn. c a t < i l n a m > 4. mor Displays a il scrn by scrn. th SPACEBAR is prssd to continu to th nxt scrn and q to quit. o r i l n a m > < 5.lss Displays a il scrn by scrn. Prss th SPACEBAR to continu to th nxt scrn and q to quit. l s s < i l n a m s > 6.cmp

Compar two ils byt by byt c m p [ O P T I O N ]... F I L E 1 [ F I L E 2 [ S K I P 1 [ S K I P 2 ] ] ] - b - - p r i n t - b y t s - i S K I P - - i g n o r - i n i t i a l = S K I P Print diring byts. - i S K I P 1 : S K I P 2 - - i g n o r - i n i t i a l = S K I P 1 : S K I P 2 Skip th irst SKIP byts o input. Skip th irst SKIP1 byts o FILE1 and th irst SKIP2 byts o FILE2. - l - - v r b o s Output byt numbrs and valus o all diring byts. - n L I M I T - - b y t s = L I M I T Compar at most LIMIT byts. 7. cut Prints slctd parts o lins rom ach FILE to standard output. c u t [ O P T I O N ]... [ F I L E ]... - b, - - b y t s = L I S T - c, - - c h a r a c t r s = L I S T - d, - - d l i m i t r = D E L I M dlimitr Slcts only ths byts Slcts only ths charactrs Us DELIM instad o TAB or ild 8.di Shows th dirncs btwn ils.

d i [ O P T I O N ]... F I L E S Options - i - - i g n o r - c a s - - i g n o r - i l - n a m - c a s - - n o - i g n o r - i l - n a m - c a s Ignor cas dirncs in il contnts. Ignor cas whn comparing il nams. - E - - i g n o r - t a b - x p a n s i o n - b - - i g n o r - s p a c - c h a n g - w - - i g n o r - a l l - s p a c - B - - i g n o r - b l a n k - l i n s - I R E - - i g n o r - m a t c h i n g - l i n s = R E Considr cas whn comparing il nams. Ignor changs du to tab xpansion. whit spac. Ignor changs in th amount o Ignor all whit spac. blank. Ignor changs whos lins ar all - - s t r i p - t r a i l i n g - c r - a - - t x t - q - - b r i - - n o r m a l Ignor changs whos lins all match RE. Strip trailing carriag rturn on input. Trat all ils as txt. Output only whthr ils dir. Output a normal di. 9.slp Paus or NUMBER sconds. SUFFIX may b s or sconds (th dault), m or minuts, h or hours or d or days. Unlik most implmntations that rquir NUMBER b an intgr, hr NUMBER may b an arbitrary loating point numbr

E s l p N U M B E R [ S U F F I X ]... 10. sort Writ sortd concatnation o all FILE(s) to standard output s o r t [ O P T I O N ]... [ F I L E ]... Ordring options: - b, - - i g n o r - l a d i n g - b l a n k s - d, - - d i c t i o n a r y - o r d r alphanumric charactrs -, - - i g n o r - c a s charactrs - g, - - g n r a l - n u m r i c - s o r t ignor lading blanks considr only blanks and old lowr cas to uppr cas compar according to gnral numrical valu - i, - - i g n o r - n o n p r i n t i n g considr only printabl charactrs - M, - - m o n t h - s o r t compar (unknown) < JAN <... < DEC - n, - - n u m r i c - s o r t compar according to string numrical valu - r, - - r v r s rvrs th rsult o comparisons Othr options: - c, - - c h c k chck whthr input is sortd; do not sort - k, - - k y = P O S 1 [, P O S 2 ] start a ky at POS1, nd it at POS2 (origin 1) - m, - - m r g mrg alrady sortd ils; do not sort - o, - - o u t p u t = F I L E writ rsult to FILE instad o standard output - s, - - s t a b l stabiliz sort by disabling last-rsort comparison - S, - - b u r - s i z = S I Z us SIZE or main mmory bur - t, - - i l d - s p a r a t o r = S E P us SEP instad o non-blank to blank transition - T, - - t m p o r a r y - d i r c t o r y = D I R us DIR or tmporaris, not $TMPDIR or /tmp; multipl options spciy multipl dirctoris - u, - - u n i q u with -c, chck or strict ordring; without -c, output only th irst o an qual run

- z, - - z r o - t r m i n a t d nd lins with 0 byt, not nwlin 11.uniq Rports or omits rpatd lins. Discards all but on o succssiv idntical lins rom INPUT (or standard input), writing to OUTPUT (or standard output). u n i q [ O P T I O N ]... [ I N P U T [ O U T P U T ] ] - c, - - c o u n t prix lins by th numbr o occurrncs - d, - - r p a t d only print duplicat lins - D, - - a l l - r p a t d [ = d l i m i t - m t h o d ] d l i m i t print all duplicat lins - m t h o d = { n o n ( d a u l t ), p r p n d, s p a r a t } -, - - s k i p - i l d s = N ilds - i, - - i g n o r - c a s comparing - s, - - s k i p - c h a r s = N charactrs - u, - - u n i q u - w, - - c h c k - c h a r s = N in lins dlimiting is don with blank avoid comparing th irst N ignor dirncs in cas whn avoid comparing th irst N only print uniqu lins compar no mor than N charactrs 12.wc Print nwlin, word, and byt counts or ach FILE, and a total lin i mor than on FILE is spciid. With no FILE, or whn FILE is -, rad standard input. w c c / w / l < i l n a m >

. d Options - c, - - b y t s - m, - - c h a r s - l, - - l i n s - L, - - m a x - l i n - l n g t h - w, - - w o r d s print th byt counts print th charactr counts print th nwlin counts print th lngth o th longst lin print th word counts I I D i r c t o r y M a n a g m n t 1. Crating and Dlting Dirctoris m k d i r d i r c t o r y r m d i r d i r c t o r y l s - F l s - R subdirctoris. c d d i r c t o r y n a m Crats a dirctory. Erass a dirctory. Lists dirctory nam with a prcding slash Lists working dirctory as wll as all Changs to th spciid dirctory, making it th working dirctory. cd without a dirctory nam changs back to th hom dirctory. p w Displays th pathnam o th working dirctory. d i r c t o r y n a m / i l n a m A slash is usd in pathnams to sparat ach dirctory nam. In th cas o pathnams or ils, a slash sparats th prcding dirctory nams rom th ilnam... Rrncs th parnt dirctory. It can b usd as an argumnt or as part o a pathnam ~ / p a t h n a m Rrncs th working dirctory. You can us it l s. as an argumnt or as part o a pathnam: $ Th tild is a spcial charactr that rprsnts th pathnam or th hom dirctory. It is usul whn an absolut pathnam or a il or diirctory is ndd. $ cp monday ~/today 2.ls Displays dirctory contnts

C d L s 3.ls -F To distinguish btwn il and dirctory nams, howvr, ls command is usd with th -F option. A slash is thn placd atr ach dirctory nam in th list. l s F 4.ls -R Th command lists working dirctory as wll as all subdirctoris. l s - R 5.cd Usd to mov through Dirctoris I I I D i r c t o r y O p r a t i o n s 1.ind Sarchs dirctoris or ils according to sarch critria. i n d d i r c t o r y - l i s t o p t i o n c r i t r i a. - n a m p a t t r n - l n a m p a t t r n - g r o u p n a m - g i d n a m group ID. Sarchs or ils with pattrn in th nam. Sarchs or symbolic link ils. Sarchs or ils blonging to th group nam. Sarchs or ils blonging to a group according to

- u s r n a m - u i d n a m usr ID. - s i z n u m c addd atr sarchd or. - m t i m n u m - p r i n t Sarchs or ils blonging to a usr. Sarchs or ils blonging to a usr according to Sarchs or ils with th siz num in blocks. I c is num, th siz in byts (charactrs) is Sarchs or ils last modiid num days ago. Outputs th rsult o th sarch to th standard output. Th rsult is usually a list o ilnams, including thir ull pathnams. - t y p i l t y p Sarchs or ils with th spciid il typ. Fil typ can b b or block dvic, c or charactr dvic, d or dirctory, or il, or l or symbolic link. - p r m p r m i s s i o n Sarchs or ils with crtain prmissions st. Us octal or symbolic ormat or prmissions. I V F i l o p r a t i o n s c p Copis a il. cp taks two argumnts: th original il and th ilnam ilnam nam o th nw copy. Th pathnams can b usd or th ils to copy across dirctoris: $ cp today rports/monday c p - r d i r n a m d i r n a m Copis a subdirctory rom on dirctory to anothr. Th copid dirctory includs all its own subdirctoris: $ cp -r lttrs/thankyou oldlttrs m v i l n a m i l n a m Movs (rnams) a il. Th mv command taks two argumnts: th irst is th il to b movd. Th scond argumnt can b th nw ilnam or th pathnam o a dirctory. I it is th nam o a dirctory, thn th il is litrally movd to that dirctory, changing th il s pathnam: $ mv today /hom/chris/rports m v d i r n a m d i r n a m Movs dirctoris. In this cas, th irst and last argumnts ar dirctoris: $ mv lttrs/thankyou oldlttrs

l n i l n a m i l n a m Crats addd nams or ils rrrd to as links. A link can b cratd in on dirctory that rrncs a il in anothr dirctory: $ ln today rports/monday r m i l n a m s Rmovs (rass) a il. Can tak any numbr o ilnams as its argumnts. Rmovs links to a il. I a il has mor than on link, you nd to rmov all o thm to ras a il: $rm today wathr wknd 3. Symbolic link To st up a symbolic link, th ln command is usd with th -s option and two argumnts: th nam o th original il and th nw, addd ilnam. Th ls opration lists both ilnams, but only on physical il will xist. l n - s o r i g i n a l - i l - n a m a d d d - i l - n a m 4. Hard link To st up a hard link, you us th ln command with no -s option and two argumnts: th nam o th original il and th nw, addd ilnam. Th ls opration lists both ilnams, but only on physical il will xist. l n o r i g i n a l - i l - n a m a d d d - i l - n a m