date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,410,012,509,000 |
My scenario
Relevant entries in my /etc/hosts (I have them written in the same order you see them here)
172.22.5.107 www.wordpress-rend-adri.com
192.168.1.116 www.wordpress-rend-adri.com
I use my laptop in my house and school, hence I'm always dealing with 2 address spaces:
192.168.1.0/24
172.22.0.0/16
So I ha... |
I have done a few tests on my debian/wsl
~$ uname -a
Linux DESKTOP-OMM8LBC 4.4.0-17763-Microsoft #864-Microsoft Thu Nov 07 15:22:00 PST 2019 x86_64 GNU/Linux
# /etc/hosts
172.22.5.107 www.wordpress-rend-adri.com # Unreachable IP from my LAN
216.58.198.164 www.wordpress-rend-adri.com # IP for www.google.com
192.168.... | Different IP:hostName mappings for same host in `/etc/hosts`. Why does this work? |
1,410,012,509,000 |
I have two host file list like this:
file1.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
file2.hosts
0.0.0.0 site1.com
0.0.0.0 site3.com
Now I want one list that looks like this:
hosts.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
0.0.0.0 site3.com
What is the best way to get this?
I tried it with join but I don't get it ... |
You could use sort instead. The -u-Option supressed duplicates in the output:
$ sort -u file*.hosts | tee hosts.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
0.0.0.0 site3.com
Note that I'm using tee so that we get to see the output while creating the file.
You could just as well just use redirection instead:
$ sort -u f... | Pair two file / Remove duplicate entries |
1,410,012,509,000 |
I have a Linux server
# uname -a
Linux site 3.12.39-47-default #1 SMP Thu Mar 26 13:21:16
UTC 2015 (a901594) x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
LSB Version: n/a
Distributor ID: SUSE LINUX
Description: SUSE Linux Enterprise Server 12
Release: 12
Codename: 12
I had to change network set... |
Your DHCP client can be configured to override the hostname given to the machine by the DHCP server. Depending on what DHCP client you use, this may be done differently.
dhclient may be configured with
supersede host-name "site";
in /etc/dhclient.conf, for example.
Unless you have very special requirements, I'd sugg... | My Linux server forgets its host name every day |
1,410,012,509,000 |
What are the rules that decide what goes into the initial /etc/hosts file of a a server with these characteristics?
It has a internal IP address for the internal subnet. which is in the 172.20.x.x range
It has a public facing IP address which has a 1 to 1 mapping with the internal IP address
ifconfig only shows the ... |
first rule
syntactically correct
second rule
logically true
third rule
depends on your distro.
I'd expect an entry for localhost and possibly for the system's hostname.
localhost may be an ipv6 entry (::1) in which case there may be an additional entry for ipv4-localhost
What you should you put in the hosts file is ... | What are the rules that determine the default contents of an /etc/hosts file? |
1,410,012,509,000 |
Possible Duplicate:
How can I make iconv replace the input file with the converted output?
I'm writing a script to change the content of my hosts file but I got stuck on the head output redirection.
If I do head -n -1 hosts >hosts my hosts file will result empty and yes, it has more than 1 line.
|
That's because your shell truncates the file when you redirect to it. This happens before head gets a chance to read it.
You can either use a temporary file:
head -n1 hosts > hosts.tmp && mv hosts.tmp hosts
Or use sponge from the moreutils packate:
head -n1 hosts | sponge hosts
| Redirecting head output for update hosts file [duplicate] |
1,410,012,509,000 |
What is the correlation between these programs?
tcpd and inted/rinetd are very old but despite this they are still present in many distributions ... why?
And there is also a correlation between hosts.allow and hosts.deny with tcpd but i noticed that these files are present even when tcpd is not installed ... (trying w... |
The traditional setup is to use inetd to open listening sockets, similar to what systemd is doing with socket activation now, only thirty years before that. inetd will unconditionally start the daemon when a connection comes in.
For some rudimentary access control, you'd configure inetd to start tcpd instead of the re... | tcpd, inetd/rinetd and iptables |
1,410,012,509,000 |
I noticed that when I create a tunnel locally from my PC to the remote one, for some devices (generally routers), the connection via http or https does not take place. I get a pop-up that says:
The 'Host' field contained in Http header is invalid
If setting the following in the file hosts file:
127.0.0.1 modemtim
an... |
A typical http request looks like this if you connect to http://google.com/?q=icarus
GET /?q=icarus HTTP/1.1
Host: google.com
User-Agent: mozilla/123
Accept: */*
Low cost web service providers host many many domains such as www.yourdomain.name and www.mydomain.us on a single machine. The web server on that machine lo... | Clarifications for SSH tunnels over HTTP (or HTTPS) |
1,410,012,509,000 |
I'm trying to write a script that will check what is the last modified/created file on the server, then copy it to my homedirectory on this server and then copy this file from node to my local machine.
I would like to point out, that I am learning how to do this, so I don't have skill at all.
Here is my script, don't ... |
I have found a solution.
Turns out, that variable had an attached "\r" at the end.
I solved this by using tr command.
cmd=$( ssh -t some_server_name1 ' cd /opt/automation/repository/hosts/ ; out=$( ls -1tr | tail -n 1 ) ; sudo cp $out ~/ ; ls -1tr ~/ | tail -n 1 ' )
cmdv=$( echo "$cmd" | tr -d '\r' )
| Variable for SCP command in script |
1,410,012,509,000 |
I added some custom (non-TLD) aliases to my /etc/hosts to get rid of IP addresses in my services configuration files.
Are there any caveats/gotchas/security implications i should be aware of?
|
Generally, adding convenience entries to /etc/hosts won't cause any problems per se, but you may find yourself momentarily stymied when you move to another host (e. g. via ssh) and your shortcuts do not work. It's possible some oddball applications will eschew the system call for DNS resolution and do it "by hand" s... | Is it okay to add something non-TLD non-hostname as a host alias? |
1,410,012,509,000 |
Have multiple vm machines that am using for studying, and have come up with this script for copying some files from vm's to my local machine:
SG=rohos; date; for i in `cat /etc/hosts | grep "$SG-" | awk '{print $2}'` ;do echo "Logging into ${i}";ssh -i /root/.ssh/vm_private_key keyless-user@${i} "sudo mkdir -p /tmp/${... |
Your script can't do what you want. As written, it will only ever copy files on remote hosts to /tmp/$SG/$i on the same remote host.
You need to use scp instead of ssh and cp. For example:
SG=rohos
date
for i in $(awk "/$SG-/ {print \$2}" /etc/hosts); do
echo "Logging into $i"
mkdir -p "/tmp/$SG/$i"
scp -i /... | copy files from multiple remote machines to local and create directories for remote machines |
1,301,568,488,000 |
I was analyzing some web heads looking at htop and noticed the following
Uptime: 301 days(!), 23:47:39
What does the (!) mean?
|
From htop source code, file UptimeMeter.c, you can see:
char daysbuf[15];
if (days > 100) {
sprintf(daysbuf, "%d days(!), ", days);
} else if (days > 1) {
sprintf(daysbuf, "%d days, ", days);
} else if (days == 1) {
sprintf(daysbuf, "1 day, ");
} else {
daysbuf[0] = '\0';
}
I think ! here is just a mark t... | What does the (!) mean after uptime on htop |
1,301,568,488,000 |
How do I install htop for macOS (OS X)? (The easiest and laziest path)
|
Here is the laziest way (or homebrew way)
First install Homebrew if you haven't
Second brew install htop
Third, done
| How do I install htop in mac OS X? |
1,301,568,488,000 |
Occasionally, I need to check resources on several machines throughout our data centres for consolidation recommendations. I prefer htop primarily because of the interactive feel and the display.
Is there a way to customise some settings to my setup for htop? For example, one thing I'd always like to have shown is the... |
htop has a setup screen, accessed via F2, that allows you to customize the top part of the display, including adding or removing a "Load average" field and setting it's style (text, bar, etc.).
These seem to be auto saved in $HOME/.config/htop/htoprc, which warns:
# Beware! This file is rewritten by htop when settin... | How can I set customise settings for htop? |
1,301,568,488,000 |
It there a way to display the complete command line in htop (e.g. in multiple lines or with a moving banner). With the default setting where only one line is displayed it isn't possible to distungish all processes, e.g. different java programs (because class or jar argument follows a bunch of arguments) or programs wi... |
Just press the w key.
From the help available with F1:
w: wrap process command in multiple lines
| How to configure htop to display the complete command line? |
1,301,568,488,000 |
Given the option:
[ ] Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)
In htop (Version 1.0.1) what are the meanings of the colours?
In the following image, I'm seeing rather a lot of what I expect is IO-Wait, but where does one determine the meaning of the colours.
Naturally this depends on the htop... |
F1 or h will show you the legend.
It looks like in this color scheme:
CPU:
blue is for low priority threads
green is normal priority threads
black is for io-wait
see below for more.
Memory:
green is memory in use
blue is buffer
orange is cache
| Meaning of colours in htop |
1,301,568,488,000 |
There are a few questions and answers on here with regard to being alerted when a process completes/exits(1, 2) – but these all assume that the user has issued said process themselves, and thus can script it with an alert built into the governing script, or pipe the process to some kind of alert.
My situation is that ... |
I wrote process_watcher.py
process_watcher --pid 1234 --to [email protected]
Currently, email body looks like:
PID 18851: /usr/lib/libreoffice/program/soffice.bin --writer --splash-pipe=5
Started: Thu, Mar 10 18:33:37 Ended: Thu, Mar 10 18:34:26 (duration 0:00:49)
Memory (current/peak) - Resident: 155,280 / ... | Alert when running process finishes |
1,301,568,488,000 |
I have a regular process that's not so important but will consume very much CPU power. I have another process which is really important, but it spends most of the time idle, but when it gets a job it really needs high computing power.
I tried running with nice -20 ./low_priority_process and nice --20 ./high_priority_p... |
Have a look at cgroups, it should provide exactly what you need - CPU reservations (and more). I'd suggest reading controlling priority of applications using cgroups.
That said, put the important yet often idle processes into group with allocated 95% of CPU and your other applications into another one with allocated 5... | Run Linux process at very very low priority? |
1,301,568,488,000 |
How can I show the CPU usage side by side rather than a list?
I have this :
but I want to show it like this:
|
Go to settings (F2), under Meters, you select what is in the left column and what in the right column. Instead of CPUs (1/1) in the left column, select CPUs (1/2) for the left column and CPUs (2/2) for the right column. F10 to save the changes and it's done.
| htop, show cpu side by side |
1,301,568,488,000 |
htop allows me to nicely see trees of processes within the shell. I can kill processes by pressing F9 (KILL) and then selecting which signal (e.g. 15 SIGTERM) I want to send to a job to kill.
However, this only allows me to kill one process at a time. Is there a way to kill a full tree of processes using htop?
|
From man htop:
INTERACTIVE COMMANDS
Space
Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of
tagged processes, instead of the currently highlighted one.
U Untag all processes (remove all tags added with the Space key).
F9, k
"Kil... | Killing a tree of processes in top/htop |
1,301,568,488,000 |
I want to monitor only a process and its children processes on htop. Filtering on the name of the parent process lists only the parent process, not its children. How do I show the children processes too?
|
Under Linux, you can do:
htop -p `pstree -p $PID | perl -ne 'push @t, /\((\d+)\)/g; END { print join ",", @t }'`
where $PID is the root process. This works as follows:
The list of the wanted processes are obtained with pstree, using the -p option to list them with their PID.
The output is piped to a Perl script that... | How to display only a process and its descendant processes on htop? |
1,301,568,488,000 |
Why do the progress meters across the top of the screen in htop show CPU usage consistently above >90% while the numbers in the table below show a nearly idle system with CPU usage and load average at 0.0%?
|
htop is unaware it is running on a kernel level virtualized environment (Dreamhost VPS is using VServer technology). It is then showing the CPU usage for all the OS instances sharing the same kernel, not just yours.
Have a look to vtop output which sho ws all processes sharing the CPUs, not just the ones in your conta... | why does htop meter show >90% while table is 0.0%? |
1,301,568,488,000 |
My system was running slow recently and I checked htop to identify resource consumption. RES Column is 213M which is quite normal for chrome. I was surprised after looking at VIRT column, Google Chrome was taking 1.1T !!!
I killed chrome and open again and still it was using 1.1T VIRT memory. Any pointer would be help... |
Please disregard VIRT. I've never used or seen anyone use or pay attention to it ever.
It basically means nothing. No idea why top/htop still show it.
Mugurel Sumanariu once wrote about it:
VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself... | Why Google Chrome is reserving Terabytes scale virtual memory? |
1,301,568,488,000 |
I'm trying to get an accurate read of my used CPU (in percent) from top. This is the command I'm running for testing:
top -n1 | awk '/Cpu\(s\):/ {print $2}'
This returns:
10.7%us,
Which is the proper piece of data I want. However, every time I run the command I get the same output, even though I am applying differen... |
I use this script (from this thread on the Arch boards):
#!/bin/bash
read cpu a b c previdle rest < /proc/stat
prevtotal=$((a+b+c+previdle))
sleep 0.5
read cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle))
CPU=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
| How can I receive top-like CPU statistics from the shell? |
1,301,568,488,000 |
I have a htpc/server-ish ubuntu box running at home with kodi (xbmc) and some other webservices.
I noticed kodi was laggish and ssh'ed into the box to see what was going on. I saw this htop output:
This is the output of free -m
richard@RMD-HTPC:~$ free -m
total used free shared buffers... |
It is because htop is counting buffers and cached memory as free memory, because it can actually can be seen this way.
There is no "cost" in having some cached data in memory, so the kernel keep stuff there just in case it needs afterwards.
For instance, suppose you have watched a video of about 500mb, after you close... | How to interpreted top/htop memory usage |
1,301,568,488,000 |
I've read that the color red indicates "kernel processes." Does that mean little daemons that are regulating which task gets to use the CPU? And by extension, transaction costs in an oversubscribed system?
I'm running some large-scale geoprocessing jobs, and I've got two scripts running in parallel at the same time... |
Red represents the time spent in the kernel, typically processing system calls on behalf of processes. This includes time spent on I/O. There’s no point in trying to reduce it just for the sake of reducing it, because it’s not time that’s wasted — it’s time that’s spent by the kernel doing useful stuff (as long as you... | Lots of red in htop -- does that mean my tasks are tripping over each other? |
1,301,568,488,000 |
I'm trying to use htop in tty1. However, some of the function keys don't appear to work as normal. F1 and F2 do nothing, and F3 seems to trigger setup (which should normally be triggered by F2). In addition, F4 and F5 don't work. Also, when I try and press Esc to get out of these screens, I have to press it twice.
In ... |
By setting:
export TERM=xterm-256color
you're telling htop (and every other visual terminal application that uses the termcap or terminfo database) that your terminal is a 256 colour xterm and not a Linux virtual console.
htop will query the terminfo database to know what sequence of characters is sent upon F1, F2...... | How can I pass function keys to htop in a tty? |
1,301,568,488,000 |
The following three outputs were taken essentially simultaneously:
top:
top - 02:54:36 up 2 days, 13:50, 3 users, load average: 0.05, 0.05, 0.09
Tasks: 181 total, 1 running, 179 sleeping, 0 stopped, 1 zombie
%Cpu(s): 2.5 us, 0.8 sy, 0.0 ni, 96.6 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 16158632 tota... |
A complete re-write of my previous post. Got a bit curious and checked out further.
In short: the reason for the difference is that openSUSE uses a patched version of top and free that adds some extra values to `cached'.
A) Standard version
top, free, htop, ...:
Usage is calculated by reading data from /proc/meminfo:... | htop reporting much higher memory usage than free or top |
1,301,568,488,000 |
How to display meminfo in megabytes in top? discusses how to change the units of memory (e.g. megabytes, gigabytes, etc.) when using top. Is there a way to do this in htop as well? man htop doesn't address this, neither does it seem evident from the info displayed via F1 when running the program.
Alternatively, if t... |
I don't think it is possible, but, if you are up for building your own htop, not impossible. The code is at github and if you look at Meter.c you will see the logic they use to decide what to display.
| htop - change units for memory usage display |
1,301,568,488,000 |
I'm using Debian 9 to host a game server. Specifically, I'm hosting about 10 instances of the game Don't Starve Together.
The other day I noticed one of those instances (which was getting a lot of player activity) exhibit performance issues. When I loaded up htop I saw that CPU% was reporting 101% but the bar graphs a... |
Over time, the operating system schedules threads on different CPU cores, so the 101% reported for your processes are potentially distributed over all 8 bars.
| htop CPU% at ~100% but bar graph shows every core much lower |
1,301,568,488,000 |
On my computer it shows
Tasks 314; 24 running
What do these numbers mean?
Is 1 Task = 1 process?
Why isn't the number of running tasks = number of CPUs then? (I have more than 24 CPUs)
edit. sometimes the number before "running" actually exceeds the number of CPUs I have!
|
Tasks do represent the number of opened processes. (Note that I do not use the term "running" to avoid confusion.)
You have to realize that not all opened processes consume CPU constantly.
Each process can be in a number of different states:
running: actively using CPU
stopped: the process was stopped (paused) b... | What is the meaning of Tasks and Running in htop screen? |
1,301,568,488,000 |
My server is running on debian Wheezy and htop 1.0.1 but it does not display any values on the meters bar except the 100.0% value of CPUs.
Is it possible to show always the values of a meter?
This is the current display of htop on my server:
But I want to have the numbers always on my meters like on this screenshot f... |
Well, you create a htoprc file, mine is located in ~/config/htop/htoprc, I don't know how it is under Ubuntu, but that should work too.
inside you just have to put:
left_meters=AllCPUs Memory Swap
left_meter_modes=1 1 1
That should give you the output you want.
You can also change the number of the color_scheme. May... | Display numbers in meters of htop |
1,301,568,488,000 |
In htop I can use / to search for terms, and typically when searching in tools like less and vi, I can use n or N to show the various instances of results that I find, but this doesn't work in htop. Does anyone know how to show next and previous results when searching in htop?
Thanks!
|
You can use F3 Search key to go to next occurrence of the search item. This works regardless of whether you initiate the search with / or F3. Just be sure to avoid pressing Return or else F3 will start a new search instead of continuing the previous one.
| How to cycle through htop search results |
1,301,568,488,000 |
I use recoll to index files and it kicks in a inopportune times.
When I use htop to change the view to a tree view using F5 and filter the process list I see a master process running and child processes underneath it. When I press F9 to choose a termination option it doesn't seem to respond to the SIGTERM option so I ... |
You can press Space to tag a process. The kill command applies to all tagged processes.
There's no easy way to tag a process and its children, but the tree view (t) should list them contiguously.
Depending on how recoll is run, the processes may be in their own process group. If they are, then you can use kill -STOP -... | How can htop be used to suspend a process and all its child processes? |
1,301,568,488,000 |
When using top, it shows me that cifsd has used lots of CPU time but in htop the process does not show up at all. I have tried enabling threads (with H) in htop, to no avail. It also does not show up in pstree, even when using parameters that might show me more info (-apcls).
I can find its process id in /proc so it e... |
Go to setup and change your 'Display' options:
F2 > Display options
Do not hide kernel threads and show custom thread names:
[ ] Hide kernel threads
[x] Show custom thread names
Save:
F10
| htop does not show a process |
1,301,568,488,000 |
Does anyone know of a way to change the scale of the bar graphs in htop? The memory one, specifically, doesn't seem based off of percent of memory used--it's some other scale that seems useless to me.
It looks like this:
Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB]
When it should look like this:
Mem... |
Don't you have colors?
Green Blue Orange
Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB]
Where green should be 1978 MiB.
Else you can enter F2 -> Under setup stay on "Meters" -> Right arrow to get to "Left column". -> Down 1 to get to "Memory Bar".
Then press enter to view various... | Change the scale of the bar graph in htop |
1,301,568,488,000 |
I am running a Debian Jessie and having memory issues when using Google Chrome
I tried disabling extensions, disabling cache, flushing the cache, and disabling the web 3d rendering, but nothing really improves.
I am getting huge lags some times and I am really wondering where this is coming from.
|
If you add up MEM% for all the identical looking chrome processes, then you have well over 100%, which is impossible. That's because those are not, in fact, separate processes, they're threads, which share the same memory space. htop shows these by default, but see here for how to change that and get a view that will... | How to reduce chrome's virtual memory usage? |
1,301,568,488,000 |
Whenever I open htop, it shows CPU usage suddenly shooting up to 100% on a singe core.
I take it gathering statistics for htop is not that intensive?!
Why does htop suddenly show this spike?
|
You're seeing a side effect of the program seeing its loading resource usage. Loading an executable and its libraries into memory, initializing and turning control over to program is not a free operation: it involves the CPU, memory and (if it hasn't been cached) disk.
Here's top showing its usage immediately upon sta... | Why does htop shoot to 100% CPU upon opening? |
1,301,568,488,000 |
I recently see that there is new "I/O" (blue one) on htop, how to switch to that tab?
|
OK found it XD
literally Tab or Shift+Tab
from https://man7.org/linux/man-pages/man1/htop.1.html
| How to switch htop tab? |
1,301,568,488,000 |
I am using Ubuntu 20.04 LTS. The kernel version is 5.4.0-42.
Here is an example program:
// mre.c
// Compile with: cc -o mre mre.c -lSDL2
#include <stdio.h>
#include <SDL2/SDL.h>
int main(void)
{
SDL_Init(SDL_INIT_VIDEO); // Doesn't work without SDL_INIT_VIDEO
getchar();
}
When I look at the running program ... |
Those threads are used for the mesa disk cache:
util_queue_init(&cache->cache_queue, "disk$", 32, 4,
UTIL_QUEUE_INIT_RESIZE_IF_FULL |
UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY |
UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY);
https://sources.debian.org/src/mesa/22.0.3... | What are these threads named disk$0, disk$1, etc.? |
1,301,568,488,000 |
I'm using zsh on macOS 12.4, apple M1.
When I run htop normally using the command htop and use ctrl+z it behaves as expected and sends the process to the background. I can evoke it again using the fg command and after that send it again to the background using ctrl+z
However, when I run htop and send it to the backgro... |
I can reproduce it on Ubuntu with htop and some other ncurses-based applications like mutt.
At the root of the issue is the fact that when zsh's line editor (zle) is active all the VQUIT, VSUSP, VDSUSP, VSWTCH, VLNEXT special characters in the tty device discipline are disabled, so that upon pressing Ctrl+Z, zle recei... | ctrl+z doesn't send htop to the background |
1,301,568,488,000 |
I would like to know how much CPU / memory my current iptables rules consume.
I have tried looking in ps and htop, but even with kernel threads displayed and did not see anything related to iptables.
I am using the conntrack module with these module-specific settings: xt_recent.ip_pkt_list_tot=1 xt_recent.ip_list_tot=... |
Linux Kernel's Process:
Many Kernel's functions like Iptables are processed in the Kernel level as kworker tasks, they are visible on task managers like top. As mentioned on the comments, you can compute the CPU and memory usage by comparing the total ressource usage usage with and without loading the iptables rules. ... | How to monitor the performance of "iptables" kernel module? |
1,401,220,913,000 |
I was running a pipe command with one section being the following:
sort -t $'\t' -T . -k1,1g
When I was monitoring htop I saw this instead:
What is the reason behind this? Does this mean my command is wrong or is there something wrong with htop?
|
There’s nothing wrong with your command, htop replaces control characters with question marks:
(((unsigned char)data_c[j]) >= 32 ? ((unsigned char)data_c[j]) : '?')
(characters with values less than 32 are control characters).
| Why does `htop` display `$'\t'` as `?` in `sort` command? |
1,401,220,913,000 |
I could find a process named typora from htop
but I cannot trace it from ps or pstree
$ ps -a | grep -i typora
9696 ttys003 0:00.01 grep -i typora
$ pstree | grep -i typora
| |--- 09713 me grep -i typora
|--= 00258 me /Applications/Typora.app/Contents/MacOS/Typora -psn_0_40970
How could I find it from co... |
From the ps manual on macOS (my emphasis):
-a
Display information about other users' processes as well as your own. This will skip any processes which do not have a controlling terminal, unless the -x option is also specified.
Applications that are running on macOS without a controlling terminal, such as windowed F... | ps -a fails to find a process which is running |
1,401,220,913,000 |
I am aware of the -u option in htop, where I can show only processes of a given user, such as:
htop -u root
I am wondering whether there is a way to show processes of all user except root.
|
This is not possible, as of htop 0.8.3.
Source: the source code.
The best you can do is sort processes by user, root's processes will be conveniently lumped together.
| htop: show processes of all users except root |
1,401,220,913,000 |
Previously I was using htop on 32-bit Manjaro, and it worked fine, then I switched to 64-bit ArchLinux, when starting htop it shows a blank screen, and any key press does nothing.
I've tried to add TERM=xterm-color htop, but it does the same.
My current $TERM value is xterm-256color.
I've tried extra/htop 1.0.2-2, aur... |
The problem is either with your display setup or htop itself. To eliminate that it's an issue with htop can you attempt to redirect its output to a file?
$ htop > htop_dump.txt
After running this then hit Ctrl+C. If there's content in the file, more htop_dump.txt, then the issue likely lies with your screen setup in ... | htop gives blank screen |
1,401,220,913,000 |
what causes processes with no name in htop?
this is a fully up to date debian 8.6 system, running htop 1.0.3 as root, amd64. and unix.stackexchange.com seems to shrink the image to an unreadable size, i recommend opening the image url http://image.prntscr.com/image/5ef407a1f99a4c9692db179a3afb2516.png directly
|
htop displays the process's command line with spaces between the arguments. (The first argument, argument number 0, is conventionally the command name passed by the parent process.)
A process may overwrite its command line arguments with a string of the same length or shorter. A few programs use this to convey informa... | what causes htop processes with no name? |
1,401,220,913,000 |
I'm observing a multi threaded process in htop in tree view. If I were to strip it just to the problematic part, it looks somewhat like this:
CPU%
bin/process 100
`- thread1 70
`- thread2 0
The process all together is using 100% and one of the threads is using 70%. Where do... |
thread1 and thread2 are child threads spawned by the main process but the main process can still do work.
In your output of htop bin/process (and all child threads) are using 100% of cpu. 70% of the cpu is used by thread1 and 0% by thread2, the remaining (difference) is the main process that spawn/manages these child ... | 'htop' process and threads cpu usage? |
1,401,220,913,000 |
I'm running this:
$ htop --pid=3907,3940,3941,3947
and would like to make the CPU/Memory at the top only count those PIDs. Is this possible?
Other questions
Also, are there flags for:
enter 'tree' mode on startup, or
change columns displayed?
I'm trying to do it in a script, I know there are interactive methods... |
Q#1: make the CPU/Memory at the top only count those PIDs. Is this possible?
Unfortunately no top and htop do not provide a mechanism for only showing the individualized load in the upper portion of their output. However the CPU/Memory resources are displayed per process as 2 of the columns of output for each PID.
... | Making htop summaries respect --pid |
1,401,220,913,000 |
Now I am using htop to show the process of my server, but I face a problem that when the command is very long, I just see part of the command and I did not know the full information of the process, is it possible to make the htop show full of the command? if the command too long , just wrap the output.
|
I don’t think you can make htop wrap long commands in the process list, but you can select a single process and see its full command line, wrapped, by pressing w.
You can also scroll right and left to see different parts of the display, with ← and →.
| how to make the htop wrap command line |
1,401,220,913,000 |
Is there a way to run htop but display only the graphs (I don't want to see the individual processes)? I saw this question which seems to suggest no - I'm wondering if that has changed.
|
You can get the same effect by asking to see only a non-existant process id, eg
htop -p 99999999
| htop summary only display |
1,401,220,913,000 |
My workstation have 256 logic cores, and it seems htop can only display 4 cores usage in one row. So there are 64 rows to display cpu usage, thus I can't see any process information in htop. And I do need to observe CPU usage. So I wonder if there is a method to let htop display 8 cores or even 10 cores usage in one l... |
htop version 3.0.0 and later allow the CPU metrics to be split into 16 columns. To set that up, press F2, then → until you reach the “Available meters” column, move down to “CPUs (1-8/16)”, press Enter, use the cursor keys to move the new entry to the desired position, and press Enter again; do the same with “CPUs (9-... | How to let htop display as much as possible cores in one row |
1,401,220,913,000 |
I frequently use htop to kill certain processes. To find the process I usually execute "Search" via F3. However, the list of processes refreshes frequently, and in many occasions, before I could press F9 for kill, another process is already highlighted, and thus I end up killing the wrong process! If I'm unlucky enoug... |
I don't use htop, but judging from the man page it looks like you could use the space bar to "tag" a process, then the F9/k kill function will apply only to that process.
Space
Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of tagged processes, inst... | Preventing the accidental killing of wrong process in htop |
1,401,220,913,000 |
It is well known that OpenBSD disables hyper-threading by default. However, htop shows 16 CPUs: 8 online and 8 offline, which takes extra space on the screen and is not very informative.
Moreover, sysctl also sees 16 logical CPUs. This doesn't make sense to me: with hyperthreading disabled, it's an 8-core 8-thread pr... |
Availability of hyperthreading is managed from BIOS/EFI. What OpenBSD do is to put offline the processor(s)/thread(s). So You should do it in BIOS/EFI by disabling hyperthreading option.
| How to disable logical processors in OpenBSD? |
1,401,220,913,000 |
I am on Ubuntu 18.04 (Kubuntu), running through Konsole.
I have a node process I can see in htop if I F4 and search for node. I highlight it and use F9 to send it a signal (tried SIGINT, SIGQUIT, SIGTERM, SIGKILL), but nothing causes it to exit.
This is not specific to node, as I can't SIGKILL other things (for examp... |
I have good news, and bad news.
Kill works for htop installed with sudo apt install htop.
Kill doesn't works for htop installed with sudo snap install htop.
I believe snap's sandbox is blocking the signal.
Also, the htop from snap list fewer processes than the htop from apt.
| Htop signals seem not to be sent on (K)Ubuntu 18.04 |
1,401,220,913,000 |
I start two new tmux sessions, the session name is variably build from a timestamp. (the commands create a new, detached tmux session, which first changes the directory, lists the content and then opens bash, in order to keep the session open)
tmux new -d -s tmux-s1-2014-12-04-16-12-12-103728 'cd /home/user/dir/ect/... |
Tmux by default will only run one server process per user, and this server process can have multiple sessions. A Tmux client and the server communicate via a Unix domain socket in the /tmp directory. The -L option can be used to specify a different socket; a new server is created for each socket.
Source: http://hype... | Why is my second tmux session not shown in ps aux or htop but in tmux list-sessions it is? |
1,401,220,913,000 |
I'm managing a few compute servers w/ roughly 20 users each. I'm using htop to view current resource usage, however it would be very helpful to have a log of a specific user's cumulative memory and cpu usage. Is there any way to view/log this via htop or bash?
|
You could use top -bn1 -U {user} to create a file which you can then do additional processing on to gain a cumulative usage.
The argument -bn1 makes top run in a non-interactive mode, simply outputting once when finished. You can then pipe that output anywhere for additional processing.
for example,
top -bn1 -U {user}... | Cumulative resource usage |
1,401,220,913,000 |
Earlier today I was ordering a yard sign for a local politician, via their website, through Firefox.
Just now I was doing some work in R, and checking htop to make sure I wasn't going to make my computer choke. This caught my eye:
What is that highlighted line about? The tab is the link that's long closed. Is this... |
As per the comments, if you launch Firefox by clicking a link, the resulting process will be associated with that argument. In other words, Firefox was launched with the equivalent of typing something similar to the following on the command line.
$ firefox http://visited.website.com
This means that the process as rep... | Looking at htop, I see a process associated with a tab in firefox that isn't open. What gives? |
1,401,220,913,000 |
I deployed a hack to add swap space to a VPS that otherwise didn't allow me to use swapon to create a file.
Prior to adding and executing the script, I followed the steps outlined here. and summarized below:
First I create the swap file: sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
Then sudo mkswap /swapfile... |
You have greatly misunderstood what that post means by "fake swap". There are some programs that for various reasons insist on a system having swap space enabled (cough Oracle cough). If it isn't, the program—or at least its installer—complains. Of course with the aforementioned database there are ways to tell it to c... | Swap bash script pins htop's memory usage |
1,401,220,913,000 |
I found that my "PCI Adapter" overheats when load is above 4.0 (having 4 cores). It does NOT overheat when the load is below 4.0 (but I had an overclocked memory that was causing trouble as I explain at the end), so my focus is on lowering the system load. What overheats is just the k10temp-pci-00c3 PCI Adapter (accor... |
You're asking the wrong question: you've got an overheating system which should be solved by cooling the system. Playing games with process load is going to yield an unsatisfying hack. And since you've got hardware running at its thermal limits, you can fairly expect that problem to worsen.
If you cannot remedy the ha... | Should I care for applications that increase the system Load in order to prevent overheating? |
1,401,220,913,000 |
Above is htop running in a terminal emulator. In the command column, some of the processes have their full path, eg. /usr/bin/python3, and some of them have just the command name, eg. caja, xonsh.
Why is there a difference? Is there anything special about these processes?
I suspect, but I'm not sure, that this might ... |
From the man page of htop:
Command
The full command line of the process (i.e. program name and arguments).
So if you run htop you will see the command without the full path. And if you run /usr/bin/htop -C -u$USER you will see the full path with arguments.
| In the command column of htop, sometimes the full path is displayed, and sometimes it isn't. Why? |
1,401,220,913,000 |
when i do a ps -efT (where -T = Show threads, possibly with SPID column.), i see all the threads have the same PID, which is as expected.
myroot 24958 24958 7942 0 20:20 pts/12 00:00:00 java -jar myapp.jar
myroot 24958 24959 7942 0 20:20 pts/12 00:00:11 java -jar myapp.jar
myroot 24958 24960 7942 0 20:... |
With htop, you want the TGID column (add it through F2 > Columns). It is also available in top with the same name, but I don't know how to configure top.
Linux "processes" are really just thread groups (or task groups), and the "PID" column in top/htop actually shows the thread ID (task ID). The same clone(2) system c... | top shows different pid for threads of same process. How to fix it? |
1,401,220,913,000 |
Let's say I'm running a multicore process. How do I "nice" this via htop after submission?
|
My version of htop displays this as the help line:
F1Help F2Setup F3Search F4Invert F5Tree F6SortBy F7Nice - F8Nice + F9Kill F10Quit
So you would hit F7 to decrease the "nice value", and F8 to increase it
(the former may require special privileges).
| How does one "nice" a PID via htop after the process has begun? |
1,401,220,913,000 |
I recently installed a copy of Ubuntu Server 14.04.2 LTS on a cluster. All appears to be working fine, but a large portion (around half) of our total available RAM is being used. I.e., when I run free I get the following output (the buffers/cache line being the relevant one):
total used free ... |
I figured out that a large portion of the memory usage was, in fact, attributable to inactive memory used by exited processes. The most accurate way to determine how much memory is available post-January 2014 is to look at MemAvailable in /proc/meminfo. You can also see the amount of inactive memory is this file.
| Substantial portion of memory used is not accounted for by user processes |
1,401,220,913,000 |
My node application spawns ffmpeg processes. In htop, there are a bunch of ffmpeg processes I would have expected to have ended but they are still shown in htop. The threads in green are the process that is currently active.
The ones in white are shown using memory, and the time column is not incrementing. Are these ... |
Yes, they're using resources, though its hard to say how much; could be a very small amount.
First thing to check for is just with ps, see if their status is Z (zombie). Which would mean they've exited, but you're not calling wait/waitpid/etc. on them. (Probably not, as I think Node handles this for you).
Otherwise, t... | Are these threads in htop using any resources? |
1,401,220,913,000 |
I have the following script:
#!/bin/bash
/usr/bin/echo q | /usr/bin/htop -C | /usr/bin/aha --line-fix | /usr/bin/html2text -width 999 | /usr/bin/grep -v "F1Help\|xml version=" > htop.txt
It just captures the htop output.
It works fine if I run the script via command line but then if I run it via crontab as root:
15 1... |
You should use grep with the --line-buffered flag, otherwise grep exits after the first match. I don't have a full qualified explanation for this, but that's what made my script work in a similar case.
Found this answer to line-buffer for grep.
Installing a cronjob as root user with htop can result in a error messag... | Running Script via Crontab With Different Result? |
1,401,220,913,000 |
I have the following htop output:
What are the green, blue, and yellow bars respectively in this memory output?
|
When in htop, press F1 for the color key as well as a lot of other information
| How to interpret the colors in htop's memory bar? [duplicate] |
1,644,156,183,000 |
I'm on a system with 48 threads and the view for usage is taking up 4/5 of the vertical screen space. Is there a way to toggle the CPU usage window to just view the active PIDs?
|
You can’t toggle the top part of the screen in its entirety, but you can customize it. Press S to open the setup screen, then the right arrow to move to the column with the CPU entry, and Del to remove it. Esc will return to the main view.
Other variants are possible, for example the “CPU average” meter shows the aver... | Minimize htop thread window? |
1,644,156,183,000 |
lscpu gives:
Thread(s) per core: 2
Core(s) per socket: 32
When running an intensive 32-threads process, why does htop show almost 100% CPU activity on #1-32, but very little activity on #33-64? Why aren't the process's 32 threads distributed evenly among CPUs #1-64?
|
In Linux there is a scheduler.
Some systems will push work to faster/cooler/more-efficient cores but the default behavior is an ordered stack.
The software you are running needs to take advantage of multiple cores for any benefit to be had, so it may be that your workload can only be split into 32 threads by your choi... | Distribution of threads among CPUs? |
1,644,156,183,000 |
I have a binary that I will be running multiple times in parallel, each instance executed with different input from the command line.
I wanted htop to list only these processes so that I can compare the usage of memory based on the cli inputs.
I tried [htop -p ] but this lists only one process even if I give muliple ... |
From man htop:
F4, \
Incremental process filtering: type in part of a process command line and only
processes whose names match will be shown. To cancel filtering, enter the Filter
option again and press Esc.
So, once you start htop, type \test and press Enter to filter in only commands contai... | htop - See/Filter all the instances of a binary |
1,644,156,183,000 |
I am a big fan of htop and would like to know if it is possible to turn it into a widget? I currently use Fedora 23 with Gnome 3.18.5.
Currently I just open a terminal, resize it so show only the resource bars an top info, select always on top, Always on visible workspace and hide the menu bar. Is there any way to cre... |
Yes, Conky lua can be a better option. for you to get a desktop widget. But you need to modify it with htop. conky uses top.
| Turn htop into widget |
1,644,156,183,000 |
You can list the process ID of each widow with this command:
wmctrl -lp
Does there exist a command that shows the running command of each window (kind of like htop has a column for "Command")?
If not, how could you combine commands to ultimately achieve this?
|
This will replace the pid in wmctrl -lp’s output with the corresponding command, if one is found:
wmctrl -lp | awk '{ pid=$3; cmd="ps -o comm= " pid; while ((cmd | getline command) > 0) { sub(" " pid " ", " " command " ") }; close(cmd) } 1'
This obviously won’t work for windows displaying remote processes; it also wi... | List Running Commands of All Windows |
1,644,156,183,000 |
I've applied CPUAffinity to certain systemd services. I've checked Cpus_allowed_list from /proc/PID/status, and it works fine.
Now I want to find out which process is using CPU 0 or CPU 1, how can I do that? the top or htop command does not seem to support such thing.
|
perf top -C 0,1 would give you insight into what is using how much time on the 0. and 1. cores. Attach --sort comm if you don't care about individual functions, but only about process names occupying the CPU.
Run it as root to get insight into kernel usage as well. If you run it as unprivileged user, you will have to ... | Find out which process is using CPU 0 |
1,644,156,183,000 |
I usually monitor my server resource usage. I am using htop for monitoring.
When running htop the memory usage is 1.3G, which is fine for me.
But I tried to view the memory used by each process. For this, I am using ps command. To view the memory used by MySQL, I am runing ps aux | grep mysqld.
It prints these lines:
... |
2845500 is the amount of memory allocated by the process, not the amount it’s using. The latter is given by the next column: 387676. Both values are measured in kilobytes.
| `ps` showing much higher ram usage than `htop` |
1,644,156,183,000 |
From the author of htops answer
https://stackoverflow.com/questions/41224738/how-to-calculate-system-memory-usage-from-proc-meminfo-like-htop/41251290#41251290
I got to know that the total memory in htop is calculated from /proc/meminfo. I think I could crosscheck this in code as well and it checks out.
However compar... |
My guess why the values differ is the following:
htop "180G" value does not include system buffers and other memory used by operating system, while /proc/meminfo reports it as allocated
Digging into https://github.com/htop-dev/htop/blob/541c17c975bc8a4f1f243e568006b0e26ae52c47/linux/LinuxMachine.c#L130 can help to und... | Discrepancy between values in htop and /proc/meminfo |
1,644,156,183,000 |
I'm trying to measure the CPU% consumed by my app on a multi-core machine, meaning htop CPU% reports can go over 100%. I'm trying to get a simple read on CPU usage difference when I run my app in one configuration vs. another, but the change is likely less than 1% CPU and I'm seeing the following "107." for my proces... |
I'm pretty sure that is going to be wasted precision*, in the sense that once you get to four significant digits the sampling would have to be accurate to more than 1 part in 1,000 and for five digits it would have to be more than one part in 10,000. It is very unlikely that the sampling is going to be accurate enough... | Can htop show more than 4 characters of CPU% data? |
1,405,769,071,000 |
I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) .Running ifconfig returns command not found. Also running sudo /sbin/ifconfig returns commmand not found. I am root. The output of
echo $PATH is as below.
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/robbert/.local/bin... |
TL/DR: ifconfig is now ip a. Try ip -s -c -h a.
Your path looks OK, but does not include /sbin, which may be intended.
You were probably looking for the command /sbin/ifconfig.
If this file does not exist (try ls /sbin/ifconfig), the command may just be not installed.
It is part of the package net-tools,
which is not... | ifconfig command not found |
1,405,769,071,000 |
At some point, in some teaching material (from Linux Foundation) on Linux that I came across, the following is mentioned:
ip command is more versatile and more efficient than ifconfig because it uses netlink sockets rather than ioctl system calls.
Can anyone elaborate a bit on this because I cannot understand what's... |
The ifconfig command on operating systems such as FreeBSD and OpenBSD was updated in line with the rest of the operating system. It nowadays can configure all sorts of network interface settings on those operating systems, and handle a range of network protocols. The BSDs provide ioctl() support for these things.
Th... | ip vs ifconfig commands pros and cons |
1,405,769,071,000 |
After substantial research I still haven't found an answer to this query, how can I modify the command 'ifconfig' to show my computer's MAC address?
|
The command that you want on MacOS, FreeBSD, and TrueOS is:
ifconfig -a link
OpenBSD's ifconfig doesn't have this.
Further reading
ifconfig. Mac OS 10 Manual Pages. Apple corporation. 2008.
ifconfig. FreeBSD Manual Pages. 2015.
https://unix.stackexchange.com/a/319354/5132
| How to view your computer's MAC address using 'ifconfig'? |
1,405,769,071,000 |
The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through the "Ifconfig Command - Explained in Detail" tutorial page, which gives a great rundown on most of the information in ifconfig. But it doesn't contain all the ... |
Addresses with global scope are global from the point of view of the host, i.e. they are not restricted to the host or the local link. The host does not care, and does nothing different, in the case the address falls within the ranges specified in RFC1819 (Address Allocation for Private Internets). The "private" addre... | How to understand (the output of) ifconfig or ip addr show [closed] |
1,405,769,071,000 |
I'm trying to configure the network interface on embedded linux using ifconfig:
ifconfig eth0 192.168.0.101 netmask 255.255.255.0
but I don't know how to add the default gateway as an ifconfig parameter,
Any Ideas?
|
ifconfig is not the correct command to do that.
You can use route like in route add default gw 192.168.0.254 for example.
And if route is not present, but ip is, you can use it like this: ip route add default via 192.168.0.254 dev eth0, assuming that 192.168.0.254 is the ip of your gateway
| How to set the Default gateway |
1,405,769,071,000 |
I have a system with two NICs on it. This machine, and a few accompanying devices will be moved and attached to different LANs or sometimes it'll be using dial-up.
eth0:
- 10.x.x.x address space
- no internet gateway
- only a few devices
eth1 (when used):
- 172.16.x.x or 192.168.x.x or other address ... |
The DHCP server configuration is wrong. It must not send a default gateway option when it can't provide routing to the rest of the world. If it does send that option then any client may assume that it can send packets for any off-link destination to the specified default gateway.
So your box is right in using the defa... | Can I prevent a default route being added when bringing up an interface? |
1,405,769,071,000 |
Can someone please elaborate on the difference between the various RX packets fields in ifconfig output?
For example, let's say I run ifconfig and see the following:
eth0 Link encap:Ethernet HWaddr AA:BB:CC:DD:EE:FF
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNI... |
That information is poorly documented. I will tell you what I understand from my experience.
frame counts only misaligned frames, it means frames with a length not divisible by 8. Because of that length is not a valid frame and it is simply discarded.
Meanwhile errors counts CRC errors, too-short frames and too-long ... | What's the difference between "errors:" "dropped:" "overruns:" and "frame:" fields in ifconfig RX packets output? |
1,405,769,071,000 |
I want to create an array in Bash which to contain all active network interfaces.
I have managed to create a for loop printing them but when I try to create the array, it just contains the last lo interface but not the other. This is my code:
#!/bin/bash
for iface in $(ifconfig | cut -d ' ' -f1| tr ':' '\n' | awk NF... |
Here is a solution, assign the list and then add item to it:
#!/bin/bash
array_test=()
for iface in $(ifconfig | cut -d ' ' -f1| tr ':' '\n' | awk NF)
do
printf "$iface\n"
array_test+=("$iface")
done
echo ${array_test[@]}
If you want the output displayed one item per line:
for i in "${array_test[@]}"... | Create an array with all network interfaces in bash |
1,405,769,071,000 |
I'm trying to understand how network drivers work under Linux. This Q&A showed that the network device in Linux isn't represented by a device file. It states that network drivers work with sockets.
For example, this references how to setup the network devices through ioctl calls. ioctl however needs a file descriptor,... |
Let's quickly review device files: In Linux, application programs communicate read and write operations to the kernel through file descriptors. That works great for files, and it turned out that the same API could be used for character devices that produce and consume streams of characters, and block devices that read... | What is a generic socket and how does it relate to a network device? |
1,405,769,071,000 |
I need to create a script that outputs the internal IP address, that is configured as the default Interface.
|
Here's another slightly terser method using procfs (assumes you're using Linux):
default_iface=$(awk '$2 == 00000000 { print $1 }' /proc/net/route)
ip addr show dev "$default_iface" | awk '$1 ~ /^inet/ { sub("/.*", "", $2); print $2 }'
This returns both the IPv4 and (if available) the IPv6 address of the interface. Y... | How to display the IP address of the default Interface with Internet connection? |
1,405,769,071,000 |
How to capture the first IP address that comes from ifconfig command?
ifconfig -a
enw178032: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 100.14.22.12 netmask 255.255.0.0 broadcast 100.14.255.255
inet6 fe80::250:56ff:fe9c:158a prefixlen 64 scopeid 0x20<link>
ether 00:10:56:9c:6... |
It is better avoid using ifconfig for getting an IP address in a scriptas it is deprecated in some distributions (e.g. CentOS and others, do not install it by default anymore).
In others systems, the output of ifconfig varies according to the release of the distribution (e.g. the output/spacing/fields of ifconfig dif... | How to capture the first IP address from a ifconfig command? |
1,405,769,071,000 |
When I run ip to get the ip address, I'm getting
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group defaul... |
Apparently ip broke up the MAC address (now in the ip link (device) interface), and the network ip address. The command ip address is what shows the network addresses,
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
... | How can I get the ipv4 address from `ip link` like I used to see with ifconfig? |
1,405,769,071,000 |
I claim an IPv6 address using ifconfig in a script. This address is then immediately used to listen on a TCP port.
When I write the script like this, it fails because the service is unable to listen:
ifconfig igb0 inet6 2001:db8::10/64 add
service my_service start #fails
However, it succeeds when I do it like this:
i... |
An address can be in several states, tentative is one of them. Having ifconfig wait for an address to leave the state tentative is simply not in accord with the design.
You may configure to use optimistic DAD as defined in RFC 4429. The purpose is to make an address available to applications even if the DAD is not yet... | Let ifconfig wait for IPv6-address to not be tentative |
1,405,769,071,000 |
CentOS 5.9
I'd like to reset the RX/TX counters in ifconfig output for an interface. My understanding is that these counters get reset during a reboot but I'd like to avoid rebooting. Is there another way I can reset that that is non-intrusive to data delivery?
|
This has already been answered by @SuB on Ask Ubuntu. I've adapted the answer for CentOS:
Those counters are kept by the kernel, so your answer depends on how your network card driver is built. Two possible choices:
As a kernel module
Built into the kernel
file itself
In second case, you can not reset counters. In t... | How can I manually reset RX / TX counters in ifconfig output without impacting data delivery? |
1,405,769,071,000 |
In Red Hat Enterprise Linux (RHEL) 8, if someone does ifconfig eth0 hw ether abcd12341234,
all I know is ifconfig and ip -a,
so then is there a way to reliably get the real MAC address of that eth0 interface and if so how? ... other than for example rebooting to a Linux live CD coming from a reliable source to be su... |
This answer is about Linux.
ifconfig is obsolete and doesn't have access to a kernel API able to provide it this information.
This information has been able to be retrieved for a long time with ethtool --show-permaddr. Example (redacted):
# ethtool --show-permaddr eth0
Permanent address: 10:1f:74:32:10:fe
Some board/... | How to find unspoofed MAC address of NIC |
1,405,769,071,000 |
I'm using Debian 8. How do I get my external IP address from a command line? I thought the below command would do the job ...
myuser@myserver:~ $ /sbin/ifconfig $1 | grep "inet\|inet6" | awk -F' ' '{print $2}' | awk '{print $1}'
addr:192.168.0.114
addr:
addr:127.0.0.1
addr:
but as you can see, it is only revealing... |
You mean whatever routable IP your dsl/cable modem/etc. router has?
You need to either query that device OR ask an outside server what IP it sees when you connect to it. The easiest way of doing that is to search google for "what is my ip" and like the calculation searches, it will tell you in the first search result... | How do I get my IP address from the command line? [duplicate] |
1,405,769,071,000 |
I have a MacBook Pro 15" 2018 (Touch Bar). I see it has a lot of network interfaces. I would like to know what they are/what they do. I did some research but I couldn't really figure out all of them, here are their SCNetworkInterfaceInfo.UserDefinedName with information I was able to find from this answer:
ap1: ?
awd... |
For the ones that you don't have:
ap1: Access Point. This is used if you are using your MacBook as a wireless host where you are sharing its connection.
awdl0: Apple Wireless Direct Link. WIFI p2p connection for things like AirDrop, Airplay, etc. Also used for Bluetooth.
llw0: Low-latency WLAN Interface. Used by th... | What are these ifconfig interfaces on macOS |
1,405,769,071,000 |
I create a loopback interface using: #ifconfig lo1 create
The problem is when I reboot the machine I loose my configuration.
I tried to modify the /etc/rc.conf file but I didn't figure the right way to do it.
Can any one tell me how can I do that?
Thanks!
|
You can add in your /etc/rc.conf:
cloned_interfaces="lo1"
ifconfig_lo1="inet a.b.c.d/netmask"
where a.b.c.d is the ip address.
| Create a loopback interface and make it permanent (FreeBSD) |
1,405,769,071,000 |
I want to count the number of entries starting with the string "tun" that I get as output of the command ifconfig.
For example, if this is my output, I want to count to be 2. I tried to play around with grep, but it is still not solved.
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.0.0.1 netm... |
It is possible using either a combination of grep and wc, or using awk
First approach, using grep:
ifconfig | grep "^tun" | wc -l
This will pipe the output of ifconfig through grep, match all lines starting with the string tun (this is accomplished using the "anchor" indicator ^), and then use wc to count the lines w... | Count network interfaces in Bash |
1,405,769,071,000 |
I have linux redhat machine version 6.5
I reboot machine and work as single user mode ,
then I set the network on eth0 with default gw address
/etc/sysconfig/network-script/ifcfg-eth0
but from some reason dg address not appears from netstat -rn after service network restart
my question - can we set default gw addre... |
Single-user mode by definition does not implement networking at startup. To put it in sysV runlevel terms, you want runlevel 2 (local multi-user with networking). You can switch to this with telinit 2.
The standard runlevel definitions are:
0 - Halt the system
1 - Single-user mode
2 - Multi-user with networking, bu... | linux + single user mode and set network |
1,405,769,071,000 |
When I run the command ifconfig in the terminal, I get three results: lo, virbr0, wlo1.
What is wlo1? Is it useful?
|
wlo1 is a wireless network interface (NIC). You can use the command iwlist scan to scan the wireless NICs for available WiFi SSIDs.
Examples
iw is the preferred tool when querying WiFi devices. You can also use NetworkManager's CLI tool, nmcli, or if you're on an older version of Linux, use iwlist.
iw
$ iw dev wlan0 s... | What is 'wlo1' ? |
1,405,769,071,000 |
I am having some trouble with the apparently easy task of creating a virtual network adapter on a physical network card in my Linux system (custom distribution, Debian-based).
If I run
ifconfig eth0:1 10.50.55.130 netmask 255.255.255.0
everything goes just fine: the virtual NIC is silently added and correctly shown b... |
ifconfig is considered obsolete these days. Try to use ip tool instead. All recent distributions should support it, it's part of iproute tool set.
If you just want additional IP address on the interface, use following command:
ip addr add 10.50.55.130/24 dev eth0
And I agree with Johan Myréen's comment bellow your qu... | Virtual NIC: "SIOCSIFFLAGS: Cannot assign requested address" but gets created |
1,405,769,071,000 |
I used Ethernet over USB for some years to connect from my Debian 8 workstation to a Linux device with g_multi running. Today it stopped working, although (everybody says that) "I didn't touch anything".
What I know:
The device is okay (Ethernet over usb is fine on another machine)
USB port and cable is okay (mass st... |
Solved: It's been an predictable network interface name issue, renaming usb0 to something weird. Why this happend all of a sudden after years? I don't know. Maybe for the first time the USB connection was aready established while booting, so the system decided to behave like a multi-netinterface machine?
Anyhow, the ... | Ethernet over USB stopped working: Cannot find device USB0 |
1,405,769,071,000 |
Open-Vswitch creates virtual interfaces, they all have this pattern: s[digit]-eth[digit] For example: s1-eth1, s1-eth2, s12-eth3, s2-eth3 ...
I want to show information of -for example- all interfaces starting with s1 (in our example, it must give s1-eth1 and s1-eth2).
I tried this command, but it shows only the fir... |
For your current ifconfig output:
ifconfig | grep -A7 --no-group-separator '^s1-eth'
| How to show only interfaces starting with a certain pattern |
1,405,769,071,000 |
We have some Red Hat servers, cluster servers for a mabri cluster.
A few questions:
Which Linux command prints the current MTU value? We have not yet configured MTU in the ifcfg file)
What is the default MTU value (assuming that we installed the Red Hat machine from an ISO image)
In which cases do we need to use high... |
In my opinion the question should not be "How to know ...if"; it is more suitable asking "When should I setup Jumbo frames".
As per your questions about MTU/Jumbo frames:
To see your MTU, either ifconfig or ip do:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.249 netmask 255.2... | How to know if my servers should use jumbo frames (MTU) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.