Using Debian packages
You’ll use dpkg to install Debian packages:
dpkg [options] [action] [package-files] [package-name]
||purge, removes a package and its configs
||display info about an installed package
||list files associated to a package
||search for partially installed packages
||override defaults that would cause dpkg to abort
||check for dependencies, conflicts and other problems without installing
||do not install if a newer version is already installed
||skip version, do not install if the same version is already installed
Continue reading “Package concepts: DEBs and apt”
- Packages are usually distributed as single files
- Dependencies are the requirements of packages for one another
- Checksums verify the validity of the installed software
- You can create binary packages from source
RPM was developed by Red Hat for its own distro; RPM supports any CPU architecture. The convention for naming .rpm is as follows:
||version of the program, assigned by the author
||build number, assigned by the maintainer
Continue reading “Package concepts: RPMs and yum”
Two programs that make heavy use of regular expressions are grep and sed.
There are two forms of regular expressions: basic and extended.
- alphabetic string
- bracket expressions: char enclosed in [ ] match any one character enclosed
- range expressions: start and end points are separated by a dash –
- any single character: the dot . represents any single character except a new line
- start/end of line: ^ start of line, $ end of line
- repetition operators: * zero or more occurrences, + one or more occurrences, ? zero or one match
- multiple possible strings: | separates two possible matches
- parenthesis: ( ) surround sub-expressions
- escaping: if you want to match one of the special characters (ie. . dot), you must escape it with a backlash \
Continue reading “Using regular expressions”
cat: concatenate; combine an arbitrary number of files and send it to a file. It’s also commonly used to display the content of short files.
Options for cat:
||see where line ends
||add numbers to the beginning of every line
||numbers only lines that contain text
||compress groups of blank lines down to a single one
||display tabs as ^I
tac: it reverses the order of lines in the output.
join: combines two files matching the content of specified fields. Fields are usually separated by a space. -t [char] option lets you specify another character to be used as separator.
paste: merges file line by line, separating the lines from each file with tabs.
Continue reading “Processing text using filters”
The three I/O connections, known as standard streams, are:
- STDN: standard input (file descriptor 0)
- STDOOT: standard output (file descriptor 1)
- STDERR: standard error (file descriptor 2)
Linux handles all objects as files, including input and output streams.
Continue reading “CLI: streams, redirections and pipes”