Linux commands Flashcards

1
Q

list

A

ls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

remove

A

rm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

delete empty directories/folders

A

rmdir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

show place

A

pwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

create folder/directory

A

mkdir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

create a directory under another directory

the one to create AA under director BB

A

mkdir AA/BB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

go to XX

A

cd XX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

go to home

A

cd ~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

go back one step before

A

cd..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

home

A

~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

parent folder

A

..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

current folder or place

A

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

list of history of creation and owners and rights of file X

A

ls -l X

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

root

A

/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

edit if a XX text file exists or create it

A

nano XX.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

open a temp space for a text file to name it and save it after done writing

A

nano

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

read text file XX

A

cat XX.text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

get immediately into file ZZ that is in XX that is in home

A

cd ~/XX/ZZ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

clear steps

A

clear

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

remove full directory XX that is not empty step by step

A

rm -rfi XX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

move a X file or directory from A directory to B directory, while B is A’s parent directory

A

mv X ..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

rename a file X to Z

if Z exists it’s a replacement

A

mv X Z

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

command moves all files and directories under book to the directory named manual, if manual exists. Otherwise, the directory book is renamed manual.

A

mv book manual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

command moves intro to manual/chap1. The name intro is removed from the current directory, and the same file appears as chap1 in the directory manual.

A

mv intro manual/chap1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
command moves file chap3 to manual/chap3
mv chap3 manual
26
move several files into one another directory, command moves the chap4 file to the /home/manual/chap4 file directory and the jim/chap5 file to the /home/manual/chap5 file.
mv chap4 jim/chap5 /home/manual
27
use the mv command with pattern-matching characters This command moves all files in the manual directory into the current directory . (period), retaining the names they had in manual. This move also empties manual.
mv manual/* .
28
list command or description
man
29
delete everything that starts with chap
rm chap*
30
delete everything that ends with .jpg
rm *.jpg
31
name the three types of right owners
user group other
32
what is User | how to change it
the owner/creator of the file | sudo chown new-owner filename
33
what is Group how to change it group: new group filename: file to change his group
contains multiple users/owners sudo chgrp group filename
34
show AAA.txt text file with line numbers
cat -n AAA.txt
35
show AA.txt file while specififying numbers of lines | number of lines 5 for example going from the head
cat -n AA.txt | head -5
36
show multiple text files
cat file1.txt; file2.txt;
37
create a file with cat
cat >file1.txt
38
show more or less when content is too much
cat song.txt | more | cat song.txt | less
39
show symbol $ at the end of every line or gap between paragraphs or end of the file example ``` hello everyone, how do you do?$ $ Hey, am fine.$ How's your training going on?$ $ ```
cat -e test.txt
40
Redirecting/cut Multiple Files Contain in a Single File
cat test1 test2 test3 > test
41
redirect one file to another one
cat test > test1 existing contents of the test1 will be overwritten by the contents of the test file.
42
copier contenu de test.txt et le coller à la fin de test1.txt
cat test.txt >> test1.txt
43
supprimer avec confirmation le fichier AA.txt | resultat: remove regular file?y
rm -i AA.txt
44
commande pour changer en administrateur
root
45
comment ajouter et supprimer un utilisateur
deluser X | adduser X
46
comment ouvrir un utilisateur X
su X | et ecrire le mdp
47
comment modifier la date de modification d'un fichier X | et si X n'existe pas, elle creer un fichier vide nommé X
touch X
48
comment chercher les dossier .jpg
locate .jpg
49
comment fair eune mise a jour dans linux et telecharger une commande comme locate
sudo apt-get update | sudo apt install mlocate
50
comment trouver tous les fichier qui surpassent par exemple 10megabytes
find -size +10M
51
comment trouver les fichiers inferieur à 1mega dans la directoire DD
find DD -type f -size -1
52
chercher toutes les directoires dans home
find ~ -type d
53
quels sont les droits des fichiers
r: lecture/copier w: ecriture x: execution
54
chercher fichiers jpg dans directoire DD
find DD/*.jpg -type -f
55
comment changer les droits
``` 3 méthodes sudo chmod u-w+x,g-w+x,o+w chmod 556 (methode de binaire et d'addition) ```
56
calculer les droits par défaut pour 002 umask 002 valeur par défaut 666
determiner la valeur binaire de 002 000000010 et la convertir par la non logique 111111101 666 est egale à 110110110 multiplier bit par bit 110110110 et 111111101 et convertir resultat 110110100 rw-rw-r--
57
afficher les lignes ou le mot "linux" apparait dans os.txt
grep -i linux os.txt
58
compter exactemement l'occurence en etant sensible au majuscule
grep -c linux os.tx
59
compter exactemement l'occurence sans être sensible au majuscules
grep -c -i linux os.txt
60
afficher les lignes dans tous les fichiers qui contienne linux
grep -i linux *
61
afficher ou existe le mot linux
grep -l linux *
62
afficher les fichiers qui contiennent linux
grep -i -l linux *
63
afficher les lignes et leurs nombres qui contiennent linux
grep -i -n linux *