Linux System Commands

Command

cal

Purpose

Displays a calendar

Synopsis

cal [-mjy] [month [year]]



Description:

The cal command displays a simple calendar. If arguments are not specified, the current month is displayed.


Options:

-m

Display Monday as the first day of the week.

-j

Display julian dates (clays one-based, numbered from January 1).

-y

Display a calendar for the current year.


A single parameter specifies the year (1 - 9999) to be displayed; note the year must be fully specified: "cal 89" will not display a calendar for 1989. Two parameters denote the month (1 -12) and year. If no parameters are specified, the current month's calendar is displayed.


Command

date

Purpose

Print or set system date and time

Synopsis

date [OPTION]... [+FORMAT]



Description:

The date command with no arguments prints the current time and date, in the format of the %c directive (described below).



Options:

-d

Print date in the format d days or m months d days

-s

Set date

-u

Set date to GMT



Command

du

Purpose

Estimate file space usage

Synopsis

du [OPTION] ... [FILE] ...



Description:

The du command reports the amount of disk space used by the specified files and for each subdirectory (of directory arguments).


With no arguments, du reports the disk space for the current directory. Normally the disk space is printed in units of 1024 bytes.


Options:

-a

Show counts for all files, not just directories.

-b

Print sizes in bytes, overriding the default block size.

-c

Print a grand total of all arguments after all arguments have been processed. This can be used to find out the total disk usage of a given set of files or directories.

-h

Append a size letter such as 'M' for megabytes to each size. Powers of 1024 are used, not 1000; 'M' stands for 1,048,576 bytes.

-k

Print sizes in 1024-byte blocks, overriding the default block size

-m

Print sizes in megabyte (that is, 1,048,576-byte) blocks.



Command

ps

Purpose

Report process status

Synopsis

ps [options]


Description:

The ps command gives a snapshot of the current processes. If you want a repetitive update of this status, use top. This man page documents the /proc-based version of ps, or tries to.


Options:

-A

Selects all processes

-e

Selects all processes

-T

Select all processes on this terminal

-a

Select ail processes on a terminal, including those of other users

-C

Select by command name

-p

Select by PID

-t

Select by tty

-u

Select by effective user ID (supports names)

-U

Select processes for specified users

-l

Long format



Command

kill

Purpose

Terminate a process

Synopsis

kill [options] IDs


Description:

The kill command sends the specified signal to the specified process. If no signal is specified, the TERM signal is sent.


Options:

-p

Specify that kill should only print the process id (pid) of the named process, and should not send it a signal.

-l

Print a list of signal names. These are found in /usr/include/linux/signal.h



Command

killall

Purpose

Kill processes by name

Synopsis

killall [option] name


Description:

The killall command sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.


Options:

-e

Require an exact match for very long names. If a command name is longer than 15 characters, the full name may be unavailable (i.e. it is swapped out). In this case, killall will kill everything that matches within the first 15 characters. With -e, such entries are skipped, killall prints a message for each skipped entry if -v is specified in addition to -e,

-i

Interactively ask for confirmation before killing.

-l

List all known signal names.

-q

Do not complain of no processes were killed.

-v

Report if the signal was successfully sent.

-V

Display version information.

-w

Wait for all killed processes to die.



Command

uptime

Purpose

Tells how long the system has been running

Synopsis

uptime


Description:

The uptime command gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.


Command

uname

Purpose

Prints system information

Synopsis

uname [OPTION] ...


Description:

The uname command prints information about the machine and operating system it is run on. If no options are given, uname acts as if the ­ -s option were given.


Options:

-a

Print all of the below information.

-m

Print the machine (hardware) type.

-n

Print the machine's network node hostname.

-p

Print the machine's processor type

-r

Print the operating system release.

-s

Print the operating system name.

-v

Print the operating system version.



Command

hostname

Purpose

Print or set system name

Synopsis

hostname [NAME]


Description:

The hostname command with no arguments prints the name of the current host system . With one argument, it sets the current host name to the specified string. You must have appropriate privileges to set the host name.

Command

who

Purpose

Print effective user id

Synopsis

- -


Description:

The whoami command prints the user name associated with the current effective user id. It is equivalent to the command id -un .



Command

whoami

Purpose

Print who is currently logged in

Synopsis

who [OPTION] [FILE] [am i]


Description:

The who command prints information about users who are currently logged on.

If given no non-option arguments, 'who' prints the following information for each user currently logged on: login name, terminal line, login time, and remote hostname or X display.


Options:

-m

Same as who am i .

-q

Print only the login names and the number of users logged on Overrides all other options.

-s

Ignored; for compatibility with other versions of who .



Command

users

Purpose

Print login names of users currently logged in

Synopsis

users


Description:

The users command prints on a single line a blank-separated list of user names of users currently logged in to the current host.



Command

groups

Purpose

Print names of group(s) a user is in

Synopsis

groups [username]...


Description:

The groups command prints the names of the primary and any supplementary groups for each given USERNAME, or the current process if no names are given. If names are given, the name of each user is printed before the list of that user's groups.


The group lists are equivalent to the output of the command id –Gn.

Showcases

Background Image

Header Color

:

Content Color

: