Skip to content

Commit ca382b7

Browse files
committed
more updates and formatting updates
1 parent b9f74c6 commit ca382b7

File tree

6 files changed

+116
-3
lines changed

6 files changed

+116
-3
lines changed

regex.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,38 @@ I don't know a lot about regex. I don't assume that many people know about how
55
https://regex101.com is your friend.
66

77
A lot of Regex tutorials or even makeshift Regex guides kind of miss the mark.
8+
9+
Here are some basics
10+
11+
Matching Characters:
12+
13+
. (dot): Matches any single character except newline.
14+
[a-z]: Matches any lowercase letter.
15+
[A-Z]: Matches any uppercase letter.
16+
[0-9]: Matches any digit.
17+
\w (word character): Matches any alphanumeric character (a-z, A-Z, 0-9, and underscore).
18+
\s (whitespace): Matches any whitespace character (space, tab, newline).
19+
20+
Quantifiers:
21+
22+
*: Matches zero or more of the preceding element.
23+
+: Matches one or more of the preceding element.
24+
?: Matches zero or one of the preceding element.
25+
{n}: Matches exactly n occurrences of the preceding element.
26+
{m,n}: Matches between m and n occurrences of the preceding element.
27+
28+
Anchors:
29+
30+
^: Matches the beginning of the string.
31+
$: Matches the end of the string.
32+
33+
Grouping:
34+
35+
(): Groups characters for repeated matching or capturing.
36+
37+
Other Symbols:
38+
39+
\d: Matches any digit (equivalent to [0-9]).
40+
\D: Matches any non-digit (opposite of \d).
41+
\b: Matches a word boundary (beginning or end of a word).
42+
\: Escapes the special meaning of a following character.

using-apt.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,31 @@
33
`apt list --upgradable`
44
`apt update`
55
`apt upgrade`
6+
`apt install <package_name>`: Installs a specific package.
7+
`apt remove <package_name>`: Removes a package but keeps configuration files.
8+
`apt purge <package_name>`: Removes a package and all its configuration files.
9+
`apt install -f`: Attempts to fix broken dependencies during installation.
10+
`apt show <package_name>`: Shows detailed information about a package.
11+
`apt depends <package_name>`: Lists the dependencies of a package.
12+
`apt search <keyword>`: Searches for packages based on keywords.
13+
`apt full-upgrade`: Upgrades packages and also removes any outdated packages.
14+
`apt autoremove`: Removes unused dependencies automatically.
15+
`apt clean`: Removes all downloaded package files (.deb).
16+
`apt autoclean`: Removes only outdated downloaded package files, keeping the latest ones.
17+
`apt edit-sources`: Opens the sources.list file for editing repository configurations.
18+
`apt-cache policy <package_name>`: Shows the installation state and available versions of a package.
19+
`apt-cache show <package_name>`: Shows detailed information about a package from the cache.
20+
`apt-get install <package_name>`: Installs a specific package.
21+
`apt-get install -f`: Attempts to fix broken dependencies during installation.
22+
`apt-get install -d <package_name>`: Downloads the package without installing it.
23+
`apt-get remove <package_name>`: Removes a package but keeps configuration files.
24+
`apt-get purge <package_name>`: Removes a package and all its configuration files.
25+
`apt-get upgrad`e: Upgrades all installed packages to the latest versions.
26+
`apt-get dist-upgrade`: Upgrades packages and also removes any outdated packages.
27+
`apt-get show <package_name>`: Shows detailed information about a package.
28+
`apt-get depends <package_name>`: Lists the dependencies of a package.
29+
`apt-get search <keyword>`: Searches for packages based on keywords.
30+
`apt-get update`: Updates the package list with the latest information from repositories.
31+
`apt-get autoremove`: Removes unused dependencies automatically.
32+
`apt-get clean`: Removes all downloaded package files (.deb).
33+
`apt-get autoclean`: Removes only outdated downloaded package files, keeping the latest ones.

