- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: commandline
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2003 08:54 PM
тАО05-09-2003 08:54 PM
commandline
2.what is the command line to print the usernames that have active processes running on the system.The commandline should print the user names only once(no repetition).
thanks in advance....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2003 11:22 PM
тАО05-09-2003 11:22 PM
Re: commandline
Hi,
1-
ls -ahl (on RedHat)
2-
ps -euf | more
ps -eu | more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2003 12:40 PM
тАО05-10-2003 12:40 PM
Re: commandline
You were tough with Khalid, who did give you the corract answer :-))
'ls' is command for listing current directory, and you had arguments with '-' to precise the command :
-a says to show also hidden files, starting with . (you didn't precise if you needed to see only those file, so we assume that you want to see them all)
-h is not necessary, but asks that sizes are printed in human readable format (kb, mb instead of bytes only)
-l uses long listing format.
He left behind 'r', which completes your need by printing those files in reverse order. Your answer comes to :
ls -alr
If you want only hidden files to be sorted, then you have to go a little further, on sorting only those files by the 'grep' command :
'ls -alr | grep .'
Same as before, sorting only what include that hidden code, '.'.
Same for second command : I would use a slight variation :
ps command of course, to list processes running.
I would add :
-a to list them all (even those not belonging to you)
-u to sort by user
-x to select processes without controlling ttys.
I would use for your confort a redirection to 'sort', to have them once (no repetition), with -d for example to get them in alphabetical order.
Your command becomes :
'ps -aux | sort -d'.
Note that you can precise on 'ps' '--user' to select by effective user name or ID.
RGDS
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2003 07:58 AM
тАО05-11-2003 07:58 AM
Re: commandline
A general piece of advice regarding unix commands. Try using man, it is a beautiful thing and one of the things that can get you adjusted to linux command line (presumably you are getting wheened off windoze).
e.g. type this at command prompt:
man ls
Tells you everything you needed. Between man and an understanding of pipes, |, the world is your oyster.
peace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2003 09:05 PM
тАО05-11-2003 09:05 PM
Re: commandline
Hi,
// No Points Please //
Thanks Jerome.... Good detailed answer.