UNIX foundation day_01

unix operating system
why select the operating system to the user's needs?
individual users: windows
enterprise users: do server (Web site) development
requires server-side:
1) safety (windows are not satisfied)
2) stability (no shutdown) (windows is not satisfied)
3) efficiency (windows is not satisfied)
so selected unix or unix-server system to meet the requirements

what? is an operating system
how? command

Development stage: According to the operating system used to select the project
deployment phase: unix system must be deployed to the server

historical development of unix
unix developed into two series: BSD and System V genre genre
linux (linux is not unix, unix's just a imitation)

Learning objectives:
1) to exit the remote login and remote Solaris system
2) File System
3) to create files and directories and modify their permissions
4) manipulate text files, use the vi text editor
5) configuration environment variable

1.OS part of the
composition of a computer: hardware and software (system software and applications, such as pieces of)
System Software: Operating System
Software: Depending on the software download different operating systems

Operating system composed of: Hardware (Hardware), Kernel (operating system kernel, control hardware), Shell (operation), File System (file system)

1) Kernel kernel is the core of the OS
management hardware
to manage memory allocated memory is used to store operational data, power and destruction
schedule (process management process, the process of switching)
program: static, does not allocate memory
process: is dynamic, must allocate memory
more than one application can launch a process
key to start the process: whether to allocate enough memory space
to play between the control system and system hardware (drive)
management swap space (virtual memory, hard disk opened up a swap space, place the idle process, meet to start other processes, swapped out operations to achieve limited unlimited operating resources)
management daemons (daemon, daemon to start automatically, until the shutdown until the end of process)
management file system (create files, etc.)

2) Shell that the interface (the interface between user and Kernel)

And played a translator explaining the functions (Kernel and translation to explain to the user, Code 01)

Average user: $ Username: zhangsan lisi briup more
superuser: # User name: root 1 Ge

The first time you use super-user, to the superuser password:
sudo passwd root
briup password:
Enter a new unix password:
Re-enter the new unix password:
passwd: password updated successfully to

Ordinary users to switch to super user: su or su - (switch super user's home directory)
super user switches to a normal user: exit

Home directory: Each user has its own home directory
/ home / zhangsan (general user home directory)
/ root (superuser home directory)
whoami: View the current user (super user or ordinary users)
pwd: Displays the current absolute path path

3) file system: all hardware will be mapped to a file

File directory: /
Executable: *
Text File: (none)

ls /: View the root directory of all files

Pathname is used to uniquely identify the file and directory
path names can be relative and absolute Road King Road King
Relative Road King: not to "/" at the beginning
opposite points: the current path, it will change
the absolute Road King: start with "/"
opposite points: root, does not become

2. Command
Format command: command options [] (preceded by -) parameters []
whoami
LS /
df -k to view the system partitioning
partition mount point
/ dev / sda1 (partition name)
/ dev / sda2 /

clear: clear screen
pwd: Displays the absolute path to the current directory
cd: Change directory (without path switch directly home directory, add the path to switch to the added path)
..: Back to the parent directory
: current path
~: home directory

ls: displays a list of files and directories in the current directory
ls -a: shows all files, including hidden files of information (hidden files all begin with.)
LS -R: iterative display information file (show all files with file clip iteration continues down through all the files)
LS -t: according to the last modification time to sort
ls -l: detailed information file (d represents a directory, display - represents a file; rwx permission to the owner, rx permission to the same group of people, rx other people permission to link number, the owner,
has a group size, the last modification time, file name)
LS -d: show file information itself
ls -F: displays the type of file (directory files / executable files * , @ linked files, text files ... nothing)
can merge options, abbreviated: LS -ld / etc
LS path: Specifies the path and file directory listing

file filename: View the contents of the file based on the file type

chmod permissions owner | group of people with authority | other people permission to file name: Modify permission
rights: r read access
w write access to the directory, the file can be generated with subdirectories or delete files and subdirectories
x execute permissions on the directory speaking. To find content in the directory
- do not have permission
rw- r-- r - (owner, the same group of people, others)
U owners - who landed when generating the file, the highest authority
g the same group of people - the system administrator to assign with a group of a few people or
o others - who in addition to the owner, the same group of people
a everyone - including the owner, the same group of people and other persons
= set access permissions
- remove access
+ grant access
example : GR file1 the chmod
the chmod + U X, R & lt file1 + Go (different human rights need to add the same settings "," spaced apart from)
the chmod A = RW file1
digital mode set permissions:

4 Read
2 Write
1 Execute(执行)

7 r w x(4+2+1)
6 r w -
5 r - x
4 r - -
3 - w x
2 - w -
1 - - x
0 - - -

For example: chmod 555 dante (owner, the same group of people, other people permissions are rx)


touch filename: create and update files

mkdir relative or absolute path: Create flat directory
mkdir -p relative or absolute path: create multi-level directory

cp: copy files
-i have prompted
cp -r source directory target directory
cp source destination directory
cp source file destination

mv: Move or rename
-i have prompted
mv source file destination
mv source destination directory
mv source directory target directory

rm: delete files
rmdir: delete the directory (only delete empty directories)
RM -r: delete non-empty directory

man: Help command (there ls --help, info ls)

 

Guess you like

Origin www.cnblogs.com/vce630/p/11455348.html