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
Q

command moves file chap3 to manual/chap3

A

mv chap3 manual

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

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.

A

mv chap4 jim/chap5 /home/manual

27
Q

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.

A

mv manual/* .

28
Q

list command or description

A

man

29
Q

delete everything that starts with chap

A

rm chap*

30
Q

delete everything that ends with .jpg

A

rm *.jpg

31
Q

name the three types of right owners

A

user
group
other

32
Q

what is User

how to change it

A

the owner/creator of the file

sudo chown new-owner filename

33
Q

what is Group

how to change it

group: new group
filename: file to change his group

A

contains multiple users/owners

sudo chgrp group filename

34
Q

show AAA.txt text file with line numbers

A

cat -n AAA.txt

35
Q

show AA.txt file while specififying numbers of lines

number of lines 5 for example going from the head

A

cat -n AA.txt | head -5

36
Q

show multiple text files

A

cat file1.txt; file2.txt;

37
Q

create a file with cat

A

cat >file1.txt

38
Q

show more or less when content is too much

A

cat song.txt | more

cat song.txt | less

39
Q

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?$
$
A

cat -e test.txt

40
Q

Redirecting/cut Multiple Files Contain in a Single File

A

cat test1 test2 test3 > test

41
Q

redirect one file to another one

A

cat test > test1

existing contents of the test1 will be overwritten by the contents of the test file.

42
Q

copier contenu de test.txt et le coller à la fin de test1.txt

A

cat test.txt&raquo_space; test1.txt

43
Q

supprimer avec confirmation le fichier AA.txt

resultat: remove regular file?y

A

rm -i AA.txt

44
Q

commande pour changer en administrateur

A

root

45
Q

comment ajouter et supprimer un utilisateur

A

deluser X

adduser X

46
Q

comment ouvrir un utilisateur X

A

su X

et ecrire le mdp

47
Q

comment modifier la date de modification d’un fichier X

et si X n’existe pas, elle creer un fichier vide nommé X

A

touch X

48
Q

comment chercher les dossier .jpg

A

locate .jpg

49
Q

comment fair eune mise a jour dans linux et telecharger une commande comme locate

A

sudo apt-get update

sudo apt install mlocate

50
Q

comment trouver tous les fichier qui surpassent par exemple 10megabytes

A

find -size +10M

51
Q

comment trouver les fichiers inferieur à 1mega dans la directoire DD

A

find DD -type f -size -1

52
Q

chercher toutes les directoires dans home

A

find ~ -type d

53
Q

quels sont les droits des fichiers

A

r: lecture/copier
w: ecriture
x: execution

54
Q

chercher fichiers jpg dans directoire DD

A

find DD/*.jpg -type -f

55
Q

comment changer les droits

A
3 méthodes
sudo chmod u-w+x,g-w+x,o+w 
chmod 556  (methode de binaire et d'addition)
56
Q

calculer les droits par défaut
pour 002
umask 002
valeur par défaut 666

A

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
Q

afficher les lignes ou le mot “linux” apparait dans os.txt

A

grep -i linux os.txt

58
Q

compter exactemement l’occurence en etant sensible au majuscule

A

grep -c linux os.tx

59
Q

compter exactemement l’occurence sans être sensible au majuscules

A

grep -c -i linux os.txt

60
Q

afficher les lignes dans tous les fichiers qui contienne linux

A

grep -i linux *

61
Q

afficher ou existe le mot linux

A

grep -l linux *

62
Q

afficher les fichiers qui contiennent linux

A

grep -i -l linux *

63
Q

afficher les lignes et leurs nombres qui contiennent linux

A

grep -i -n linux *