1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Linux Newbie Administrator Guide


6.4 System info


Print working directory, i.e., display the name of my current directory on the screen.


Print the name of the local host (the machine on which I am working). Use netconf (as root) to change the name of the machine.


Print my login name.

id username

Print user id (uid) and his/her group id (gid), effective id (if different than the real id) and the supplementary groups.


Print the operating system current date, time and timezone. For an ISO standard format, I have to use: date -Iseconds

I can change the date and time to 2000-12-31 23:57 using this command: date 123123572000

or using these two commands (easier to remember):

date --set 2000-12-31

date --set 23:57:00

To set the hardware (BIOS) clock from the system (Linux) clock, I can use the command (as root): setclock

The international (ISO 8601) standard format for all-numeric date/time has the form: 2001-01-31 (as in Linux default "C" localization). You can be more precise if you wish using, for example: 2001-01-31 23:59:59.999-05:00 (representing I millisecond before February 2001, in a timezone which is 5 hours behind the Universal Coordinated Time (UTC)) . The most "kosher" representation of the same point in time could be: 20010131T235959,999-0500. See the standard at ftp://ftp.qsl.net/pub/g1smd/8601v03.pdf.


Determine the amount of time that it takes for a process to complete + other process accounting. Don't confuse it with the date command (see previous entry). E.g. I can find out how long it takes to display a directory content using: time ls. Or I can test the time function with time sleep 10 (time the commands the does nothing for 10 seconds).



(two commands, use either). Obtain date/time from the computer hardware (real time, battery-powered) clock. You can also use one of this commands to set the hardware clock, but setclock may be simplier (see 2 commands above). Example: hwclock --systohc --utc sets the hardware clock (in UTC) from the system clock.


Determine the users logged on the machine.


Determine who is logged on the system, find out what they are doing, their processor ussage, etc. Handy security command.

rwho -a

(=remote who) Determine users logged on other computers on your network. The rwho service must be enabled for this command to run. If it isn't, run setup (RedHat specific) as root to enable "rwho".

finger user_name

System info about a user. Try: finger root . One can use finger with any networked computer that exposes the finger service to the world, e.g., I can do (try): finger @finger.kernel.org


Show listing of users last logged-in on your system. Really good idea to check it from time to time as a security measure on your system.


("=last bad") Show the last bad (unsuccessful) login attempts on my system. It did not work on my system, so got it started with: touch /var/log/btmp

"There's a good reason why /var/log/btmp isn't available on any sane set-up - it's a world-readable file containing login mistakes. Since one of the most common login mistakes is to type the password instead of the username, /var/log/btmp is a gift to crackers." (Thanks to Bruce Richardson). It appears the problem can be solved by changing the file permissions so only root can use "lastb":

chmod o-r /var/log/btmp

history | more

Show the last (1000 or so) commands executed from the command line on the current account. The "| more" causes the display to stop after each screen-full. To see what another user was doing on your system, login as "root" and inspect his/her "history". The history is kept in the file .bash_history in the user home directory (so yes, it can be modified or erased).


Run the most recent command from my bash history commands that starts with the string "comman". This is usefull for re-running often the same, command which may be complicated to type. For

* License

* Linux Newbie Administrator Guide Index

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.