skip to main | skip to sidebar

OPEN SOURCE

Linux for Better life

  • Home
  • Trik-Tips
  • Free Template
  • Blogger Hack
  • Free Ebook

UNIX and LINUX part 2


UNIX ENVIRONMENT
The UNIX shell maintains an environment that controls how commands are interpreted and performed. A few of the more common environment variables and concepts are presented throughout the following paragraphs.
INPUT/OUPUT (I/O)
The UNIX System handles I/O as streams of data. The streams flow into and out of commands, files, or devices. The shell has three default types of I/O. The input stream is referred to as standard input and is usually generated by your terminal keyboard. The output stream is referred to as standard output and is usually displayed to your terminal screen. Standard error is error output from programs which also defaults to your terminal screen.
Standard Input/Output/Error
Conventional Names Default Device Input or
Output is Connected to File Descriptor (Used by the Shell)
Standard Input Terminal Keyboard (or from a pipe of file) 0
Standard Output Terminal Screen (or to a pipe or file) 1
Standard Error Terminal Screen (or to a pipe or file) 2
REDIRECTION
The standard I/O can be redirected from your terminal to a file or a device. You can store data in files or send the contents to a command as input. Output from one command can be redirected to the input of another command. This is called "piping."
PATH NAMES
Pathnames are used to refer to directories and files not in the present working directory. A path is made up of a "/" followed by a subdirectory name or a filename, multiple "/" and subdirectories can be listed. Full pathnames begin with a "/", which denotes the root directory. Relative pathnames do not begin with a "/". Instead they start with a directory name or ".". There are several types of relative pahtnames. Subdirectory paths begin with the subdirectory's name, not a "/". Indirect paths begin with a "..", which allows dynamic backward movement within the file system.
1. Change directories using a full pathname by typing >cd/usr/bin and pressing Return.
2. Display the contents of the /usr/bin directory by typing ls -x and pressing Return. Your output may vary depending on the type of UNIX System you are using, but it should resemble the following.
cj> ls -x
300 300s 3bnstat 4014 450 Oar
admin asa at awk b16as b16cc
b16ckfile b16conv b16cprs b16dis b16dump b16ld
.
.
.

BSD (Berkeley)
The output for BSD systems is slightly different.
3. Return to your home directory by typing cd and pressing Return.
PRESENT WORKING DIRECTORY
The present working directory is often referred to as the current working directory or current directory. Since the command that returns the present working directory is "pwd," we will refer to it as such. The UNIX System has file systems that are hierarchical tree structures containing directories and files.
1. Display the present working directory by typing pwd and pressing Return.
2. To change the present working directory type cd .. and press Return. Notice that no response is given if the command worked.
3. Display the present working directory by typing pwd and pressing Return. Notice you have moved up the directory path one position. The ".." refers to the previous or "parent" directory in the present working path.
4. To return to your home directory, type cd and press Return.
HOME DIRECTORY
The system administrator created a directory for you somewhere in this hierarchy. When you log in you are positioned at this directory. This directory is known as your login or HOME directory. Since this is your home directory, you should own it and all the files under it. Therefore, you have full permissions to read, write, create, change, or delete the contents of your home directory.
TERMINAL TYPE
Certain UNIX commands must know what type of terminal you are using so they can interface with it correctly. You may need to contact your system administrator to find out what name UNIX uses for your terminal. The following steps show how to set your terminal type to a DEC VT100 terminal.
Other popular terminal types include:
adm3 adm5
ansi (pc) hp
tvi925 tvi955
vt52 vt220
wyse50 wyse60
1. Type TERM=vt100 and press Return to set the TERM variable to vt100 for the current login shell.
C Shell
Type set term=vt100 and press Return to set the TERM variable to vt100 for the current login shell.
2. Type export TERM and press Return to export the TERM variable to the global shell environment. This allows other sub process commands to use the TERM variable.
C Shell
The setenv command performs the same function as the SV export command. But the csh knows to export the term variable automatically.
3. Type env and press Return. Notice that the TERM variable is listed as being set to vt100.
cj> env
LOGNAME=mylogin
MAIL=/usr/mail/mylogin
ENV=/u1/ts/mylogin/env.ksh
HOME=/u1/ts/mylogin
TERM=vt100
PATH=:/bin:/usr/bin:/lbin:/usr/lbin:/u1/ts/mylogin/bin:.
TZ=EST0EDT
VISUAL=vi
FCEDIT=vi
SHELL=/bin/sh

C Shell
Type printenv to display environment variables.
SETTING/CHANGING YOUR PASSWORD
The passwd utility allows you to create or change the password associated with your user name. You can only change your password, you cannot change other users' passwords.
It is advisable to change your password the first time you log in on a multiuser system. Refer to Module 100 for a complete description of the passwd command.

Posted by MALIK

Newer Post Older Post Home

Links

  • ALJAZEERA TV
  • ANTARA
  • Bali`s Blogger
  • BBC
  • BERITANET.COM
  • CHIP ONLINE
  • CNN
  • DETIK.COM
  • E-BOOK
  • Economic
  • Friends
  • Friendster's Blog
  • Habibieafsyah
  • HARVARD UNIVERSITY
  • ILMU KOMPUTER
  • INFO LINUX
  • KICK ANDY
  • LINUX OpenSuse
  • LINUX SLAX
  • Linux Temanggung
  • LINUX UBUNTU
  • LIPUTAN 6 SCTV
  • MASTER BLOGGER
  • METROTV NEWS
  • MUSIC DOWNLOAD
  • My Class
  • Robotic AMIKOM
  • SMA N 3 TEMANGGUNG
  • SMART E-LEARNING
  • SOFTPEDIA
  • STMIK AMIKOM
  • SUPPORTED BLOGGER
  • TIPS TRICKS
  • TRIAL FILM
  • TV ONE ONLINE

Blog Archive

  • ► 2009 (38)
    • ► 05/31 - 06/07 (1)
    • ► 02/15 - 02/22 (1)
    • ► 01/11 - 01/18 (11)
    • ► 01/04 - 01/11 (25)
  • ▼ 2008 (70)
    • ► 11/30 - 12/07 (22)
    • ▼ 11/16 - 11/23 (18)
      • UNIX and LINUX part 16
      • UNIX and LINUX part 15
      • UNIX and LINUX part 14
      • UNIX and LINUX part 13
      • UNIX and LINUX part 12
      • UNIX and LINUX part 11
      • UNIX and LINUX part 10
      • UNIX and LINUX part 9
      • UNIX and LINUX part 8
      • UNIX and LINUX part 7
      • UNIX and LINUX part 7
      • UNIX and LINUX part 6
      • UNIX and LINUX part 5
      • UNIX and LINUX part 4
      • UNIX and LINUX part 3
      • UNIX and LINUX part 2
      • UNIX and LINUX part 1
      • A SAMPLE SESSION WITH UNIX USER COMMANDS
    • ► 11/09 - 11/16 (1)
    • ► 10/26 - 11/02 (5)
    • ► 10/19 - 10/26 (16)
    • ► 10/12 - 10/19 (4)
    • ► 10/05 - 10/12 (4)



$100.00 Anda pasti untung setelah registrasi!






Search Engine Optimization and SEO Tools







Bookmark CO.CC:Free Domain