Linux Fundamentals 01

Source: Internet
Author: User
Tags parent directory

(1) LS
-L: Long format
File type: the
-: Normal file (f)
D: Catalog file
B: Block device files (blocks)
C: Character device file (character)
L: Symbolic Link files (symbolic link file)
P: Command pipe file (pipe)
S: Socket file (socket)
Example: Ls-ld/root displays information about the/root itself.

(2) file permissions: 9-bit, every 3-bit group, each group: rwx (Read, write, execute), r--
Number of hard links to files
Owner of the file
Genus Group of files
File size (size), in bytes
Timestamp (timestamp): Last Modified Time
Access: Access
Modified: Modify, the file content has changed
Change: change,metadata, meta data
-H: Do the unit conversion (the file size is displayed in human readable form)
-A: Show hidden files starting with.
. Represents the current directory
.. Represents the parent directory
-A: And-a differ only. And.. Different.
-D: Display the directory's own properties
-i:index node, inode (displays the index number of the file)
-R: Reverse Display
-R: Recursive (Recursive) display

(3) Cd:change directory
Home directory, home directory, home directory (enter CD separately, enter home catalog)
CD ~username: Enter the home directory of the specified user
CD-: Switch back and forth between the current directory and the previous directory

(4) Displays the commands in the current cache (that is, commands that have been entered)
Hash

(5) Type: Shows which type the command belongs to (internal command or external command)

(6) To obtain the use of the command help:
Internal command:
Help COMMAND
External command:
COMMAND--help

(7) Command manual: Manual
Mans COMMAND
Example: Man ls
Mans Mount
Man 2 read//Displays the second chapter of the Read command.
Export lang=en//After import, the English command manual is displayed.

Find where the command appears in the manual: Whatis command

Sub-chapters:
1: User command (/bin,/usr/bin,/usr/local/bin)
2: System call
3: Library User
4: Special files (device files)
5: File Format (configuration file syntax)
6: Game
7: Miscellaneous (Miscellaneous)
8: Management Command (/sbin,/usr/sbin,/usr/local/sbin)

(8) Command format description
<>: Required
[]: Optional
... : multiple times can occur
|: Choose one More
{}: Grouping

(9) Man:
Name: command names and features brief description
Synopsis: Usage notes, including available options
DESCRIPTION: A detailed description of the command function, which may include the meaning of each option
Options: Explaining the meaning of each option
Files: The configuration file associated with this command
BUGS:
EXAMPLES: Using the example
See ALSO: Another reference

Flip Screen:
Turn back one screen: SPACE
Turn One screen forward: b
Turn back one line: ENTER
Turn One line forward: K

Find:
/keyword: Backwards
N: Next
N: Previous

? KEYWORD: Forward
N: Next
N: Previous
Q: Exit

(Ten) Hwclock
-W: Sets the hardware clock from the system time.
-S: Sets the system clock from the hardware clock.

(11) Display system environment variables
Printenv

(12)
/root/-the root user (Superuser) home directory.
/boot: System boot related files, such as kernel, INITRD, and Grub (bootloader)
/initrd/-is used to mount the directory of the initrd.img image file when the computer starts up and the directory to load the required device modules.

/dev: Device files
Device files:
Block devices: Random access, data blocks
Character Devices: Linear access, by character
Device number: Main device number (major) and secondary device number (minor)
/etc: Configuration file
Home directory for users, the home directory of each user is usually the default of/home/username
/root: Administrator's home directory;
/lib: library file, is kernel-level. Only shared libraries that are used by programs in the/USR directory do not have to be placed in the/lib directory. Only the libraries required for the programs under/bin and/sbin need to be placed in the/lib directory.
static libraries,. A: Each program is loaded.
Dynamic libraries,. dll,. So (Shared object): Loaded only once to memory, other programs do not need to be loaded repeatedly, can be used directly.
/lib/modules: Kernel module files

Additional Instructions:
/lib/-contains many library files that are used by programs in/bin/and/sbin/. The directory/usr/lib/contains more library files for user programs.
The/lib directory is placed under the/bin and/sbin directories required by the program's library files. The name of the file under the/lib directory follows the following format:
Libc.so.*
ld*

/media: mount point directory, usually mounted on mobile devices, CDs, etc.
/MNT: mount point directory, additional temporary file system
/OPT: Optional directory, the installation directory for third-party programs. But at present this change, the third party program all put under Usr/local.
/proc: Pseudo file system, kernel mapping file (the temporary mapping file generated after the system is running).
/sys: Pseudo file system, a property mapping file associated with a hardware device.
/tmp: Temp file (/TMP gives all system users read and write rights. ),/var/tmp
/var: a variable file
/bin: Executable files, user commands in this folder.
/sbin: Manage commands in this folder. The storage location of many system commands (for example, shutdown).

/usr: (Full name: Universal GKFX, Read-only) global shared read-only file.
/usr/bin
Many system commands are also included in the/usr/sbin directory/usr/sbin.
/usr/lib at the system level.

/usr/local: Third-party software installation directory.
/usr/local/bin
/usr/local/sbin
/usr/local/lib user-level.

(13), naming rules:
1, the length can not exceed 255 characters;
2. Cannot use/when file name
3. Strictly case-sensitive

(14)
mkdir: Creating an empty Directory
-P: Simultaneous creation of multi-level catalogs
-v:verbose More information
Example: Mkdir-p/root/x/y/z
Mkdir-pv/root/x/y/z

To create:/mnt/test/x/m and/mnt/test/y two directories, the command is as follows:
mkdir-pv/mnt/test/x/m/mnt/test/y
Mkdir-pv/mnt/test/{x/m,y}

(15) Command line expansion
To create the following 4 directories under/mnt/test2/:
A_b, A_c, D_b, D_c
For example:
Observe the following rules:
(a+d) (b+c) =AB+AC+DB+DC
{a,d}_{b,c}=a_b,a_c, d_b, D_c
Here's how:
mkdir-pv/mnt/test2/{A,d}_{b,c}

# Tree: View directory tree

Delete directory: rmdir (remove directory)
Delete Empty Directory
-P: Delete to the previous level non-empty directory.

(16) file creation and deletion
# Touch main function is not to create files, mainly to modify the file timestamp.
-A: Change the access time only. Example: Touch-a a file
-M: Change the modification time only.
-T: Make access/modification time. Example: Touch-m-T 201807011211 a file
-C
Access: Accessing Time
Modify: Modification Time
Change: Changes time, this time is not modifiable.


(17), delete file
RM is an alias for Rm-i. To use native RM, you can use \RM.
-I: Interactive commands
-F: Force delete.
-R: Recursive delete

For example: RM-RF/: Delete the root directory, and all files under the root directory.

Linux Fundamentals 01

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.