| LINKS |
| COMPUTING
NEWS |





Bash Shell Scripts & Linux Commands.
All commands and their related information and usage examples may be found by a simple 'info' command - eg. info catShutdown or restart linux
Syntax
shutdown [options] when [message]
Options
-c Cancel a shutdown that is in progress.
-f Reboot fast, by suppressing the normal call to fsck when rebooting.
-h Halt the system when shutdown is complete.
-k Print the warning message, but suppress actual shutdown.
-n Perform shutdown without a call to init.
-r Reboot the system when shutdown is complete.
-t sec Ensure a sec-second delay between killing processes and changing the runlevel.
Examples:
Shutdown immediately:
shutdown -h now
Reboot immediately:
shutdown -r now
Shutdown at 8 pm:
shutdown -h 20:00
Shutdown in 10 minutes:
shutdown -h +10
Sample Commands.
cd = Change directory.
Example: cd /home/user/downloads
To change to your user home directory a quicker way is to use the tilde ~ after changing to a new directory we may then use ls to list all the folders and files within.
pwd = Print working directory.
This will simply list the directory you are currently in.
top = Lists all users, processes, memory usage and much more.
mkdir = Create a new directory.
cat = concatenate files and print on the standard output. An example of which is as follows:
cat random.txt | fmt | pr | lpr
The above command will use cat to read the file and output it to standard output, which is piped into the standard input of fmt.
fmt formats the text into neat paragraphs and outputs it to standard output, which is piped into the standard input of pr.
pr splits the text neatly into pages and outputs it to standard output, which is piped into the standard input of lpr.
lpr takes its standard input and sends it to the printer.
grep, egrep, fgrep, rgrep = print lines matching a pattern.
Examples of usage:
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN.
By default, grep prints the matching lines. In addition, three variant programs egrep, fgrep and rgrep are available.
egrep is the same as grep -E.
fgrep is the same as grep -F.
rgrep is the same as grep -r.
Direct invocation as either egrep or fgrep is deprecated, but is provided to allow historical applications that rely on them to run unmodified.


