Linux Face question 001

Source: Internet
Author: User
Tags clear screen readable temporary file storage

1. Man helps explain commands you are familiar with or unfamiliar with

Eg:man ls to view LS-related usage

Note: Press the Q key or CTRL + C to exit, under Linux you can use CTRL + C to terminate the current program run.

2. LS View the directory or file of the genus *, listed as a directory below the file

Eg:ls/usr/man

Ls-l

A.D represents the directory, if it is a "-" represents a file, if L is a connection file (link)

B. Represents a file or directory permission permission. Separate with readable (R), writable (w), can be run (x).

3. CP Copy File

EG:CP filename1 filename2//copy filename1 to Filename2

CP 1.c NETSEEK/2.C//1.c Copy to Netseek directory named 2.c

4. RM Delete files and directories

EG:RM 1.c//delete 1.c this file

5. MV Remove directory or change file name

EG:MV filename1 filename2//renamed filename1 to Filename2

MV Qib.tgz. /QIB.TGZ//move to the top level directory

6. CD Change current directory PWD View the current directory full path

EG:PWD//view current directory path

CD Netseek//Enter Netseek this directory

CD//Exit current directory

7. Cat,more command

Displays the contents of a file. The two commands differ: The cat prints the contents of the file, while the more is displayed on a split screen

eg CAT>1.C//You can paste the code into the 1.c file, press Ctrl+d to save the code.

Cat 1.c or more 1.c//can view content inside.

Gcc-o 1 1.c//compiles 1.c into an. exe file, and we can compile the code with this command.

8.chmod Command Permissions Modify usage: chmod a 8 binary number filename.

Eg:chmod u+x filenmame//Just want to run for themselves, others can only read

U represents the file owner, and G represents the group where the file is located. o denotes others; R table readable, W table writable, x table can be run

chmod g+x filename//Same group of people to perform

9. Clear,date command

Clear: Clear screen, quite with DOS Cls;date: Displays the current time.

Mount load a hardware device

Usage: Mount [parameter] the device load point to load

Eg:mount/dev/cdrom

Cd/mnt/cdrom//Enter the disc directory

One. Su switches to another person's identity without exiting the login

Usage: SU-L User name (if user name is default, switch to root state)

Eg:su-l netseek (Switch to netseek This user, will be prompted to enter the password)

12.whoami,whereis,which,id

WHOAMI: Confirming your identity

Whereis: Query the directory where the command resides and the directory where the Help document resides

Which: Query the directory where the command is located (similar to Whereis)

ID: Print out your UID and GID. (UID: A unique identification of the user identity.) GID: User group identity unique identity. Each user can only have a unique UID and GID)

Eg:whoami//Display your self-logged in user name

Whereis bin Displays the directory where the bin is located and will be displayed as:/usr/local/bin

Which bin

Grep,find.

grep: text content search; find: File or directory name, and permissions belong to the main matching search

