Basic Linux Essentials-linux 11 article brief

Source: Internet
Author: User
Tags clear screen parent directory

1>, ls:list directory contents list Contents

-L: Long format

File type

-: Universal Documents

D: Catalog file

B: Block devices (blocks)

C: Character file (character)

L: Compliant with link file (symbolic link files)

P: Command pipeline file (socket)

[Email protected] ~]# ls-ld/tmp

DRWXRWXRWT. 5 root root 4096 November 10:36/tmp

File permissions + Master (owner) + genus (group) + File size (size, Unit bytes)

-A: Shows all protections. Start with hidden files

. Current directory: Parent Directory

-H: Unit conversion

-D: Display the directory's own properties

-R: Reverse Display

-R: Recursive display

-i:index Nod,inode

--full Time: Show Details


[Email protected] ~]# ls/tmp/-al--full time

LS: Unable to access time: No file or directory

/tmp/:

Total Dosage 40

DRWXRWXRWT. 5 root root 4096 2016-11-14 08:26:25.138197188 +0800.

Dr-xr-xr-x. Root root 4096 2016-11-08 09:12:14.244789696 +0800..

DRWXRWXRWT. 2 root root 4096 2016-11-08 09:12:13.873794359 +0800. Ice-unix

DRWX------. 2 root root 16384 2016-07-20 00:21:08.000000000 +0800 lost+found

DRWX------. 2 root root 4096 2016-11-14 08:26:25.138197188 +0800 ssh-djisj35919

-rw-r--r--. 1 root root 2016-11-10 14:32:13.405295895 +0800 tmp.txt

-rw-r--r--. 1 James Root 2016-11-10 15:26:34.029648704 +0800 t.txt




2>, Cd:change directory

CD ~username: Specify the user's home directory

CD-: Current directory and previous directory switch

[Email protected] ~]# cd/etc/

[Email protected] etc]# CD-

/root

[Email protected] ~]# CD-

/etc


Pwd:printing working directory displays the current working directory

[Email protected] ~]# pwd

/root


3>, Command type:

Built-in command (shell built-in), internal, built-in

External command: An executable file with a command name under a path of the file type



4>, type: display specifies which type to belong to


5> variable assignment of environment variables

[Email protected] ~]# echo $PATH

/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[Email protected] ~]# echo $HISTSIZE

1000

[Email protected] ~]# echo $SHELL

/bin/bash

/etc/shells

/bin/sh

/bin/bash

/sbin/nologin

/bin/dash

/bin/tcsh

/bin/csh


6>, printenv: Viewing environment variables


7>, bash Memory Cache command, hit count

[[email protected] ~]# hash

Hits command

4/bin/bash

1/bin/cat

3/bin/vi

1/usr/bin/man

1/usr/bin/printenv

7/bin/cut

15/bin/ls


8>, command line cursor jump

CTRL + A: Jump to the beginning

Ctrl+e: End of line

Ctrl+u: Deleting the beginning of a line

Ctrl+k: Delete End of line

Ctrl+l: Clear Screen


9>, Command history:

History

-A: Append to/root/.bash_history

-C: Clear command history

-D: Delete the command at the specified location

-W: Cover/root/.bash_history


Command history Usage Tips

!n: Execute nth in the command history

!-n: Executes the last nth rule in the command history

!: Executes the previous line

!string: Executes the last command in the command line that starts with the specified string

!$: Reference the last parameter of the previous command



Echo: Standard output Screen output

Line break

[Email protected] etc]# ECHO-E "The year was 2016.\ntoday is 14"

The year is 2016.

Today is 14

10>, File system


/boot: System boot related files, such as kernel, init, and Grub (bootloader)


/dev: Device files

Block devices

Character device


/etc: Configuration file


/home: User House directory, each user home directory usually defaults to/home/username


/root: Administrator's home directory


/lib: library file

Static Library. A

Dynamic Library. dll. So (Shared object)

/lib/modules: Kernel module files


/media: mount point directory, mobile device

/MNT: mount point directory, additional temporary file system

/OPT: Optional directory, third-party program installation directory

/proc: Pseudo file system, kernel mapping file

/sys: Pseudo file system, property mapping file related to hardware device

/tmp: Temp file,/var/tmp

/var: a variable file

/bin: Executable file, user command

/sbin: Managing Commands


/usr:shared,read-only

/user/bin

/usr/sbin

/usr/lib


/usr/local:

Usr/local/bin

Usr/local/sbin

Usr/local/lib



11>, naming rules:

Length not exceeding 255 characters

cannot be used/

Strictly case-sensitive


12>,su:switch User Switch users

[email protected] etc]# su Jameszhan

sh-4.1$


This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1872788

Basic Linux Essentials-linux 11 article brief

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.