using-find-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ My version of find comes from /usr/bin/find /usr/share/man/man1/find.1.gz /usr/s
1515

1616
find -a says `find: invalid expression; you have used a binary operator '-a' with nothing before it.`
1717

18-
find -d says `ind: warning: the -d option is deprecated; please use -depth instead, because the latter is a POSIX-compliant feature.`
18+
find -d says `find: warning: the -d option is deprecated; please use -depth instead, because the latter is a POSIX-compliant feature.`
1919

2020
find -o says `find: invalid expression; you have used a binary operator '-o' with nothing before it.`
2121

using-gcc.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ My gcc is currently in /usr/bin/gcc /usr/lib/gcc and is gcc version 8.3.0 (Debia
77
There are some important flags that can be used with GCC to compile C programs.
88
these were tested by doing each flag individually. These may or may not be documented.
99

10+
using GNU g++ (for C++) may use these same flags as gcc.
11+
1012
### Lowercase flags
1113

1214
`-c` = Might need input files. instructs the compiler to perform a compilation but stop before linking
1315

14-
`-d` = Needs argument(s). can be used several ways. does dissasembly, specifies a directory to search for
16+
`-d` = Needs argument(s). can be used several ways. does disassembly, specifies a directory to search for
1517
header files or provides additional debugging information.
1618

1719
`-e` = Needs argument(s). used to emit preprocessed source code. `gcc -e myprogram.c -o myprogram.i`

using-gdb-debugger.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# using the GNU debugger gdb
2+
3+
My version of the GNU debugger gdb is GNU gdb (Debian 8.2.1-2+b3) 8.2.1
4+
It is in /usr/bin/gdb /etc/gdb /usr/include/gdb /usr/share/gdb
5+
6+
## lowercase flags
7+
8+
`gdb -b` requires an argument. starts GDB in batch mode. `gdb -b <batch_file_name>`
9+
10+
`gdb -c` requires an argument. allows you to specify a command to be executed immediately after GDB starts.
11+
12+
`gdb -d` requires an argument. allows you to debug a running process `gdb -d <PID>`
13+
14+
`gdb -e` requires an argument. used to specify an environment variable to be set for the program being debugged.
15+
16+
`gdb -f` starts the repl. used to specify a core file for debugging. `gdb -f <core_file_name>`
17+
18+
`gdb -h` prints the help
19+
20+
`gdb -i` requires an argument. used to start GDB in interactive mode. `gdb -i <program_name>`
21+
22+
`gdb -l` requires an argument. not a common option flag.
23+
24+
`gdb -n` starts the repl. not a common option flag
25+
26+
`gdb -p` requires an argument. used to specify the PID (Process ID) of a running process that you want to attach to and debug.
27+
28+
`gdb -q` used to suppress the initial startup message when launching GDB. just says (gdb).
29+
30+
`gdb -r` starts the repl. used to restart a program that has crashed or terminated abnormally.
31+
32+
`gdb -s` requires an argument. is a shorthand for the step command. `gdb -s <program_name>`
33+
34+
`gdb -t` says option `-t` is ambiguous might be `-tui` or `-tty`
35+
36+
`gdb -u` says option `-ui` requires an argument
37+
38+
`gdb -v` prints the version
39+
40+
`gdb -w` starts the repl. used to set watchpoints. `gdb -w <program_name>` from there you can use the watch command.
41+
42+
`gdb -x` requires an argument. used to execute a GDB command script. `gdb -x <script_name> <program_name>`
43+
44+
There's only 1 upperase flag
45+
46+
`gdb -D` requires an argument. used to define preprocessor macros for the program being debugged
47+
48+
Help is in `gdb --help` or `gdb -h`

using-gnu-ld-linker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ My ld comes from /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd /usr/share/man/man
5454

5555
## untested flags
5656

57-
- ld -T used to specifiy the linker file used
57+
- ld -T used to specify the linker file used
5858

5959
- ld -o Specifies the name of the output file (executable or library) to be generated
6060

0 commit comments

Comments
 (0)