Experiment Two
Iv. conclusion of the experiment
(1) What is a shell?
The shell is a system program provided to the user by the Unix/linux system to interpret and execute commands entered by the user.
It is the interface between the user and the system kernel.
(2) What are the commonly used shells ? How do I see which shell the system uses by default ?
①sh Bourne Shell
②CSH C Shell
③ksh Korn Shell
④bash Bourne Again Shell
- Use the command line Echo $SHELL
- View the shell used by the system creation user
- Use the command line echo $
(3) built-in Shell command vs. external Shell command
internal commands are part of an integrated shell program that is identified by the shell program and runs inside the shell program , usually when the Linux system loads and runs The shell is loaded and resides in system memory .
Common commands for Internal commands
Enable: Disable and enable internal commands
Help: See if internal commands are disabled
The external command simply says that the program runs on top of the system, and when the system reads the external command, it reads to the disk, which can be quite slow.
(4) How to use shell commands
1. Line-by-row input command execution directly at the Shell terminal
2. write multiple lines of command to a file (shell script), execute once
(5) What is a file system? What is the role of it?
There is a special form of area on the disk.
The operating system makes it easy to query and access the disk blocks contained within the file system
(5) What are the file system formats supported by Linux?
The Linux default file system type is ext2, ext3, Ext4, Proc.
Modern The VFS (Virtual file system) is used in Unix/linux to support multiple file systems.
(6) The directory structure of Linux, the use of primary subdirectories?
inverted tree-shaped structure. where /is the root node.
Purpose of the primary subdirectory:
Bin: Store binary executable commands to boot required commands or commands that ordinary users may use
Boot: Store the files used by the bootloader, including the core image
Dev: Store device files, or device drivers, that users access to external devices through these files
ETC: Store various system configuration files.
Root: Directory of the Super user
Sbin: Similar to Bin, also has the storage binary file, holds the system administrator to use the basic System program
TMP: The information and data generated by the program at run time, that is, temporary files
USR: The largest directory, application almost all in this directory
Home: Directory with Home owner
LIB: Standard programming library, also known as Dynamic Link shared library
Lost+found: Normally empty folder, storing the file generated when the system shuts down abnormally
Misc: Grocery box, allowing multi-user to accumulate and temporarily transfer their files
MNT: Let users temporarily mount other file systems
OPT: The third-party software is installed by default to find the directory, the equivalent of Windows in the C disk in the ProgramFiles
Proc: virtual directory, System memory mapping
var: overflow zones For some large files, such as log files for various services
SYS: A file system similar to/proc, which appears in the linux2.6 kernel, contains files for obtaining hardware status and reflecting the device tree seen by the kernel.
MNT: This directory is provided by the system to allow users to temporarily mount other file systems
SELinux: Used to harden the operating system and improve the security of the system
Media: A removable floppy disk, CD-ROM is stored.
SRV: System startup service is a database directory that can be accessed
Some other commands
Chown: Changing the owner and user group of a file
CHGRP: Changing the user group to which the file belongs
chmod : Changing the access rights of a file
Find : Search for files in the directory
The who command lists all users who are using the system, the name of the terminal used, and the time it was registered with the system.
The Echo command displays the parameters on the command line to the screen.
The date command, which displays the current time and date directly if there are no options and parameters, and displays the current time and date in the format of the specified date if you specify a format for displaying the date.
The Cal command is used to display calendars of any one or one months in the year of A.D. 1~9999.
- No parameters to display the calendar for the current month
- There is only one parameter, which is the year, which displays the calendar for that year
- There are two parameters, the previous parameter is the month, the last parameter is the year (the month can be abbreviated in English, the year is written in full)
Clear Command clears the information on the screen
Summary
Experiment two Linux common command exercises