w

displays info about the users currently logged on and their processes. If user is specified, ~ shows info about this user only.

[options] [user]

The following entries are displayed for each user: login name, tty, remote host, login time, idle time, JCPU, PCPU, and the cmd line of their current process.

JCPU is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.

PCPU is the time used by the current process, named in WHAT field.

Options

--help    -V    --version

-f toggle FROM field (remote host);
-h don't show the header;
-s use short format (omit login time, JCPU, PCPU);
-u ignore username while figuring out curr process and cpu time;

wc

counts bytes, words, lines in text files.

wc [options] [files]

If file spec is missing or '-' is used, ~ gets data from stdin.

ls -l | wc -l

show the number of entries in the current dir (except . / .. and hidden);

wc -c notes.html

wc -m notes.html

count the number of bytes (1) and chars (2) in the specified file; for UTF8 encoding the first number can be greater;

wc -w readme.txt

count words in the specified text file;

Options

--help    --version

-c, --bytes

count bytes;

-m, --chars

count characters;

-l, --lines

count lines;

-L, --max-line-length

show the length of the longest line;

-w, --words

count words;

wget

is non-interactive network downloader.

wget [options] ... [URL] ...

It supports HTTP, HTTPS, FTP and retrieval through HTTP proxies. It has many options, not all of them are described here. Use quotes to specify URL containing '&'.

wget -m http://www.abcd.com

mirror the web-site www.abcd.com;

wget -i updates.lst

download files specified in updates.lst (text file, each line is URL, like http://download.fedora...);

wget -H -r --level=1 -k -p http://www.bum.com

download all pages on the specified site plus 1 (one) level into any other site it links to, convert links in downloaded pages for local access, get all components (images, etc);

wget -c --output-document=movie4.avi http://...

resume download of a large file that was not completely transferred in the previous session;

Some options

-h    --help    -V    --version    -v    --verbose

-a logfile, --append-output=logfile

append messages to the specified log file (create new, if it doesn't exist);

-b, --background

go to the background immediately after startup; without -o output is redirected to wget-log;

-c, --continue

continue getting a partially-downloaded file; should be used to resume download started by the previous instance of ~; current instance in case of a connection break resumes download from the correct point by default;

-H, --span-hosts

enable spanning across hosts when performing recursive retrieving;

-i file, --input-file=file

read URLs from file;

-k, --convert-links

convert links in the downloaded documents to make them suitable for local viewing;

-l n, --level=n

set max depth of recursion (default is 5);

-L, --relative

follow relative links only;

-m, --mirror

turn on options suitable for mirroring (recursion, time-stamping, etc; it is currently equivalent to -r -N -l inf --no-remove-listing;

-N, --timestamping

turn on time-stamping;

-o logfile, --output-file=logfile

log all messages to the specified file (default is stderr), overwrite old;

-O file, --output-document=file

don't save each document separately, but concatenate and write to file;

-p, --page-requisites

download all files required to properly display a HTML page (images, sounds, stylesheets);

-q, --quiet

turn off ~ output;

-r, --recursive

turn on recursive retrieving;

-t n, --tries=n

set the number of retries to n; 0 means infinite (also inf), default is 20 except fatal errors (404, etc);

-w n, --wait=n

wait n sec between the retrievals;

--no-proxy

don't use proxy, even if the appropriate *_proxy env variable is defined;

--user=user

--password=pass

set username / password for both HTTP and FTP file retrieval; there are also separate:

--ftp-user --ftp-password
--http-user --http-password
--proxy-user   --proxy-password

whatis

Each man page contains a short one-line page description, and whatis can find and display this description using a set of index databases updated by mandb program (usually auto).

whatis  [options] name ...

With the appropriate options (see below) name can include wildcards and regular expressions. However, sometimes it may be necessary to quote names or escape (\) special chars to stop shell from interpreting them.

Some options

-?    --help    --usage    -V    --version    -v    --verbose

-r, --regex

interpret each name as a regular expression, and try to match any part of a page name; this option slows ~ down a little bit;

-w, --wildcard

interpret each name as a pattern containing shell-style wildcards; for a match to be made, an expanded name must match the entire page name; this option slows ~ down a little bit;

-l, --long

do not trim output to the terminal width (normally, output is truncated to the terminal width to avoid ugly display of the poorly-written NAME sections);

whereis

locates source, binary and manuals sections for the specified files.

whereis [-bmsu] [-BMS dir ... -f] filename ...

The filename is first stripped of leading pathname components and any single trailing extension, then searched in standard Linux places.

whereis rar

search for rar binary, source, and manual sections everywhere (i.e., in all standard Linux places);

whereis -b -B /usr/bin -f wget

search for wget executable file in /usr/bin only;

whereis -B /usr/bin -f wget

search for wget executable in /usr/bin, also search for source and manual sections in standard places;

Options
-b search only for binaries;
-m search only for manual sections;
-s search only for sources;
-u search for unusual entries (a file is unusual if it does not have one entry of each requested type);
-B change or otherwise limit places to be searched for binaries;
-M change or otherwise limit places to be searched for manual sections;
-S change or otherwise limit places to be searched for sources;
-f terminate the last dir list and signal the start of file names (must be used with -B, -M, -S);

which

locates the specified command and shows the pathname of its executable file.

which [-a] command ...

~ returns the pathnames of the files (or links) which would be executed in the current env, had the command (or commands) been given as a command (or commands) in a strictly POSIX-conformant shell. It does this by searching the paths in the PATH env var for executable files matching the names of the commands given to ~ as args. Note that ~ does not follow symlinks.

which gcc

shows the full path of GNU C compiler that will be started by default;

which -a sqlplus

shows the full paths of all versions of Oracle SQL*Plus, if any; even if ~ shows nothing, it does not mean that subj is totally missing, it only means subj cannot be found using PATH;

Options
-a display all matching pathnames of each matching command;
Exit status
0 all specified cmds are found and executable;
1 one or more specified cmds is non-existent or not executable;
2 an invalid option was specified;

who

shows who is logged on.

who [options] [file | arg1 | arg2]

By default /var/run/utmp is used to get info.

who -b

show the boot time (when the system was started);

who am i

show who is logged on this terminal (note, that this is not equivalent to whoami);

Options

--help    --version

-a, --all

same as -b -d --login -p -r -t -T -u;

-b, --boot

time of last system boot;

-d, --dead

show dead processes;

-H, --heading

show column headers;

-i, --idle

add idle time as hours:minutes;

-l, --login

show system login processes;

-m show only hostname and user associated with stdin;

-p, --process

print active processes spawned by init;

-q, --count

show login names and num of users logged on;

-r, --runlevel

show current runlevel;

-s, --short

show only name, line and time (default);

-t, --time

show last system clock change;

-T, --mesg, -w, --message, --writable

add user's message status as +, -, ?;

-u, --users

list users logged in;