LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2021, 08:25 AM   #196
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 370
Blog Entries: 1

Rep: Reputation: 49

That you can use lnav to quickly navigate in a log file :

Navigation
Code:
e/E      : go to next/previous [e]rror
w/W      : go to next/previous [w]arning
o/O      : forward/back one h[o]ur
d/D      : forward/back one [D]ay
s/S      : go to the next/previous [s]lowdown (variation in number of lines by unit of time)
/<PCRE>  : search for pcre
n/N      : goto next/previous search result


Display
Code:
T : toggle elapsed [T]ime since first timestamp (like in wireshark)
i : toggle h[i]stogram of the logfile. This will show when were most messages logged. Use z/Z to zoom in, zoom out -minute,hour,day-
Filtering
Code:
:filter-in <PCRE>            : only display lines matching the perl compatible regular expression with a bonus : some values/words scanned in the log file are tab-completable
:filter-out <PCRE>           : hide lines matchine pcre
:disable-filter <PCRE>       : disable filter <PCRE>. It is readline ready so you can use arrow keys or C-r/C-s to search in what you typed previously
:set-min-loglevel <loglevel> : hide lines below loglevel (tab completable)
Output
Code:
m                 : [m]ark current line
C                 : [c]lear all marked lines
u/U               : go to next/previous marked line
:append-to <file> : append marked lines to file

Last edited by ychaouche; 10-17-2021 at 08:30 AM. Reason: Formatting
 
Old 10-17-2021, 08:50 AM   #197
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by ychaouche View Post
That you can use lnav to quickly navigate in a log file :
This is what did you learn in last seven days or you just sharing your knowledge with the rest of us? If the latter just create a blog or wiki. You can put link into your signature. People here are Warhammer 40k veterans. Figuratively speaking. It is PITA reading YALB (Yet another Linux Bible).
 
Old 10-17-2021, 09:58 AM   #198
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,384

Rep: Reputation: Disabled
Quote:
Originally Posted by igadoter View Post
This is what did you learn in last seven days or you just sharing your knowledge with the rest of us? If the latter just create a blog or wiki. You can put link into your signature. People here are Warhammer 40k veterans. Figuratively speaking. It is PITA reading YALB (Yet another Linux Bible).
That comment encapsulates everything I said in my earlier comment. In order to post knowledge, one must do enough research to make reasonably certain that what one learned is not widely known. If one doesn't, one will most likely get a gripe from someone (and/or a lecture from a moderator) that the information is already known and one is wasting everybody's time.

The reasoning behind my conclusion is this. If one is going to use LQ, one needs to know the culture. Perhaps one hopes one's discovery might help some newer user one day. But however many "newbies" visit regularly, a large proportion of the regular membership are quite experienced and probably know much more than the "newbie"; and are always the most likely to respond to a post. One can't share one's discovery with only other newbies; it displays to everyone at once. That in practice always means that it has to run a gauntlet of experienced users who probably saw it first. They are ready to evaluate the information; and, if it doesn't fit their level of experience, to dismiss it, possibly brusquely.

Or: try this.

Example of what might be useful to post: All these comments about what users did with the programming languages or advanced commands. Example of what would not be particularly needed and would just get a lecture: how I made my own church worship music collection by using audacity and youtube-dl to extract the audio from DVDs and youtube videos of services, respectively. (Which is perfectly legal and ethical for me to do as a member of my church--we pay the subscription fees out of money that came from tithes!--as long as I don't share it with others due to copyrights.) Why would that be not particularly needed? Because it's only a matter of finding and following instructions. All I did was read man pages and ask questions on LQ.

Last edited by newbiesforever; 10-17-2021 at 04:00 PM.
 
Old 10-17-2021, 10:27 AM   #199
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Most of what is in this thread was quite unknown to me and I've been using Linux for ten years! That's why I subscribe to it. Unfortunately, I'm not going to remember much of what I've read here.
 
Old 10-17-2021, 02:21 PM   #200
captain_sensible
Member
 
Registered: Apr 2010
Posts: 352

Rep: Reputation: 145Reputation: 145
i discovered that whilst bash would be the first go to,to get things done, python has its moments.

Thus for Arch i wrote a python script and compiled to ->elf ;it fetches full mirror and writes to /etc/pacman.d/mirrorlist(none enabled) , it also fetches full mirrorlist and enables all, or it can fetch mirror after you select from tkinter drop down, check likley speed of mirror using elapse time , sort a tuple where url=elapse time and then write fastest first.


So basically reflector and reflector simnple , all in one.

When i finished doing that , i then learned how to construct a PKGBUILD, and finally push to AUR.

Quite a bit for a 64 year old
 
2 members found this post helpful.
Old 10-18-2021, 12:55 AM   #201
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,624
Blog Entries: 40

Rep: Reputation: Disabled
This thread is what it is meant to be. All which responds to the question in the topic header must be on-topic, you cannot just come along on page 14 and then say: “What we expect to read here is ...”, then even argument with the senior-status of the readers... I am surprised in an utterly disagreeable way.

Do your own, then.

On-topic: I learned that there is no straight forward way (or no documentation about it) to enable unblocking input from STDIN with Bash. And YES, I wrote a blog post about it that some will disagree with.

How about criticizing my grammar. I might even appreciate that.

Last edited by Michael Uplawski; 10-18-2021 at 12:56 AM.
 
Old 10-18-2021, 01:57 AM   #202
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ychaouche View Post
I used cat to join two short music mp3 files into a longer one ¯\_(ツ)_/¯
That might have worked only because most media players are very forgiving about buggy mp3 files, or (much less likely) your mp3 files do not have any headers at all.

That said, utilities to concatenate mp3 files without re-encoding them exist.
 
1 members found this post helpful.
Old 11-11-2021, 04:49 AM   #203
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 370
Blog Entries: 1

Rep: Reputation: 49
That ps can also display memory and cpu consumption per process, much like the top family of programs do. Try
Code:
ps ux
.
 
3 members found this post helpful.
Old 11-11-2021, 05:21 AM   #204
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 370
Blog Entries: 1

Rep: Reputation: 49
That every command invoked with sudo is logged in /var/log/auth.log (on debian-based distros)
 
Old 11-11-2021, 05:24 AM   #205
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by ychaouche View Post
That ps can also display memory and cpu consumption per process, much like the top family of programs do. Try
Code:
ps ux
.
Ok just tried
Code:
bash-5.1$ ps ux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
piotr     1317  0.0  0.0   8688  4876 tty1     Ss   Nov10   0:00 -bash
piotr     1324  0.0  0.0   7220  3408 tty1     S+   Nov10   0:00 /bin/sh /usr/bin/startx
piotr     1345  0.0  0.0   3972   668 tty1     S+   Nov10   0:00 xinit /home/piotr/.xinitrc -- /usr/bin/X :0 vt1 -keeptty -auth 
piotr     1350  0.0  0.0   7024  2776 tty1     S    Nov10   0:00 sh /home/piotr/.xinitrc
piotr     1351  0.0  0.1 144328 12200 tty1     Sl   Nov10   0:00 startplasma-x11
piotr     1354  0.0  0.0   5428  1752 tty1     S    Nov10   0:00 dbus-launch --sh-syntax --exit-with-session startplasma-x11
piotr     1355  0.0  0.0   5292  3356 ?        Ss   Nov10   0:01 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-addr
piotr     1376  0.0  0.0   6020    84 tty1     S    Nov10   0:00 /usr/lib64/kf5/start_kdeinit
piotr     1377  0.0  0.2 109712 20796 ?        Ss   Nov10   0:00 kdeinit5: Running...
piotr     1378  0.0  0.4 273132 32900 ?        Sl   Nov10   0:02 /usr/lib64/libexec/kf5/klauncher --fd=9
piotr     1391  0.0  0.8 1259680 67784 ?       Sl   Nov10   0:18 /usr/bin/kded5
piotr     1395  1.4  1.5 1271600 122132 ?      Sl   Nov10  16:28 /usr/bin/kwin_x11
piotr     1403  0.0  0.0 155248  3112 ?        Sl   Nov10   0:00 /usr/libexec/dconf-service
piotr     1420  0.0  0.4 274748 35484 ?        Sl   Nov10   0:02 /usr/bin/kglobalaccel5
piotr     1421  0.0  0.5 279472 43392 ?        Sl   Nov10   0:07 /usr/bin/ksmserver
piotr     1434  0.0  0.1 224668 15648 ?        Sl   Nov10   0:02 /usr/bin/xembedsniproxy
piotr     1441  0.0  0.4 474564 32920 ?        Sl   Nov10   0:05 /usr/lib64/libexec/org_kde_powerdevil
piotr     1443  0.1  3.8 2588176 306096 ?      Sl   Nov10   1:36 /usr/bin/plasmashell
piotr     1447  0.0  0.4 424572 36816 ?        Sl   Nov10   0:02 /usr/lib64/libexec/polkit-kde-authentication-agent-1
piotr     1450  0.0  0.4 277636 36504 ?        Sl   Nov10   0:03 /usr/bin/kaccess
piotr     1453  0.0  0.4 544284 34656 ?        Sl   Nov10   0:02 /usr/lib64/libexec/kactivitymanagerd
piotr     1459  0.0  0.5 357452 42800 ?        Sl   Nov10   0:07 /usr/lib64/libexec/kdeconnectd
piotr     1502  0.0  0.2 225872 16684 ?        Sl   Nov10   0:02 /usr/bin/gmenudbusmenuproxy
piotr     1505  0.0  0.8 742228 66564 ?        Sl   Nov10   0:07 /usr/bin/kmix -session 101a021821c21700016348434200000031779000
piotr     1510  0.0  0.8 689424 70560 ?        Rl   Nov10   0:19 /usr/bin/yakuake -session 101a021821c21700016354362460000001428
piotr     1514  2.9  0.4 1875960 31760 ?       Sl   Nov10  32:31 /usr/bin/pulseaudio --start --log-target=syslog
piotr     1519  0.0  0.5 286328 41620 ?        Sl   Nov10   0:02 /usr/bin/kteatime -session 101a021821c2170001635708958000000770
piotr     1543  0.0  0.8 326848 67480 ?        Ssl  Nov10   0:02 /usr/bin/python3 /usr/bin/hp-systray -x
piotr     1584  0.0  0.4 293084 33788 ?        S    Nov10   0:07 fcitx
piotr     1590  0.0  0.0   4752  2900 ?        Ss   Nov10   0:05 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-addr
piotr     1594  0.0  0.0   3736   152 ?        SN   Nov10   0:00 /usr/bin/fcitx-dbus-watcher unix:abstract=/tmp/dbus-HESmdhyYEU,
piotr     1598  0.0  0.0 238924  7776 ?        Sl   Nov10   0:00 /usr/libexec/pulse/gsettings-helper
piotr     1639  0.0  0.2 218132 16752 ?        Sl   Nov10   0:02 /usr/lib64/libexec/kf5/kscreen_backend_launcher
piotr     1643  0.0  0.0  45168  4108 ?        S    Nov10   0:00 /usr/libexec/bluetooth/obexd
piotr     1682  0.0  0.3  56528 26468 ?        S    Nov10   0:03 /usr/bin/python3 /usr/bin/hp-systray -x
piotr     1683  0.0  0.2  40404 20984 ?        S    Nov10   0:04 /usr/bin/python3 /usr/bin/hp-systray -x
piotr     1766  0.0  0.1  80376 11552 ?        S    Nov10   0:00 /usr/lib64/libexec/kf5/kioslave5 /usr/lib64/qt5/plugins/kf5/kio
piotr     1768  0.0  0.1  80376 11400 ?        S    Nov10   0:00 /usr/lib64/libexec/kf5/kioslave5 /usr/lib64/qt5/plugins/kf5/kio
piotr     2288  0.0  0.0 234104  6444 ?        Sl   Nov10   0:00 /usr/libexec/gvfsd
piotr     2293  0.0  0.0 383100  6804 ?        Sl   Nov10   0:00 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f
piotr     2336  0.0  0.0 308448  6872 ?        Sl   Nov10   0:00 /usr/libexec/at-spi-bus-launcher
piotr     3031  0.0  1.0 919700 84324 ?        Sl   Nov10   0:15 /usr/bin/dolphin
piotr     3605  0.0  0.1 842520 11300 ?        Sl   Nov10   0:01 /usr/libexec/xdg-desktop-portal
piotr     3644  0.0  0.0 525660  5596 ?        Sl   Nov10   0:00 /usr/libexec/xdg-document-portal
piotr     3650  0.0  0.7 681316 55672 ?        SLl  Nov10   0:02 /usr/bin/kwalletd5
piotr     3654  0.0  0.0 229988  4576 ?        Sl   Nov10   0:00 /usr/libexec/xdg-permission-store
piotr     3675  0.0  0.4 348456 35360 ?        Sl   Nov10   0:02 /usr/lib64/libexec/xdg-desktop-portal-kde
piotr     3711  0.0  0.0 234504  7484 ?        Sl   Nov10   0:00 /usr/bin/gnome-keyring-daemon --start --foreground --components
piotr     3961  0.1  0.1 154100 13356 ?        Sl   Nov10   1:03 /usr/lib64/libexec/kf5/kio_http_cache_cleaner
piotr     4054  0.0  0.0   4092  2364 ?        S    Nov10   0:02 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/
piotr     4067  0.0  0.0 158468  5896 ?        Sl   Nov10   0:06 /usr/libexec/at-spi2-registryd --use-gnome-session
piotr     5152  1.2  1.3 790992 103220 ?       Sl   Nov10  11:55 /usr/bin/pavucontrol
piotr     7595  0.0  0.1 316968 10992 ?        Sl   01:58   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
piotr     7601  0.0  0.0 229904  5480 ?        Sl   01:58   0:00 /usr/libexec/gvfs-mtp-volume-monitor
piotr     7606  0.0  0.0 232304  6096 ?        Sl   01:58   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
piotr     7611  0.0  0.0 308600  5072 ?        Sl   01:58   0:01 /usr/libexec/gvfs-afc-volume-monitor
piotr     7616  0.0  0.1 312204  8344 ?        Sl   01:58   0:00 /usr/libexec/gvfsd-trash --spawner :1.94 /org/gtk/gvfs/exec_spa
piotr     7635  0.0  0.1 599236  8676 ?        Sl   01:58   0:00 /usr/libexec/gvfsd-network --spawner :1.94 /org/gtk/gvfs/exec_s
piotr     8228  2.8  5.9 3587224 464288 ?      Sl   10:38   2:26 /usr/lib64/firefox/firefox
piotr     8334  0.3  2.4 34056244 190208 ?     Sl   10:38   0:17 /usr/lib64/firefox/firefox-bin -contentproc -childID 2 -isForBr
piotr     8420  0.0  1.4 2452708 116176 ?      Sl   10:38   0:04 /usr/lib64/firefox/firefox-bin -contentproc -childID 3 -isForBr
piotr     8804  0.0  0.7 244400 55820 ?        Sl   11:03   0:00 /usr/lib64/firefox/firefox-bin -contentproc -parentBuildID 2021
piotr     8942  0.2  2.0 2489164 157964 ?      Sl   11:15   0:06 /usr/lib64/firefox/firefox-bin -contentproc -childID 7 -isForBr
piotr     9003  0.1  1.9 2498172 156240 ?      Sl   11:17   0:03 /usr/lib64/firefox/firefox-bin -contentproc -childID 8 -isForBr
piotr     9249  0.2  1.1 2427764 91132 ?       Sl   12:02   0:00 /usr/lib64/firefox/firefox-bin -contentproc -childID 9 -isForBr
piotr     9276  0.0  0.0   7528  4164 pts/1    Ss   12:03   0:00 /bin/bash
piotr     9278  0.0  0.0   4820  2700 pts/1    R+   12:03   0:00 ps ux
perhaps it ii good to add some sorting. I found this in man ps
Code:
$ ps ux --sort -%cpu
top processes with cpu usage.
 
1 members found this post helpful.
Old 11-11-2021, 08:17 AM   #206
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 370
Blog Entries: 1

Rep: Reputation: 49
Quote:
Originally Posted by igadoter View Post
perhaps it ii good to add some sorting. I found this in man ps
Code:
$ ps ux --sort -%cpu
top processes with cpu usage.
Thanks for the tip. Apparently htop and ps give different output. ps seems much more stable, while htop there seems to be a constant dance. https://vimeo.com/manage/videos/644786445
 
Old 11-11-2021, 10:33 AM   #207
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
I learned how to use UPNP without additional software

https://www.linuxquestions.org/quest...ax-4175703270/
 
Old 11-12-2021, 11:49 PM   #208
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ychaouche View Post
Apparently htop and ps give different output. ps seems much more stable, while htop there seems to be a constant dance.
They work differently.
ps gives a one-shot picture of your system, htop updates & averages constantly.
 
Old 11-19-2021, 06:40 PM   #209
sofasurfer
Member
 
Registered: Oct 2003
Posts: 252

Rep: Reputation: 20
Quote:
Originally Posted by SkarmoutsosV View Post
You are absolutely right.
While 'Ctrl + L' visually clears the screen, it also allows you to scroll up and see the previous terminal output.
I don't get it. 'Ctrl+ l' and 'Ctrl + L' both clear my terminal screen and there is no scrolling to any previous output.
 
Old 11-20-2021, 01:28 AM   #210
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by sofasurfer View Post
I don't get it. 'Ctrl+ l' and 'Ctrl + L' both clear my terminal screen and there is no scrolling to any previous output.
Depends on the emulator (xterm, urxvt, gnome-terminal etc.) you use.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alright, it's Wednesday. What is something you have learned *new* about Linux within the past 7 days? KGIII General 120 06-15-2021 05:19 AM
What is something new that you have learned about Linux this week? KGIII General 19 05-26-2021 01:51 PM
How do I grep my /var/log/secure file for the past 7 days or so many days? johnmccarthy Linux - Newbie 5 01-04-2013 09:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration