0% found this document useful (0 votes)
46 views3 pages

26.8 System Resource Commands

The document provides information about several system resource commands in Linux/Unix including date, df, du, hostname, passwd, whereis, which, who, cal, and bc. It describes what each command is used for, provides examples of syntax and usage, and explains what information is displayed by each command such as current date/time, disk usage summary, disk usage by file, host name, set or change password, locate program files and binaries, locate command path, list logged in users, display calendar, and use a calculator program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

26.8 System Resource Commands

The document provides information about several system resource commands in Linux/Unix including date, df, du, hostname, passwd, whereis, which, who, cal, and bc. It describes what each command is used for, provides examples of syntax and usage, and explains what information is displayed by each command such as current date/time, disk usage summary, disk usage by file, host name, set or change password, locate program files and binaries, locate command path, list logged in users, display calendar, and use a calculator program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

System Resources Commands:

Command/Syntax What it will do


date report the current date and time
df report the summary of disk blocks and inodes free and in use
du report amount of disk space in use+
hostname/uname display or set (super-user only) the name of the current machine
passwd set or change your password
whereis report the binary, source, and man page locations for the command
which reports the path to the command or the shell alias in use
who or w report who is logged in and what processes are running
cal displays a calendar
bc Calculator

df - summarize disk block and file usage


df is used to report the number of disk blocks and inodes used and free for each file system. The
output format and valid options are very specific to the OS and program version in use.

Syntax
df [options] [resource]
Common Options
-l local file systems only (SVR4)
-k report in kilobytes (SVR4)

du - report disk space in use


du reports the amount of disk space in use for the files or directories you specify.

Syntax
du [options] [directory or file]
Common Options
-a display disk usage for each file, not just subdirectories
-s display a summary total only
-k report in kilobytes (SVR4)

who - list current users


who reports who is logged in at the present time.

Syntax
who [am i]
Examples
> who
wmtell ttyp1 Apr 21 20:15 (apple.acs.ohio-s)
fbwalk ttyp2 Apr 21 23:21 (worf.acs.ohio-st)
stwang ttyp3 Apr 21 23:22 (127.99.25.8)

whereis - report program locations


whereis reports the filenames of source, binary, and manual page files associated with command(s).

Syntax
whereis [options] command(s)
Common Options
-b report binary files only
-m report manual sections only
-s report source files only
Examples
> whereis Mail
Mail: /usr/ucb/Mail /usr/lib/Mail.help /usr/lib/Mail.rc /usr/man/man1/Mail.1
> whereis -b Mail
Mail: /usr/ucb/Mail /usr/lib/Mail.help /usr/lib/Mail.rc
> whereis -m Mail
Mail: /usr/man/man1/Mail.1

which - report the command found


which will report the name of the file that is be executed when the command is invoked. This will be
the full path name or the alias that’s found first in your path.

Syntax
which command(s)
example--
> which Mail
/usr/ucb/Mail

hostname/uname –n = name of machine


hostname (uname -n on SysV) reports the host name of the machine the user is logged into, e.g.:
> hostname
yourcomputername

uname has additional options to print information about system hardware type and software version.
date - current date and time
date displays the current data and time. A superuser can set the date and time.

Syntax
date [options] [+format]
Common Options
-u use Universal Time (or Greenwich Mean Time)
+format specify the output format
%a weekday abbreviation, Sun to Sat
%h month abbreviation, Jan to Dec
%j day of year, 001 to 366
%n <new-line>
%t <TAB>
%y last 2 digits of year, 00 to 99
%D MM/DD/YY date
%H hour, 00 to 23
%M minute, 00 to 59
%S second, 00 to 59
%T HH:MM:SS time
Examples
> date
Mon Jun 10 09:01:05 EDT 1996
> date -u
Mon Jun 10 13:01:33 GMT 1996
> date +%a%t%D
Mon 06/10/96
> date '+%y:%j'
96:162

You might also like