Learning Notes (iii)--LS command, Linux directory structure, cd command, PATH, shortcut keys

Source: Internet
Author: User
Tags clear screen install php

1.LS command:

LS used to view files, is a very common command:

[[email protected] ~]# LS//does not contain hidden files

[[email protected] ~]# ls-a//All files, including hidden files

[[email protected] ~]# ls-l//file details

[[email protected] ~]# ls-lt//file details, by Mtime Descending

[[email protected] ~]# ls-ltr//file details, by Mtime Ascending

[[email protected] ~]# LS-LH//file details, file size human read

[[email protected] ~]# ls-ld//directory details, view the directory itself

Note: ls-l lists the information:

-r-xr--r--. Root root 22:49 Filename.log

In turn:

File type belongs to the primary permission group permissions file size mtime file name

There are several types of files:

-Normal file

D catalog File

C Character file

L Soft Link File

B-Block device files

P Pipeline File

s socket file

The file permissions will be discussed later.


2.Linux directory structure:

/boot Linux kernel and the files required by the boot program

/dev External device

/etc profile directory, it is important, it is best to back up

/home Directory Useradd after the normal user home catalog. Userdel-r completely removes the home directory that accompanies the user.

/lib the library file in the system. It's also possible under the/usr/lib. 32 for operating system under/LIB, 64-bit operating system under/LIB64. Note:ldd/bin/ls, the LDD command lists the libraries on which the executable file depends. These libraries are often under/lib. You can use the LDD command to see if a dependent library is missing when the service is not available when you install PHP or MySQL.

/media the optical drive is often mounted in this directory under the GUI, default is empty

/mnt is used to mount a USB flash drive, etc., default is empty

/OPT is used to store some large software or some special software

/proc System kernel Mapping, is actually virtual, does not occupy the hard disk space. The file cannot be written to in this directory. This directory is relevant when modifying kernel parameters, tuning, and configuring the software. Process-related information is also in this directory, such as/PROC/1 for the PID 1 process-related information (is a directory). As an example:

Forbidden Ping:echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

0 can be ping, 1 not ping. You cannot use Vim to modify the file, only echo.

/root Root User home directory

/selinux A firewall directory, this firewall is relatively chicken, generally not used, choose to turn it off

/SRV store Some services need to extract data after startup, the basic use of this directory, the default is empty

/sys file system, kernel, device type, and other information

/tmp for storing temporary files

The storage directory for the/USR user program. Similar to the program files file in Windows.

/var for storing log files


3.CD command:

[[Email protected] ~]# CD//jump to current user home directory

[[Email protected] ~]# CD-//Skip to previous directory

[[Email protected] ~]# CD ~//Jump to current user home directory, equivalent to CD

[[Email protected] ~]# CD. Jump to the current directory

[Email protected] ~]# CD. Jump to the parent directory of the current directory


4.PATH Environment variables:

[[email protected] ~]# echo $PATH//View the value of the current system environment variable PATH

Temporarily Modify Path:

[Email protected] ~]# path= $PATH:/tmp

This allows us to use the following executable file as the/tmp/command. If you want the modified PATH to take effect permanently:

[Email protected] ~]# Vim/etc/profile

Add the following line to the file:

Path=: $PATH:/tmp

Of course, the above modification is for all users, in order to target a user, modify:

[[email protected] ~]# vim./.bash_profile

After modification, the restart takes effect or uses the source command:

[Email protected] ~]# source/etc/profile//Source ~/.bash_profile


5.Linux shortcut keys:

Ctrl + C Cancel command

Ctrl + Z Pauses, hangs the process

Ctrl + A cursor moves to the beginning of the line

Ctrl + e cursor moves to end of line

Ctrl + u Delete all characters before cursor

Ctrl + k Delete all characters after cursor

Ctrl + L Clear Screen

Ctrl + D to log out, equivalent to [[email protected] ~]# Logout

Ctrl + S lock screen

Ctrl + q Unlocking

Note: for multiple processes that use Ctrl + Z to suspend, use the

[Email protected] ~]# FG1

[Email protected] ~]# FG2

[Email protected] ~]# FG3

......

Recall the front desk separately.

Learning Notes (iii)--LS command, Linux directory structure, cd command, PATH, shortcut keys

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.