Today, the teacher told us to write commands in the linux environment, mainly about cd, ls and cp
Common commands
1. Understand the directory information after linux Installation
All lowercase letters (case sensitive)
Ls --- list (Display)
[Root @ localhost root] #
Root directory of the root user-Home Directory
[Zhy @ localhost ~] $
[Current login username @ machine Name Current Directory] Administrator
/Boot/swap
2. Change the path cd (chang directory)
Path name changed by cd
Cd/
/--- Top-level directory, root directory
Bin-binary executable program (green) for normal users
Sbin ---
Man ls
Root -----
Su command for changing user identity
1) changed from common user to root
$ Su
Password: Not Displayed
2) changed from root to normal user
# Su zhangsan
No Password required
First Command: ls
# Man ls
Function: displays contents in a directory.
Syntax: ls [parameter] [file]
Parameters:
-A, -- all: displays all files (including hidden files starting );
-L: displayed in long format
10-rwx rw-r --
File Type author permission group permission others permission
111 110 100
4 + 2 + 1 = 7 4 + 2 = 6 4
764
R: read 4
W: write 2
X: executable 1
V587
Number of links
File author
File author group
File size (B)
Modify the month, date, and time
File Name
-S: displays the file size.
-S: sort by file size)
Files displayed in long format are sorted by file size at the same time.
Ls-l-S
Ls-lS (recommended)
File color:
Blue: indicates the directory file.
Green: indicates the executable file.
RED: indicates the compressed file.
Gray: other files
The second command: cp
Function: Copies one or more files to the target directory.
Syntax: cp [parameter] source file or directory target file or directory
Parameter:-f: if the target file or directory already exists, you will not be asked whether to delete it or not. Delete it and copy it again.
-I: If the target file or directory already exists, ask the user if they want to delete it and copy it again.
-R: recursively copy the directory, that is, copy the directory together with the subdirectories and files under the directory.
-P: Maintain the source file owner, permission, and time mark during replication.
For example, copy a to the user directory [root @ localhost root] # cp a user
From zl943588435