EG:GREP Success */* Find files containing success characters in all files under the current directory

Kill kills a process that is in progress or is already in a dest state

eg PS AX

passwd can set the password

The commands used by the history user

Eg:history//can display commands used by the user in the past

17.!! Perform the most recent command

mkdir command

Eg:mkdir Netseek//create Netseek this directory

. Tar decompression Command

EG:TAR-ZXVF nmap-3.45.tgz//unzip this into the nmap-3.45 directory.

Finger can allow users to query some other user's information

Eg:finger//View the user's usage profile

Finger root//view root information

The function of some major directories under Linux

/bin binary Executable command

/dev Device Special files

/etc system administration and configuration files

/ETC/RC.D startup configuration files and scripts

The base point of the home user directory, such as the user's home directory is/home/user, can be represented by ~user

/lib Standard Programming Library, also known as dynamic Link shared library, acts like a. dll file in Windows

/sbin System Management commands, which are stored in the hypervisor used by the system administrator

/tmp Common temporary file storage point

/root system Administrator's home directory (hehe, privileged Class)

The/MNT system provides this directory to allow users to temporarily mount other file systems.

/lost+found This directory is usually empty, the system is not properly shut down and leave the "homeless" files (what is called under Windows. chk) right here.

/proc a virtual directory, which is a mapping of system memory. This directory can be accessed directly to obtain system information.

/var overflow area for some large files, such as log files for various services

/usr The largest directory, the applications and files to be used almost all in this directory. These include:

/USR/X11R6 the directory where x window is stored

/usr/bin a multitude of applications

/usr/sbin Some management programs for super users

/usr/doc Linux Documentation

/usr/include the header files needed to develop and compile applications under Linux

/usr/lib Common dynamic-link libraries and package profiles

/usr/man Help Documentation

/USR/SRC source code, the Linux kernel source is placed in the/usr/src/linux

/usr/local/bin Local Add-on command

/usr/local/lib local additions to the library

Second, the Linux file system

The file system refers to the physical space in which a file exists, and each partition in a Linux system is a file system with its own directory hierarchy. Linux will form the overall directory hierarchy of a system in a way that is divided into separate file systems that belong to different partitions. An operating system can not operate without the operation of the file, so it is necessary to own and maintain their own file system.

The Linux file system uses an index node to log file information that acts like a Windows file allocation table.

An index node is a structure that contains information such as the length of a file, creation and modification times, permissions, affiliation, location on disk, and so on. A file system maintains an array of index nodes, each of which corresponds to the only element in an array of index nodes. The system assigns a number to each index node, which is the index number of the node in the array, called the index node number.

The Linux file system saves both the file index node number and the filename in the directory. So, the directory is just a table that combines the name of the file with its index node number, and each pair of file names and index nodes in the directory is called a connection.

For a file, there is a unique index node number corresponding to it, for an index node number, but can have more than one file name corresponding. Therefore, the same file on the disk can be accessed through a different path.

You can use the LN command to create a new connection to an already existing file without copying the contents of the file.

The connection has the soft connection and the hard connection cent, the soft connection is also called the symbolic connection. Each of them is characterized by:

Hard connect: Both the original file name and the connection file name point to the same physical address.

Directories cannot have hard connections, hard connections cannot span file systems (cannot span different partitions)

The file has only one copy on the disk, saving hard disk space;

Because deleting a file succeeds when the same index node belongs to a unique connection, you can prevent unnecessary accidental deletions.

Symbolic connections: Creating symbolic connections to files with the Ln-s command

A symbolic connection is a special file of Linux, and as a file, its data is the pathname of the file it is connected to. Like a shortcut under Windows.

Can delete the original file and save the connection file, there is no prevention of accidental deletion function.

This paragraph of the content is too abstract, but also the node is an array, I have tried to popular again, and not good examples for demonstration. If you are still foggy, I have no way, only first remember, in the future in the practical application of slowly experience, understanding. This is also my study of a method.

Third, Mount file system

As we know from the previous section, each partition in a Linux system is a file system with its own directory hierarchy. Linux will form the overall directory hierarchy of a system in a way that is divided into separate file systems that belong to different partitions. The word "in a certain way" means the mount.

Hang the top-level directory of one file system on a subdirectory of another file system, making them a whole, called mounts. Refer to this subdirectory as a mount point.

Let's take an example:

Root partition:

/root directory

┏━━━━┳━━━━━┳━━━━━┳━━━━━╋━━━━━┳━━━━━┳━━━━━┳━━━━━┓

┃┃┃┃┃┃┃┃┃

Bin Home Dev etc lib sbin tmp usr var

┏━┻━┓

┃┃

RC.D CRON.D

┏━━━┳━━━┳━┻━┳━━━━┓

┃┃┃┃┃

INIT.D rc0.d rc1.d rc2.d ...

/usr partition:

Usr

┏━━━━┳━━━╋━━━┳━━━┳━━━┓

┃┃┃┃┃┃

X11R6 src Lib local man bin

┃┃

┃┏━━━╋━━━┓

┃┃┃┃

Linux bin Lib Src

Linux Face question 001

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.