Sem I (Prak Grund Infor) - N4 Flashcards
What Bash Kommand “grep” do?
Search text or search for patterns within files
Bash Kommand to start with
Find all lines in a text file that start with the word "hello" grep "^hello" file.txt
Quickly replace a string in a previous command and execute it ^old_string^new_string
Das Bash-Linux-Kommando die normalerweise mit dem find-Befehl verwendet, um eine Aktion auf Dateien auszuführen, die durch das find-Kommando gefunden wurden.
-exec
find /pfad/zum/verzeichnis -name "dateiname" -exec rm {} \; Die {} wird durch den Dateinamen ersetzt, und \; gibt das Ende des -exec-Befehls an.
Was macht folgendes regular expression “?”
Matching zero or one occurrence
Was macht folgendes Bash Kommand “echo $PPID”
PID des Parent
Was macht folgendes Linux Bash Kommand: echo -e
Wird verwendet, um Text auszugeben und spezielle Escape-Sequenzen innerhalb des Textes zu interpretieren. ZB. \n und \t
echo -e "Zeile 1\nZeile 2" Zeile 1 Zeile 2
Что такое Gleitkommazahlen
Это числа с плавающей запятой. Числа с плавающей запятой - это вид числового представления, используемого в информатике для представления широкого диапазона реальных чисел. Например: 1,2345 * 10^2
How to much whitespace in Linux Bash Regular expression?
[[:space:]]
Linux Bash Regular Expression to much alphanumeric Characters
[[:alnum:]]
What zcat command in Linux Bash do?
Used to view the contents of compressed files without actually decompressing them.
How to view the contents of compressed files without actually decompressing them in Linux Bash?
zcat
What following Bash Linux command do: "cat countries.txt <(echo ---------) countries_1.txt"
The string “———” is inserted (as if it were the contents of a file).
USA Canada Mexico --------- France Germany Italy
What linux bash command cut do?
Used to extract sections from each line of input, typically from files or from standard input.
Extract by Byte Position cut -b 1-4 filename
How to extract sections from each line of input, typically from files or from standard input?
cut
What “cut -b” command do?
Extract sections from each line of input
-b (bytes): Select only these bytes from each line.
cut -b 1-4 filename This command extracts the first 4 bytes from each line of the file filename.
What “cut -c” command do?
Extract sections from each line of input
-c (characters): Select only these characters from each line.
cut -c 1-4 filename This command extracts the first 4 characters from each line of the file filename.
What “cut -d” command do?
Extract sections from each line of input
-d (delimiter): Specify a delimiter that separates fields (default is tab).
cut -d ':' -f 1,3 filename This command uses the colon : as a delimiter and extracts the first and third fields from each line of the file filename.
What “cut -f” command do?
Extract sections from each line of input
-f (fields): Select only these fields, separated by the delimiter.
John,Doe,30,Engineer Jane,Smith,25,Doctor Jim,Brown,22,Teacher cut -d ',' -f 1,3 data.txt -d ',': Sets the delimiter to a comma. -f 1,3: Specifies that we want to extract the 1st and 3rd fields. Output: John,30 Jane,25 Jim,22
How to sort file for Example alphabetical using Linux Bash?
sort filename
What “sort filename” command in Linux Bash do?
This command sorts the lines of the file filename in alphabetical order.