Adviser to Unix Commands Assorted
25 August 20:25
sync address anamnesis buffers to disk
Example:
Sync has no options, doesnt affectation any messages
$ accompany
Tips:
It is consistently acceptable to blazon accompany a brace of times, one the important action of accompany is to amend your superblock information.
The accompany calls accompany Unix arrangement alarm and exits with success cipher 0 or 1 if it fails. These avenue codes stored in $? variable.
$ sync
$ answer $?
0
The aloft archetype shows that accompany was successful.
echo outputs its ambit to the accepted output.
Examples:
$ answer accost world
accost world
Tips:
Some accepted answer usage:
Check a carapace variable:
$ answer $EDITOR
emacs
Check the ambit anesthetized in the antecedent command:
$ ls -l
.........
$ answer $_
-l
Check the accepted ancestor process:
$ answer $0
bash
Check the avenue cipher of the endure command:
$ answer $?
0
Create a abandoned book (same as touch /tmp/newfile):
$ answer > /tmp/newfile
Create a new book with some text:
$ answer exec fluxbox > ~/.xinitrc
Add (append) a new band to end of file:
$ answer A New Band >> /tmp/newfile
cal displays a calender for the accepted month. If the command is followed by a date (a ages or a year) it will acknowledgment a calender for that period.
Examples:
$ cal
April 2004
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
$ cal 01 2007
January 2007
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tips:
The was adopted in the in 1752. The 2nd day of September 1752 was anon followed by the 14th day of September, as apparent by the archetype below.
$ cal 9 1752
September 1752
Su Mo Tu We Th Fr Sa
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
date displays the accepted date and time.
Example:
$ date
Mon Jun 26 12:34:56 CDT 2006
time time a program
Example:
$ time gcc apache.c
absolute 0m1.818s
user 0m0.770s
sys 0m0.210s
from affectation the names of those who beatific you mail recently
Example:
$ from
From andy@box.po Sat Feb 05 08:52:37 2005
From andy@box.po Sat Feb 05 08:53:52 2005
Count the amount of mail in your mailbox
$ from -c
There are 2 letters in your admission mailbox.
mail allows you to apprehend and address emails.
Example:
$ mail
No mail for user.
$ mail user2
Subject: Whats up?
Hi user2, you can annul this debris by acute d.
Cc: user
Tips:
Note that you charge to columnist access then ctrl+d to confirm.
$ mail
Mail adaptation 8.1 6/6/93. Blazon ? for help.
/var/spool/mail/user: 1 bulletin 1 new
>N 1 user@unix.com Tue Jun 27 12:34 16/674 Whats up?
&
Tips: Columnist access to read.
clear clears the screen.
Example:
$
PS1 is an ambiance capricious which defines the carapace prompt. If not defined, the alert defaults to $
Example:
$ PS1=yes?
yes? PS1=$
$
A added complicated example:
$ PS1= $
sync address anamnesis buffers to disk
Example:
Sync has no options, doesnt affectation any messages
$ accompany
Tips:
It is consistently acceptable to blazon accompany a brace of times, one the important action of accompany is to amend your superblock information.
The accompany calls accompany Unix arrangement alarm and exits with success cipher 0 or 1 if it fails. These avenue codes stored in $? variable.
$ sync
$ answer $?
0
The aloft archetype shows that accompany was successful.
echo outputs its ambit to the accepted output.
Examples:
$ answer accost world
accost world
Tips:
Some accepted answer usage:
Check a carapace variable:
$ answer $EDITOR
emacs
Check the ambit anesthetized in the antecedent command:
$ ls -l
.........
$ answer $_
-l
Check the accepted ancestor process:
$ answer $0
bash
Check the avenue cipher of the endure command:
$ answer $?
0
Create a abandoned book (same as touch /tmp/newfile):
$ answer > /tmp/newfile
Create a new book with some text:
$ answer exec fluxbox > ~/.xinitrc
Add (append) a new band to end of file:
$ answer A New Band >> /tmp/newfile
cal displays a calender for the accepted month. If the command is followed by a date (a ages or a year) it will acknowledgment a calender for that period.
Examples:
$ cal
April 2004
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
$ cal 01 2007
January 2007
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tips:
The was adopted in the in 1752. The 2nd day of September 1752 was anon followed by the 14th day of September, as apparent by the archetype below.
$ cal 9 1752
September 1752
Su Mo Tu We Th Fr Sa
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
date displays the accepted date and time.
Example:
$ date
Mon Jun 26 12:34:56 CDT 2006
time time a program
Example:
$ time gcc apache.c
absolute 0m1.818s
user 0m0.770s
sys 0m0.210s
from affectation the names of those who beatific you mail recently
Example:
$ from
From andy@box.po Sat Feb 05 08:52:37 2005
From andy@box.po Sat Feb 05 08:53:52 2005
Count the amount of mail in your mailbox
$ from -c
There are 2 letters in your admission mailbox.
mail allows you to apprehend and address emails.
Example:
No mail for user.
$ mail user2
Subject: Whats up?
Hi user2, you can annul this debris by acute d.
Cc: user
Tips:
Note that you charge to columnist access then ctrl+d to confirm.
Mail adaptation 8.1 6/6/93. Blazon ? for help.
/var/spool/mail/user: 1 bulletin 1 new
>N 1 user@unix.com Tue Jun 27 12:34 16/674 Whats up?
&
Tips: Columnist access to read.
clear clears the screen.
Example:
$
PS1 is an ambiance capricious which defines the carapace prompt. If not defined, the alert defaults to $
Example:
$ PS1=yes?
yes? PS1=$
$
A added complicated example:
$ PS1= $
|
Tags: example, command, september, commands example, september, current, command, variable, , example ps1, unix commands miscellaneous, |
Also see ...
PermalinkArticle In : Computers & Technology - Unix