Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the first thing that will appear on the terminal is how long ago the last dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
Best regards.
Francisco.
On 01/06/2021 21:32, Francisco Tissera wrote:
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the first thing that will appear on the terminal is how long ago the last dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
does adding -q (quiet) help?
man dnf
On Tue, 2021-06-01 at 09:32 -0400, Francisco Tissera wrote:
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be filtered on whatever criteria you like, typically using grep, e.g.:
$ sudo dnf update|grep -v "Last metadata" Dependencies resolved. Nothing to do. Complete!
poc
Hello everyone,
I'd like to thank both Ed and Poc for their input.
Ed, adding the -q option makes it... Too quiet, LOL!
Poc, what you suggested, is really useful, thanks, since you wrote that any output can be customized to what I like.
How ever, I have another question:
Is there a way to make that grep permanent? or would I have to type the command including grep every time?
Thanks again.
Best regards.
Francisco.
On 6/1/21 12:06 PM, Patrick O'Callaghan wrote:
On Tue, 2021-06-01 at 09:32 -0400, Francisco Tissera wrote:
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be filtered on whatever criteria you like, typically using grep, e.g.:
$ sudo dnf update|grep -v "Last metadata" Dependencies resolved. Nothing to do. Complete!
poc _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
On 6/2/21 9:54 AM, Francisco Tissera wrote:
Hello everyone,
I'd like to thank both Ed and Poc for their input.
Ed, adding the -q option makes it... Too quiet, LOL!
Poc, what you suggested, is really useful, thanks, since you wrote that any output can be customized to what I like.
How ever, I have another question:
Is there a way to make that grep permanent? or would I have to type the command including grep every time?
Thanks again.
Best regards.
Francisco.
Hi Francsisco,
1. I would defiine an own Shell script piping the dnf output to grep 2. Or define an own alias or a bash function in your ~/.bashrc file or similar which pipes the bash output to grep or simillar, if you are using another shell
Regards
Joachim Backes
On 6/1/21 12:06 PM, Patrick O'Callaghan wrote:
On Tue, 2021-06-01 at 09:32 -0400, Francisco Tissera wrote:
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be filtered on whatever criteria you like, typically using grep, e.g.:
$ sudo dnf update|grep -v "Last metadata" Dependencies resolved. Nothing to do. Complete!
poc _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
On Wed, 2021-06-02 at 03:54 -0400, Francisco Tissera wrote:
Poc, what you suggested, is really useful, thanks, since you wrote that any output can be customized to what I like.
How ever, I have another question:
Is there a way to make that grep permanent? or would I have to type the command including grep every time?
Create your own script called (for example) mygrep:
#!/bin/bash grep -v insert-patterns-here $*
(note that grep can read the patterns from a file, so that might also be an option if you want - read 'man grep')
Make that executable (chmod +x mygrep) and put it in your ~/bin directory.
poc
On Wed, 2 Jun 2021 at 04:55, Francisco Tissera audiogamer2004@gmail.com wrote:
Is there a way to make that grep permanent? or would I have to type the command including grep every time?
I seeTh some terse responses, but you will find that a few hours learning
some basics of the linux command-line well worth the effort. It will also help you avoid some of the poor or even malicious examples posted on internet sites that can damage your system.
Good starting place are linuxcommand.org and Nemeth et al (many of us have several editions):
Title: UNIX and Linux System Administration Handbook, 5th Edition, 2017 Authors: Evi Nemeth, Garth Snyder, Trent R. Hein, Ben Whaley, Dan Mackin Publisher: Addison-Wesley Professional ISBN: 9780134278308
Linux follows the outline of UNIX, which was created at a time when terminals were text only so all interactive work was done with a command line. One guiding principle was that programming is mostly text processing. The grep, sed, and awk programs were available from the early days and are still widely used. Another innovation was "pipes" that allow you to chain together a series of programs, typically starting with a program (e.g., "dnf") that generates text and piping ("|") the output text to another program (e.g., "grep"). Yet another innovation was regular expressions which provide compact (important when you were working on an terminal with only 80 characters on a line and 24 or 25 lines) patterns to match text strings.
Command-line processing is quite similar across linux distros and macOS. I find Apple's command-line documentation < https://developer.apple.com/library/archive/documentation/OpenSource/Concept...
quite useful for users starting out with the linux command line. One keystroke saving measure in UNIX is the use of the "PATH" to list directories that are searched for a command. Today, many users end up with multiple versions of programs (python is one that often exists in multiple versions) that are used by the system as well as for applications. Apple recommends reserving the PATH for "system" programs, and that user scripts and programs be run using the full path. In your case, you might create a "dnf" script like one of the examples posted here. If you put it in a directory on the "PATH", such as "$HOME/bin", it could mask the real dnf, but if you put it in a directory that is not in the PATH, say "$HOME/my" you can run it as "~/my/dnf" and avoid conflicts. You can also name the script "mydnf" and put it in $HOME/bin, but getting in the habit of using a full path with non-system programs avoids problems that are often tricky to recognize on forum posts.
On Wed, 2021-06-02 at 08:17 -0300, George N. White III wrote:
One keystroke saving measure in UNIX is the use of the "PATH" to list directories that are searched for a command.
Always remember that paths are a common cause for scripting to fail.
Someone does some experimenting with a command line, and works out something that works for them. Then they put the command line into a script, or other automation, and it doesn't work. It's because the path was different in their command line interface than elsewhere.
It's *often* best to use the full path when you're not typing commands directly into a command line.
On Tue, Jun 01, 2021 at 05:06:23PM +0100, Patrick O'Callaghan wrote:
On Tue, 2021-06-01 at 09:32 -0400, Francisco Tissera wrote:
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when the dnf install package name command is issued, the dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be filtered on whatever criteria you like, typically using grep, e.g.:
$ sudo dnf update|grep -v "Last metadata" Dependencies resolved. Nothing to do. Complete!
You may find the Prompt "Is this ok [y/N]: " is not output from the pipeline until after it is blindly responded to.
Jon