Full username in topUser not listed in /etc/passwdWhat does SWAP mean in top?top: how to cancel current...
How to get a plain text file version of a CP/M .BAS (M-BASIC) program?
Please, smoke with good manners
What does it mean to express a gate in Dirac notation?
Why do Computer Science majors learn Calculus?
How can the Zone of Truth spell be defeated without the caster knowing?
How to verbalise code in Mathematica?
Does the sign matter for proportionality?
What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?
How come there are so many candidates for the 2020 Democratic party presidential nomination?
How to stop co-workers from teasing me because I know Russian?
Is there a way to get a compiler for the original B programming language?
French for 'It must be my imagination'?
Does a semiconductor follow Ohm's law?
With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?
Reducing vertical space in stackrel
Exchange,swap or switch
Meaning of Bloch representation
Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?
Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?
Who is the Umpire in this picture?
Does Gita support doctrine of eternal cycle of birth and death for evil people?
How did Captain America manage to do this?
Packing rectangles: Does rotation ever help?
How do I reattach a shelf to the wall when it ripped out of the wall?
Full username in top
User not listed in /etc/passwdWhat does SWAP mean in top?top: how to cancel current command?Start top with particular sortingJava process seems to always be bound to a single CPUDisplay only certain parameters in topterminate 'top' command after one iteration - Unixtop cpu output interpretationtop, top&, top & commands in linuxtop command not workingclear the filters added in `top`
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
On our systems user names can be up to 20 characters long. But the top commands only displays the first 8 characters.
How can I configure top to display the whole user name?
At the moment we use: top procps version 3.2.8 (linux)
But a different top implementation could be installed.
The oldest system we need to support is this:
Linux foohost 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux
top
add a comment |
On our systems user names can be up to 20 characters long. But the top commands only displays the first 8 characters.
How can I configure top to display the whole user name?
At the moment we use: top procps version 3.2.8 (linux)
But a different top implementation could be installed.
The oldest system we need to support is this:
Linux foohost 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux
top
1
What platform are you on? Useuname -a
– Kevdog777
Dec 13 '13 at 9:23
1
@Kevdog777 I updated the question, and addeduname -a
– guettli
Dec 13 '13 at 11:36
add a comment |
On our systems user names can be up to 20 characters long. But the top commands only displays the first 8 characters.
How can I configure top to display the whole user name?
At the moment we use: top procps version 3.2.8 (linux)
But a different top implementation could be installed.
The oldest system we need to support is this:
Linux foohost 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux
top
On our systems user names can be up to 20 characters long. But the top commands only displays the first 8 characters.
How can I configure top to display the whole user name?
At the moment we use: top procps version 3.2.8 (linux)
But a different top implementation could be installed.
The oldest system we need to support is this:
Linux foohost 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux
top
top
edited Dec 13 '13 at 11:34
guettli
asked Dec 13 '13 at 9:03
guettliguettli
158722
158722
1
What platform are you on? Useuname -a
– Kevdog777
Dec 13 '13 at 9:23
1
@Kevdog777 I updated the question, and addeduname -a
– guettli
Dec 13 '13 at 11:36
add a comment |
1
What platform are you on? Useuname -a
– Kevdog777
Dec 13 '13 at 9:23
1
@Kevdog777 I updated the question, and addeduname -a
– guettli
Dec 13 '13 at 11:36
1
1
What platform are you on? Use
uname -a– Kevdog777
Dec 13 '13 at 9:23
What platform are you on? Use
uname -a– Kevdog777
Dec 13 '13 at 9:23
1
1
@Kevdog777 I updated the question, and added
uname -a– guettli
Dec 13 '13 at 11:36
@Kevdog777 I updated the question, and added
uname -a– guettli
Dec 13 '13 at 11:36
add a comment |
3 Answers
3
active
oldest
votes
Looking at the sources of top, it seems that there's a hardcoded maximum of 8 chars:
1223 static FLD_t Fieldstab[] = {
1229 keys head fmts width scale sort desc lflg
1230 ------ ----------- ------- ------ ----- ----- ---------------------- -------- */
1235 { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER },
The fmts colum is a printf format string. %-8.8s means left padded string of minimum and maximum size of 8.
add a comment |
It looks like there is currently no way to do this as you request with terminal programs. What you ask is not new and actually is on htop feature request list, but it has been that way for a year and a half and no milestone has been set to implement this yet. No sign of that at all for top. 2 options could be:
1) Two terminals
You can tell top (e.g. you can use f as it runs) to show the UID not the name. If you have split your terminal in 2 fields such as with terminator or screen then you can run top in the upper larger screen and query for the username in the lower e.g.
awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd
substituting whatever UID you want to look at for 1000. Of course, you could wrap it in a very small bash script so you should only type a few letters of your script name and the UID. Also if you are talking about non local users you can use getent passwd as input for awk instead of /etc/passwd file - like so:
getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}'
2) ps option
You could use ps to give you 15 most CPU heavy processes and who they belong to. You can vary the number of processes of course.
ps -ef | egrep -v "STIME|$LOGNAME" | sort -k4 -r | head -n 15 | colrm 100
Explanation:
ps -ef gives you all processes
egrep -v "STIME|$LOGNAME" removes the header line
sort -k4 -r sorts by the CPU column in reverse (biggest on top)
head -n 15 gives you first 15 lines of above
colrm 100 restricts each line of output to 100 characters
The last command is useful as some programs sch as google chrome have very long options lines after the command, so your output will be difficult to read if you don't cut the lines.
add a comment |
Can't really help you with older 3.2.x versions of procps but in newer ones (e.g. definitely 3.3.10 and I think it went back to 3.3.4) you can adjust the size of fixed columns. The key you are looking for is capital X.
To use this feature, first start top. Ideally, but not essential, you will "make room" for your column by either removing other columns or expanding your terminal. Use f to bring up your field list and deselect what you don't need. Once you are happy with field selection, hit q to get back to the process list.
Then use X command which asks you for how much to increase the width, generally -1 works ok. You might get this strange "column growing" effect but after a few refeshes you can see the full username.
PID USER PR VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3775 libvirt-qemu 20 4667404 960508 14724 S 6.1 5.9 188:04.01 qemu-syste+
3825 Debian-gdm 20 1516152 114924 64404 S 2.7 0.7 1:52.09 gnome-shell
Notice that the command name is now truncated (ends with a +) because our username is longer and has pushed the other columns to the right. Whether or not you think this a a good idea depends what you are looking for.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f104983%2ffull-username-in-top%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Looking at the sources of top, it seems that there's a hardcoded maximum of 8 chars:
1223 static FLD_t Fieldstab[] = {
1229 keys head fmts width scale sort desc lflg
1230 ------ ----------- ------- ------ ----- ----- ---------------------- -------- */
1235 { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER },
The fmts colum is a printf format string. %-8.8s means left padded string of minimum and maximum size of 8.
add a comment |
Looking at the sources of top, it seems that there's a hardcoded maximum of 8 chars:
1223 static FLD_t Fieldstab[] = {
1229 keys head fmts width scale sort desc lflg
1230 ------ ----------- ------- ------ ----- ----- ---------------------- -------- */
1235 { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER },
The fmts colum is a printf format string. %-8.8s means left padded string of minimum and maximum size of 8.
add a comment |
Looking at the sources of top, it seems that there's a hardcoded maximum of 8 chars:
1223 static FLD_t Fieldstab[] = {
1229 keys head fmts width scale sort desc lflg
1230 ------ ----------- ------- ------ ----- ----- ---------------------- -------- */
1235 { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER },
The fmts colum is a printf format string. %-8.8s means left padded string of minimum and maximum size of 8.
Looking at the sources of top, it seems that there's a hardcoded maximum of 8 chars:
1223 static FLD_t Fieldstab[] = {
1229 keys head fmts width scale sort desc lflg
1230 ------ ----------- ------- ------ ----- ----- ---------------------- -------- */
1235 { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER },
The fmts colum is a printf format string. %-8.8s means left padded string of minimum and maximum size of 8.
edited 1 hour ago
Jeff Schaller♦
45.5k1165148
45.5k1165148
answered Dec 13 '13 at 10:25
rzymekrzymek
42135
42135
add a comment |
add a comment |
It looks like there is currently no way to do this as you request with terminal programs. What you ask is not new and actually is on htop feature request list, but it has been that way for a year and a half and no milestone has been set to implement this yet. No sign of that at all for top. 2 options could be:
1) Two terminals
You can tell top (e.g. you can use f as it runs) to show the UID not the name. If you have split your terminal in 2 fields such as with terminator or screen then you can run top in the upper larger screen and query for the username in the lower e.g.
awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd
substituting whatever UID you want to look at for 1000. Of course, you could wrap it in a very small bash script so you should only type a few letters of your script name and the UID. Also if you are talking about non local users you can use getent passwd as input for awk instead of /etc/passwd file - like so:
getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}'
2) ps option
You could use ps to give you 15 most CPU heavy processes and who they belong to. You can vary the number of processes of course.
ps -ef | egrep -v "STIME|$LOGNAME" | sort -k4 -r | head -n 15 | colrm 100
Explanation:
ps -ef gives you all processes
egrep -v "STIME|$LOGNAME" removes the header line
sort -k4 -r sorts by the CPU column in reverse (biggest on top)
head -n 15 gives you first 15 lines of above
colrm 100 restricts each line of output to 100 characters
The last command is useful as some programs sch as google chrome have very long options lines after the command, so your output will be difficult to read if you don't cut the lines.
add a comment |
It looks like there is currently no way to do this as you request with terminal programs. What you ask is not new and actually is on htop feature request list, but it has been that way for a year and a half and no milestone has been set to implement this yet. No sign of that at all for top. 2 options could be:
1) Two terminals
You can tell top (e.g. you can use f as it runs) to show the UID not the name. If you have split your terminal in 2 fields such as with terminator or screen then you can run top in the upper larger screen and query for the username in the lower e.g.
awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd
substituting whatever UID you want to look at for 1000. Of course, you could wrap it in a very small bash script so you should only type a few letters of your script name and the UID. Also if you are talking about non local users you can use getent passwd as input for awk instead of /etc/passwd file - like so:
getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}'
2) ps option
You could use ps to give you 15 most CPU heavy processes and who they belong to. You can vary the number of processes of course.
ps -ef | egrep -v "STIME|$LOGNAME" | sort -k4 -r | head -n 15 | colrm 100
Explanation:
ps -ef gives you all processes
egrep -v "STIME|$LOGNAME" removes the header line
sort -k4 -r sorts by the CPU column in reverse (biggest on top)
head -n 15 gives you first 15 lines of above
colrm 100 restricts each line of output to 100 characters
The last command is useful as some programs sch as google chrome have very long options lines after the command, so your output will be difficult to read if you don't cut the lines.
add a comment |
It looks like there is currently no way to do this as you request with terminal programs. What you ask is not new and actually is on htop feature request list, but it has been that way for a year and a half and no milestone has been set to implement this yet. No sign of that at all for top. 2 options could be:
1) Two terminals
You can tell top (e.g. you can use f as it runs) to show the UID not the name. If you have split your terminal in 2 fields such as with terminator or screen then you can run top in the upper larger screen and query for the username in the lower e.g.
awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd
substituting whatever UID you want to look at for 1000. Of course, you could wrap it in a very small bash script so you should only type a few letters of your script name and the UID. Also if you are talking about non local users you can use getent passwd as input for awk instead of /etc/passwd file - like so:
getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}'
2) ps option
You could use ps to give you 15 most CPU heavy processes and who they belong to. You can vary the number of processes of course.
ps -ef | egrep -v "STIME|$LOGNAME" | sort -k4 -r | head -n 15 | colrm 100
Explanation:
ps -ef gives you all processes
egrep -v "STIME|$LOGNAME" removes the header line
sort -k4 -r sorts by the CPU column in reverse (biggest on top)
head -n 15 gives you first 15 lines of above
colrm 100 restricts each line of output to 100 characters
The last command is useful as some programs sch as google chrome have very long options lines after the command, so your output will be difficult to read if you don't cut the lines.
It looks like there is currently no way to do this as you request with terminal programs. What you ask is not new and actually is on htop feature request list, but it has been that way for a year and a half and no milestone has been set to implement this yet. No sign of that at all for top. 2 options could be:
1) Two terminals
You can tell top (e.g. you can use f as it runs) to show the UID not the name. If you have split your terminal in 2 fields such as with terminator or screen then you can run top in the upper larger screen and query for the username in the lower e.g.
awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd
substituting whatever UID you want to look at for 1000. Of course, you could wrap it in a very small bash script so you should only type a few letters of your script name and the UID. Also if you are talking about non local users you can use getent passwd as input for awk instead of /etc/passwd file - like so:
getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}'
2) ps option
You could use ps to give you 15 most CPU heavy processes and who they belong to. You can vary the number of processes of course.
ps -ef | egrep -v "STIME|$LOGNAME" | sort -k4 -r | head -n 15 | colrm 100
Explanation:
ps -ef gives you all processes
egrep -v "STIME|$LOGNAME" removes the header line
sort -k4 -r sorts by the CPU column in reverse (biggest on top)
head -n 15 gives you first 15 lines of above
colrm 100 restricts each line of output to 100 characters
The last command is useful as some programs sch as google chrome have very long options lines after the command, so your output will be difficult to read if you don't cut the lines.
answered Dec 13 '13 at 11:16
r0bertsr0berts
4001215
4001215
add a comment |
add a comment |
Can't really help you with older 3.2.x versions of procps but in newer ones (e.g. definitely 3.3.10 and I think it went back to 3.3.4) you can adjust the size of fixed columns. The key you are looking for is capital X.
To use this feature, first start top. Ideally, but not essential, you will "make room" for your column by either removing other columns or expanding your terminal. Use f to bring up your field list and deselect what you don't need. Once you are happy with field selection, hit q to get back to the process list.
Then use X command which asks you for how much to increase the width, generally -1 works ok. You might get this strange "column growing" effect but after a few refeshes you can see the full username.
PID USER PR VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3775 libvirt-qemu 20 4667404 960508 14724 S 6.1 5.9 188:04.01 qemu-syste+
3825 Debian-gdm 20 1516152 114924 64404 S 2.7 0.7 1:52.09 gnome-shell
Notice that the command name is now truncated (ends with a +) because our username is longer and has pushed the other columns to the right. Whether or not you think this a a good idea depends what you are looking for.
add a comment |
Can't really help you with older 3.2.x versions of procps but in newer ones (e.g. definitely 3.3.10 and I think it went back to 3.3.4) you can adjust the size of fixed columns. The key you are looking for is capital X.
To use this feature, first start top. Ideally, but not essential, you will "make room" for your column by either removing other columns or expanding your terminal. Use f to bring up your field list and deselect what you don't need. Once you are happy with field selection, hit q to get back to the process list.
Then use X command which asks you for how much to increase the width, generally -1 works ok. You might get this strange "column growing" effect but after a few refeshes you can see the full username.
PID USER PR VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3775 libvirt-qemu 20 4667404 960508 14724 S 6.1 5.9 188:04.01 qemu-syste+
3825 Debian-gdm 20 1516152 114924 64404 S 2.7 0.7 1:52.09 gnome-shell
Notice that the command name is now truncated (ends with a +) because our username is longer and has pushed the other columns to the right. Whether or not you think this a a good idea depends what you are looking for.
add a comment |
Can't really help you with older 3.2.x versions of procps but in newer ones (e.g. definitely 3.3.10 and I think it went back to 3.3.4) you can adjust the size of fixed columns. The key you are looking for is capital X.
To use this feature, first start top. Ideally, but not essential, you will "make room" for your column by either removing other columns or expanding your terminal. Use f to bring up your field list and deselect what you don't need. Once you are happy with field selection, hit q to get back to the process list.
Then use X command which asks you for how much to increase the width, generally -1 works ok. You might get this strange "column growing" effect but after a few refeshes you can see the full username.
PID USER PR VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3775 libvirt-qemu 20 4667404 960508 14724 S 6.1 5.9 188:04.01 qemu-syste+
3825 Debian-gdm 20 1516152 114924 64404 S 2.7 0.7 1:52.09 gnome-shell
Notice that the command name is now truncated (ends with a +) because our username is longer and has pushed the other columns to the right. Whether or not you think this a a good idea depends what you are looking for.
Can't really help you with older 3.2.x versions of procps but in newer ones (e.g. definitely 3.3.10 and I think it went back to 3.3.4) you can adjust the size of fixed columns. The key you are looking for is capital X.
To use this feature, first start top. Ideally, but not essential, you will "make room" for your column by either removing other columns or expanding your terminal. Use f to bring up your field list and deselect what you don't need. Once you are happy with field selection, hit q to get back to the process list.
Then use X command which asks you for how much to increase the width, generally -1 works ok. You might get this strange "column growing" effect but after a few refeshes you can see the full username.
PID USER PR VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3775 libvirt-qemu 20 4667404 960508 14724 S 6.1 5.9 188:04.01 qemu-syste+
3825 Debian-gdm 20 1516152 114924 64404 S 2.7 0.7 1:52.09 gnome-shell
Notice that the command name is now truncated (ends with a +) because our username is longer and has pushed the other columns to the right. Whether or not you think this a a good idea depends what you are looking for.
answered Nov 18 '15 at 7:33
Craig SmallCraig Small
50626
50626
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f104983%2ffull-username-in-top%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What platform are you on? Use
uname -a– Kevdog777
Dec 13 '13 at 9:23
1
@Kevdog777 I updated the question, and added
uname -a– guettli
Dec 13 '13 at 11:36