Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Jack H.Integration and automation of manufacturing systems.2001.pdf
Скачиваний:
80
Добавлен:
23.08.2013
Размер:
3.84 Mб
Скачать

page 33

The ’passwd’ command is used to change user passwords. In general passwords are the main

line of defense against unwanted intruders. Most systems will do simple password checks when

passwords are entered. In general, if a password can’t be found in a dictionary or index of a book

it will generally be safer.

2.2.4 Processes

At any one time there are multiple programs (processes) running on a Linux computer. When

you run a program it becomes another process also running on the computer. Each process is

given it’s own unique process ID number (PID). Each process is given it’s own private memory

space, and allowed to run for a fraction of a second every second.

The list of commands below allow the processes in the computer to be seen. They also allow

the general state of the machine to be determined.

ps -aux

Print a list of processes running on the computer

kill -9 pid

Kill a process with ’pid’ running on the computer (uses the PID # from ps -ef)

passwd userChange the password of a ’user’

date

print system date and time

who

show who is logged into the machine

exit

this will logout a user

fg

bring background processes to the foreground

bg

send a stopped process to the background

<CNTL>Chitting this key sequence will kill a running process <CNTL>Zhitting this key sequence will stop a running process, but not kill it

command &any command followed by an ’&’ ampersand will be run in the background

Simple commands can be combined together with pipes to make more complicated functions.

An example is ’ls | more’. By itself ’ls’ will list all the files in a directory. ’more’ is normally used

to print out text files. But in this case the output of ’ls’ is passed (piped) through ’more’ so that it

only prints one screen at a time. Multiple commands can be combined on a single command line

by separating them with a colon ’:’. For example the command ’ls ; ls ..’ would list the contents of

the current directory, then the parent directory.