Linux File System
Linux File System
$ cd doc
/usr/share/doc
$ cd
$ pwd
/home/chris
Commands
$ cd ~
$ pwd
/home/chris
$ cd ~/Music$ pwd
/home/chris/Music
$ cd ../../../usr
$ pwd
/usr
TASK
Go to your home directory.
make sure that you’re in your home directory
Create a new directory called test in your home
directory
Check the permissions of the directory
Make the test directory your current directory
Change the permission of test
directory
$ chmod 700 test
Using Metacharacters and
Operators
■ *—Matches any number of characters.
■ ?—Matches any one character.
■ [...]—Matches any one of the characters
between the brackets, which can include a
hyphen-separated range of letters or numbers.
Using Metacharacters and
Operators
$ touch apple banana grape grapefruit
watermelon
$ ls a*
apple
$ ls g*
grape grapefruit
$ ls g*t
Grapefruit
Using Metacharacters and
Operators
$ ls *e*
apple grape grapefruit watermelon
$ ls *n*
banana watermelon
Using Metacharacters and
Operators
$ ls ????e
apple grape
$ ls g???e*
grape grapefruit
Using Metacharacters and
Operators
$ ls [abw]*
apple banana watermelon
$ ls [agw]*[ne]
apple grape watermelon
Using Metacharacters and
Operators
$ ls [a-g]*
apple banana grape grapefruit
QUESTION1
Create a directory in your home directory called
projects. In the projects directory, create nine
empty files that are named house1, house2,
house3, and so on to house9. Assuming there
are lots of other files in that directory, come up
with a single argument to ls that would list just
those nine files.
QUESTION2
Make the $HOME/projects/houses/doors/
directory path. Create the following empty files
within this directory path (try using absolute and
relative paths from your home directory):
$HOME/projects/houses/bungalow.txt
$HOME/projects/houses/doors/bifold.txt
$HOME/projects/outdoors/vegetation/
landscape.txt
Question 3
Copy the fi les house1 and house5 to the
$HOME/projects/houses/ directory.
chmod(letters)
u->users
g->group
o->others
+->allow permission
-->remove permission
r->read
w->write
x->execute
This work is licensed under a Creative Commons
Attribution-ShareAlike 3.0 Unported License.
It makes use of the works of Mateus Machado Luna.