This chapter covers 7 aspects: File type description, use of LS, CD, type command, environment variable Brief introduction, Time introduction and get help seven parts.
I. File type description
Drwxr-xr-x. 3 root root 4096 Mar 21:52 sound
1. File type (1-bit):-: Indicates normal file
D: Catalog file
B: Block device files (blocks)
C: Character device file (character)
L: Link files (symbolic link file)
P: Piping file (pipe)
S: socket (socket)
2, file permissions (2-10-bit): 3-bit group, a total of 9 bits. Each group is rwx (read, write, execute), without this permission, with-occupancy
3, File hard link number
4. Document owner
5. Group of documents
6, File size (size)
7, timestamp (timestamp), the last time the file was modified.
File has three time: last access time (access), Last modification Time (Modify) (refers to changing file contents), Last changed time (change) (changed file attributes and name, etc.)
View method: Stat file name
--------------------------------------------------------------------------------------------------
[Email protected] etc]# stat Sound
File: ' Sound '
size:4096 blocks:8 IO block:4096 Directory
device:803h/2051d inode:1967162 Links:3
Access: (0755/drwxr-xr-x) Uid: (0/root) Gid: (0/root)
Access:2010-07-14 23:55:07.000000000 +0800
Modify:2015-03-10 21:52:31.835150870 +0800
Change:2015-03-10 21:52:31.835150870 +0800
8. File name
Clear: Can be used to clear the screen.
Ii. introduction of LS command
Ls:list, which displays the properties of a file, or a subdirectory of a directory
LS (directory path): Display directory, file
LS File name path: Displays the properties of a file
LS Common options:-L: Long format display file properties
-H: Do unit conversions (default is k), no h is bit
-A: Displays all files, wrapped with '. ' Hidden files at the beginning
-A: Displays all files, not parcels. With.
-D: Display the directory's own properties
-I: Displays the index node number of the file: Each file has a numeric identifier, Inode = Index node, which is also called an index node
-R: Show files in reverse order
-R: Recursive display (recusrive)
-----------------------------------------------------------------------------------
[[email protected] ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[[email Protected] ~]# ls-al
Total
Dr-xr-x---. 2 root root 4096 Mar 01:26.
Dr-xr-xr-x. Root root 4096 Mar 12 18:18..
-rw-------. 1 root root 0 Mar 12 01:26. Xauthority
-rw-r--r--. 1 root root 20 . bash_logout
-rw-r--r--. 1 Root root 176 may 20 . Bash_profile
-rw-r--r--. 1 root root 176 Sep 23 20 BASHRC
-rw-r--r--. 1 root root Sep 23 2004. CSHRC
-rw-r--r--. 1 root root ; 129 dec 4 2004. TCSHRC
-rw-------. 1 root root 1152 Mar 21:59 anaconda-ks.cfg
-RW -r--r--. 1 root root 25213 mar 21:59 install.log
-rw-r--r--. 1 root root 7690 Mar 21:56 Install . Log.syslog
[Email protected] ~]# ls-a
. .. . Xauthority. Bash_logout. Bash_profile. BASHRC cshrc. TCSHRC anaconda-ks.cfg Install.log Install.log.syslog
[Email protected] ~]# ls-a
. Xauthority. Bash_logout. Bash_profile. BASHRC cshrc. TCSHRC anaconda-ks.cfg Install.log Install.log.syslog
[Email protected] ~]# LS-LH
Total 44K
-RW-------. 1 root root 1.2K Mar 21:59 anaconda-ks.cfg
-rw-r--r--. 1 root root 25K Mar 21:59 Install.log
-rw-r--r--. 1 root root 7.6K Mar 21:56 install.log.syslog
[Email protected] ~]# ls-i
1310729 anaconda-ks.cfg 1310722 install.log 1310723 install.log.syslog
[Email protected] ~]# ls-d/root
/root
[Email protected] ~]# Ls-lid/root
1310721 Dr-xr-x---. 2 root root 4096 Mar 01:26/root
[Email protected] ~]# Ls-r
Install.log.syslog Install.log anaconda-ks.cfg
Third, CD: Switch directories change directory
Switch to the current home directory without any directories (home directory)
To make a path: switch to the path specified below
-: Switch between the previous directory and the current directory
~: Switch to the current home directory
~ User name: Switch to the home directory of the specified user
.. : Switch to the previous level directory
Pwd:print working directory: Displays the current directory, that is, the absolute path to the directory that is now displayed.
Iv. Type: Displays the type of command, internal or external.
Internal command: (Shell built-in), internal, built-in
External command: There is an executable file in the file system that corresponds to the name in a path.
V. Environment variables
Environment variables: Defines the memory space of the current user's working environment.
Printenv: Displays the current environment variable.
Note path= A bunch of paths that are split with colons. followed by the path of the executable program, in the execution of the program and do not specify the path, the system by default in the path from the path to look for executable programs, and perform the first found.
Hash: A cache that records previously used commands and the number of times they are used
Variable: A named memory space. Variables can be applied to revoke
Variable declaration, which is the process of requesting memory. Variable assignment, which is to store the data in the corresponding memory.
Stack: Heap: Data that needs to be accessed
Stack: Local life variables and static variables
All variables are a configuration file corresponding to it.
---------------------------------------------------------------------------------------------------------
[Email protected] ~]# printenv
Hostname=lab1
Selinux_role_requested=
term=vt100
Shell=/bin/bash
histsize=1000
ssh_client=192.168.10.1 61481 22
Selinux_use_current_range=
qtdir=/usr/lib/qt-3.3
Qtinc=/usr/lib/qt-3.3/include
ssh_tty=/dev/pts/0
User=root
ls_colors=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05 ; 37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*. taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*. Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31 :*. deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*. jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*. xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*. mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*. qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv =01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*. xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:* . au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*. WAV=01;36:*.AXA=01;36:*.OGA=01;36:*.SPX=01;36:*.XSPF=01;36:
ssh_auth_sock=/tmp/ssh-myueuh3980/agent.3980
Mail=/var/spool/mail/root
Path=/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Pwd=/root
lang=en
Selinux_level_requested=
Histcontrol=ignoredups
Shlvl=1
Home=/root
Logname=root
Qtlib=/usr/lib/qt-3.3/lib
Cvs_rsh=ssh
ssh_connection=192.168.10.1 61481 192.168.10.100 22
Lessopen=|/usr/bin/lesspipe.sh%s
G_broken_filenames=1
_=/usr/bin/printenv
[[email protected] ~]# hash
Hits command
7/bin/date
1/usr/bin/printenv
4/sbin/hwclock
VI: Date: Time management
In Linux, time is divided into system time and hardware time.
Hardware time: The time the hardware is calculated on the motherboard. Date
System time: The operating system calculates the time itself. Hwclock, Clock
System Time Modification Method: Date [MMDDHHMM[[CC]YY][.SS]]
System time synchronized to hardware time: hwclock-w
Hardware time synchronization to system time: hwclock-s
Date Common parameters: +%d (date)%d (day)%T (hours)%F (date)%y-%m-%d%h:%m:%s (custom display format)
[Email protected] ~]# date +%d
03/16/15
[Email protected] ~]# date +%d
16
[Email protected] ~]# date +%t
19:01:22
[Email protected] ~]# date +%f
2015-03-16
[Email protected] ~]# date +%y-%m-%d
2015-03-16
[Email protected] ~]# date +%h:%m:%s
19:02:41
Seven: Get Help
1. Help
Internal Command help command external command with internal command firm method: type
External command--help
2, man
Man sub-section: 1, user commands (/bin,/usr/bin,/usr/local/bin)
2. System call
3. Library Call
4. Special documents (equipment files)
5. File format (configuration file indicates the operation properties of the instruction, the syntax of the configuration file corresponding to a command)
6. Games
7. Miscellaneous (Miscellaneous)
8. Management commands (/bin,/usr/sbin,/usr/local/sbin. Commands used by administrators, modifying hardware parameters, hardware operating characteristics, and other system-level configurations): Mount
Man's file Description: "" means to omit, | Denotes multiple selection One, <> indicates that a 、... must be used Represents a group that can be used multiple times, {}
Section: Name: A brief introduction to command names and functions
Synopsis: Usage notes, including available options
DESCRIPTION: A detailed description of the command function, including the meaning of each option.
Options: Describes the meaning of each option.
Files: The configuration file associated with this command
Bug:bug reporting methods.
EXAMPLE: Using the example
See ALSO: Additional references
Shortcut key: Turn one screen: space
One screen ahead: b
After line: Enter
Previous line: K
Search:/keyword
Search from the tail:? Keyword
N: Next
N: Previous
Q: Exit
This article is from the "ice is Asleep water" blog, please be sure to keep this source http://278893181.blog.51cto.com/3156502/1621363
Linux Basics 2