Common commands
1) Enter root file system roots directory
CD/
2) Show current directory
Pwd
3) Display the system date
Pwd
4) display "Welcome to use this system" on the display Chinese tips
echo "Welcome"
5) use the cat command to view the etc/services file
Cat Etc/services
6) use the more command to view the etc/services file
More Etc/services
7) list All files in root file system directory
Ls–a \
8) list The root file system roots file for more information
ll
Ls-l
9) View subdirectories files under dev,bin , and mnt
ls Dev bin mnt
**********************************************************
Answer the following questions
-rw-r--r--1 root root 1666 02-28 10:39/etc/inittab
1) question one: What commands should be used to fully display information such as the file list above. Please write the complete command line.
Ll/etc/inittab
2) question two: what is the meaning of the first "-" in the first column of the contents of the above-mentioned file list "-rw-r--r--"? What characters may appear for other types of files or directories, and what do they mean?
the first one " - the file type General Documents
D Catalog Files
L Connection file (soft connection)
C Character Stream Device
b Block Devices
P Pipeline Files
3) question three: What does the second to third RWin "-rw-r--r--" mean in the first column of the above file list? ( R Read w writable ) one of the fourth " - "indicates what meaning,(not executable) that bit can also use what character ( X ) , what does that mean?
Note: The file's rwx of the Catalog rwx
4) question four: What does the second column of the above-mentioned file list mean by "1"?
Number of connections (hard Connect)
5) question five: what does "root" mean in the third column of the contents of the above file list?
File owner
6) question six: what does "root" mean in the fourth column of the above file list content?
Group to which the file belongs
7) question seven: what is the meaning of "1666" in the fifth column of the above-mentioned file list content?
File size
8) question eight: what does "02-28 10:39" mean in the contents of the above file list?
File creation or Last modified time
9) question nine: what does "/etc/inittab" mean in the contents of the above file list?
Filename
***********************************************************
File, directory Operations
1) Enter the user's home directory
CD ~
2) Create a subdirectory in the user's home directory Sy
mkdir Sy
3) Create sub-directory in sy BF
mkdir SY/BF
MKDIR/SY/BF ( error )
4) copy files from the root directory under bin C to the BF
cp/bin/c* SY/BF
5) Creating a subdirectory cal in the BF
mkdir sy/bf/cal
6) move the BF to the user's home directory, renamed to Newdir
MV SY/BF ~/newdir
7) Create a subdirectory in sy sydir
mkdir Sy/sydir
8) Create files in the sydir directory file1,file2
Touch Sy/sydir/file1 Sy/sydir/file2
9) Create subdirectories in sy T1 and T2
mkdir sy/t1 Sy/t2
copy sydir to newdir , including its files and directories
Cp-r Sy/sydir Newdir
Delete the T1 from the user's home directory ( in the sy directory )
Rm-r SY/T1
RM-RF Sy/t2
Delete the sydir ( in the sy directory ) from the user's home directory
RM-RF Sy/sydir
****************************************************************
Help file
Linux The commands for getting help in 3 A: man(manual), Help,info . Compare the common man help manuals.
Man Date
first line, DATE (1) , DATE is the name of the command, (1) represents "commands that can be used by the general user", which makes sense.
Commonly used are the following:
1 a command or executable file that represents a user's ability to manipulate
2 represents a function or tool that the system core can invoke, etc.
3 represents a number of commonly used functions and function libraries
4 indicates a description of the device file
5 represents the format of a settings file or some file
6 represents a game ( Games )
7 An expression of conventions and agreements, such as network protocols, ASCII Code Description Content
8 represents a command that a system administrator can use
9 represents the kernel-related files
For example: passwd, can be a command, or it can be a file. The default is the 1 command, to check the passwd file's help input command,man5 passwd
NAME short command, data name Description
Synopsis a short command syntax ( Syntax ) Introduction
DESCRIPTION A more complete explanation, it's best to take a closer look
OPTIONS for Synopsis section, list all the available parameters.
COMMANDS commands that can be issued in a program when the program is executed.
FILES This program or data is used, referenced or linked to some of the files
See ALSO Other reference notes related to this command or data
EXAMPLE Some examples that can be consulted
BUGS whether there is a related error.
Use the Help document to view
*************************************************************************
File Permission Actions
1) Create directory test03 under User's default working directory , enter test03 directory, use touch command to create an empty file file1.
2) display file1 Details, log the file permissions information, the owning user and group.
3) set permissions on file1 so that other users can write to the file and view the settings results.
4) Remove the Read permission from the same group of users to the file1 and view the setting results.
5) Set the permissions for file1 in digital form so that all can be read, writable, and executable; other users and group users have only read and Execute permissions, and view the settings results.
6) Change the file1 permissions in digital form so that the owner can only read this file, no other users have permissions, and view the settings results.
7) Add Write permissions to other users and view the settings results.
8) go back to the upper directory to view the test03 permissions.
9) Add Write permissions to this directory for other users, and view the settings results.
) view and record The user and group of the directory test03 and the files in which it belongs.
Delete the directory test03 and its files.
********************************************************************
Four, VI use of the editor
Master VI the entry and exit methods of the editor.
Learn about the three modes of the text editor.
Good command of Use VI Editor to edit, select, and manipulate text file commands.
. Please check the ~ This directory creates a name for the vitest the directory;
2. Enter the vitest directory;
3. Copy the /etc/man.config to the bottom of this catalogue;
4. use vi to open the Man.config file under this directory ;
5. Set the line number in VI ;
6. move to the first line and move the four characters to the right, what directory are you seeing in double quotes?
7. move to the first line, and search down the string "bzip2" , may I ask what line he is in?
. next down, I'm going to change The man between the lines of and whether a selection needs to be modified, how to give instructions?
9. After the modification, all of a sudden regret, to recover all, what are the methods?
I want to copy The contents of the 10 rows, and post them to the last line;
Delete each line from one to the other ;
Save this file as a man.test.config filename;
go to page , and delete the characters of the line;
after storage, leave!
The entire step can be as follows:
1. mkdir ~/vitest
2. CD ~/vitest
3. Cp/etc/man.config.
4. VI Man.config
5.: Set Nu
6. Press 58G First , then press the right arrow, and you will see "/dir/bin/foo "
7. Press 1G first , then press /bzip2 to search and you will see him in line 118 !
. : 50,100S/MAN/MAN/GC
9. (1) The simple method can always press u to revert to the original state,
(2) use not to store away : q! after that, the file is read again
51G then Press G to the last line after 10yy and press p to stick Stick to the line!
11G , then give him 20dd can delete line;
: w Man.test.config
after 29G , then 15x can delete the characters;
wq!.:
Linux Common Commands