Professional Documents
Culture Documents
Linux
Linux
Part one :
1.) Draw the directories structure ans indicate the number of directory level :
2.) Create the subdirectories of ODILI directory with one command line
~$ mkdir OBI
~$ mkdir MUSA
~$ mkdir MUSA/EDNA
~$ mkdir MUSA/ELSI
~$ mkdir JOHN
~$ mkdir JOHN/COCO
~$ mkdir NANGA
~$ mkdir NANGA/ACHEBE
~$ mkdir NANGA/CYPRIAN
~$ mkdir NANGA/CYPRIAN/JACK
~$ cd MUSA/EDNA
... EDNA$
Ou
... EDNA$ cd ~/NANGA/CYPRIAN/JACK
... JACK$
... CYPRIAN$
Ou
... JACK$ cd ..
... CYPRIAN $
... ACHEBE$
8.) Create with command cat a file that contains the sentence “ ODILI has a
monkey ” and name that file “monkey”
9.) Copy the monkey file in your login directory and name it “ domestic ”.
... ACHEBE$
... ACHEBE$
... ACHEBE$ cd
~$ mv ~/NANGA/CYPRIAN ~/MUSA
~$
Part two :
It's used also to display the content of essai.txt but create a space without the last
line and the file’s content.
It's used to add the content to file essai.txt if it's created before, otherwise the file
will be created.
In which directory am I ?
~$ pwd
I copy the file /etc/passwd in the current directory and I name the copy
mot_de_passe.
$ cp /etc/passwd ~/mot_de_passe
I copy the files /etc/group and /etc/profile in the current directory, I preserve the
original name.
~$ cp -r /etc/group /etc/profile ~
~$ ls
~$ ls -l
Display the first lines of the /etc/services file.
~$ head /etc/services
~$ tail /etc/services
Display the lines of the /etc/services file that contain the string ‘’HTTP”
Redirect the result of the command date in the file cal.txt (of question 9) :
- What happened ?
I happened that when we have redirected the result of the command date in the
file cal.txt, the precedent content of this file has deleted.
~$ cd /bin
~/bin$ …
~/bin$ ls a*
~/bin$ ls ?????
We display the commands beginning by w, or by x, or by y, or by z.
~/bin$ ls [wxyz]
~/bin$ ls [!a-v]
~/bin$ cd
~$ …
~$ mkdir reptest
Go to reptest directory :
~$ cd reptest
~/reptest$ …
~/reptest$ ls -ld
Create a file named obi that contains the sentence "echo hy !"
echo hy !
When we display the attributes of obi file, we obtain the following result :
-rw-rw-r--
Can you make that your fellows can execute this file.
~/reptest$ chmod g+x obi
drwxrwxr--
Can you make that the others can delete obi file.
Can you make that your fellows can read and execute this obi file (absolute rights
or permissions).
~/reptest$ ls -i obi
~/reptest$ rm obi
Display the content of reptest. What happened to obi1 and obi2 files ? Explain.
~/reptest$ ls
We happened now that obi1 and obi2 files don't operate. It's because of the fact
that obi1 and obi2 are the links that allow to accede to the content of obi file. But,
obi file has been deleted. Thus, obi1 and obi2 aren't functionnal.
~/reptest$ cd
~$ ...