Labels

Monday, October 10, 2011

Operating File and Directory Structure in Ubuntu

Experiment 1: Directory
1.Melihat HOME directory
$ pwd
$ Echo $ HOME

2. view current directory and parent directory
$ pwd
$ Cd.
$ pwd
$ Cd ..
$ pwd
$ cd

3.make one directory, more than one directory or sub directory
$ pwd
$ Mkdir A B C A / D A / E B / F A / D / A
$ Ls-l
$ Ls-l A
$ Ls-l A / D

4. Remove one or more directories can only be done on an empty directory and can only be removed by the owner unless it is granted permission to access
$ Rmdir B (There is an error, why?)
$ Ls-l B
$ Rmdir B / F B
$ Ls-l B (There is an error, why?)

5.Navigasi directory with cd instructions to move from one directory to another directory.
$ pwd
$ Ls-l
$ Cd A
$ pwd
$ Cd ..
$ pwd
$ Cd / home / <user> / C
$ pwd
$ Cd / <user / C (There is an error, why?)
$ pwd



Experiment 2: Manipulation of the file
1.Perintah cp to copy files or entire directories
$ Cat> example
Creating a file
[Ctrl-d]
$ Cp examples example 1
$ Ls-l
$ Cp sample A
$ Ls-l A
$ Cp examples example 1 A / D
$ Ls-l A / D

2.Perintah mv to move files
$ Mv example contoh2
$ Ls-l
$ Mv example 1 contoh2 A / D
$ Ls-l A / D
$ Mv example example 1 above C
$ Ls-l C

3.Command rm to delete files
$ Rm contoh2
$ Ls-l
$ Rm-i example
$ Rm-rf A C
$ Ls-l

Experiment 3: Symbolic Link
1.Make shortcut (file link)
$ Echo "Hello, what Mr. Mouse"> halo.txt
$ Ls-l
$ Ln z halo.txt
$ Ls-l
$ Cat z
$ Mkdir mydir
$ Ln z mydir / halo.juga
$ Cat mydir / halo.juga
$ Ln-s z bye.txt
$ Ls-l bye.txt
$ Cat bye.txt


Experiment 4: Viewing File Contents
$ Ls-l
$ File halo.txt
$ File bye.txt

Experiment 5: Search for files
1.Commend find
$ Find / home-name "*. txt"-print> myerror.txt
$ Cat myerror.txt
$ Find. -Name "*. txt"-exec wc-l '{}' ';'

2.Perintah the which
$ The which ls

3.Perintah locate
$ Locate "*. txt"


Experiment 6: Search for text in files
$ Grep Hallo *. txt

0 comments

Post a Comment