h1-3

来源:互联网 发布:百度云管家mac版下载 编辑:程序博客网 时间:2024/04/29 02:52

multiuser system, so multitasking

multichoice system: Bourne shell, C shell, and Korn shell

 

what is shell?

in UNIX, the command-line user interface is called a shell

 

$ passwd

 

who are you?

$ whoami

$ who am i

$ id

 

finding out what other users are logged into the system

$ users

$ who

 

what is everyone doing on the computer?

$ w

11:49am  up 920 day(s), 18:24,  3 users,  load average: 0.27, 0.34, 0.34

User tty login@ idle JCPU PCPU what

...

 

the user's login name

the name of the tty the user is on

the time of day the user logged on(in hours:minutes)

the idle time-that is

the number of minutes since the user last typed anything (in hours:minutes)

the CPU time used by all processes and their children on that terminal (in minutes:seconds)

the CPU time used by the currently active processes (in minutes:seconds)

the name and arguments of the current process

 

$ w

-h    Suppress the heading.

-l     Produce a long form of output, which is the default.

-s    Produce a short form of output. In the short form, the tty is abbreviated, the login time and CPU times are left off, as are the arguments to commands.

-u    Produces the heading line which shows the current time, the length of time the system has been up, the number of users logged into the system, and the aver- age number of jobs in the run queue over the last 1, 5 and 15 minutes.

-w   Produces a long form of output, which is also the same as the default.

 

-s -u

 

$ w -u

$ uptime

$ procinfo  (linux)

 

checking the current date and time

$ date

 

looking at a calendar

$ cal

$ cal 2 1985

$ cal 1985

(from A.D.0)

 

Using bc infix calculator

$ bc

1+1

2

quit

 

$ bc -l math

$ bc -l

 

ctrl+d

 

Moving about the File System

anything is not a folder is a file.

 

The top level of the UNIX file structure (/) is known as the root directory or slash directory,

and it always has a certain set of subdirectories, including bin, dev, etc, lib, mnt, tmp, and usr.

 

/bin,/sbin,usr/bin, -->executable binaries

/dev  -->device drivers

/etc  -->administrative files and information

/lib

/lost+found

/mnt  -->a common place to mount external media—hard disks, removable cartridge drives

/sys  -->contains files indicating the system configuration

/tmp  -->fastest

/usr  -->this directory was intended to be the central storage place for all user-related commands

 

A hidden file is any file with a dot as the first character of the filename.

See also dot files.

Preference file:These are what dot files (hidden files) really are: They contain your individual preferences for many of the UNIX commands you use.

 

UNIX uses an ordered list of directories called a  search path for this purpose. The search path typically lists five or six different directories on the system where the computer checks for any application you request.

The question arises: What happens if your own personal copy of an application has the same name as a standard system application? The answer is that the system always finds the standard application first, if its directory is listed earlier in the search path.

 

$ env

$ echo $PATH

$ echo $HOME