FreeBSD File Operation

Time:2019-6-2

0.        Preface
The operation of files is the most commonly used instruction. It includes switching directories, listing files, establishing files, deleting files, copying files, renaming files, file permissions, file links, etc.

1. Toggle directoryDirective: CD (change diretory changes directory location of account)
Syntax: CDdirectory_name  
Parameter:. Represents the current directory. Represents the upper directory ~Represents the user’s home directory instance:
(1) Switch to the test folder in the upper directory

(2) Switch to the top two directories test Data folder

(3) Switch to your home directory

Operation instructions : If you just want to switch to your home directory, use it directly cd Without any parameters, If you switch to a folder at the top (bottom) level of your home directory, you need to use ~ Represents the home directory.  

2. List files / File permissions
instructions : ls list directory contents List the files in the data folder)  
grammar : ls [ -a ] [ -l ] [ directory_name/filename ]  
parameter : -a Display hidden files -l Display detailed data. Example : Show in detail that all files under the current data folder contain hidden files. . Beginning archives)

Operational instructions: If no directories and files are added at last, the files showing the existing data folders will be represented.  
Supplementary Note: The first field has ten units, indicating the authority of the archives.
d rwx The first unit is d, which means it is a folder.
– rw- r– R – The first unit is – denotes that it is a general file. Purple denotes the permissions of the file/folder owner; Brown denotes the permissions of the same group; and red denotes the permissions of others. The third and fourth columns are the owner of the file/data folder and the group to which it belongs. In this case, the owner is root and the group belongs to wheel. The fifth field is file size, and the last one is file establishment time and file name.  

3. Establishment of archives/Data folder
3.0 Establishment of Data Clip
Instruction: MKDIR (make directories create data folders)
Grammar: MKDIR [-m]directory_name  
Parameter: – M parameter followed by mode, directly set the data folder permission when creating the data folder.
Example: (1) Create a data folder named test.

The first and second lines of the journey are the same instructions. You can create data folders.

(2) Create a data folder named test2 with 700 permissions.  

3.1 Establishment of Archives Directive: touch (change file access and modification times change file access and modification time)
Grammar: touchfile_name  
Example: Create an empty file named ABC.
 

Previous page12 Read the full text on the next page

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]