Charset alias file attributes

Character Set
What is the character set
various language on a Linux system the way
GBK GB
UTF-8 Unicode
ensure xshell or crt character sets and systems consistent
1. How to check the character set
echo $ LANG

en_US system default language of

Temporarily change the character set
export LANG = zh_CN.UTF-8 (shell programming)

man helped
built-in command belongs to the GNU project bash, bash own use help see the help (help view help)
External commands use a third party to install additional man View Help

Permanently modify the character set
Note: modify the configuration file first comment, changes in the copy line
1) modify the configuration file
centos7 /etc/locale.conf
take effect
/etc/locale.conf or source /etc/local.conf or restart the computer.
Centos6
/ etc / sysconfig / the i18n
2) using commands that modify
temporary additional permanent
localectl set-locale LANG = "zh_CN.UTF -8"
into effect
. /etc/locale.conf or reboot the computer or source /etc/local.conf

alias alias
system in order to secure a certain set of commands nickname
LS LL -l ======
CP = 'CP -i'
Music Videos = 'Music Videos -i'
RM = 'RM -i'

如何查看别名
alias 查看所有
alias cp 查看单独的命令别名

如何取消别名
1)临时取消别名 临时生效
    \rm 1.txt
2)使用命令的全路径  临时生效
    which 命令 查看命令的全路径 系统默认命令的路径的环境变量%PATH
    whereis查看命令的全路径及相关的文件路径

    /usr/bin/rm 2.txt
3)取消别名
    unalias rm 取消别名  临时生效

永久生效
a./etc/profile
b.~/ .bashrc  注释
环境变量文件执行的顺序
/etc/profile
~/ .bashrc
~/.bash_profile

如何配置别名
小名='echo 呵呵' 等号后面 必须是可执行命令
设置rm命令不能用
alias rm='echo 该命令无法使用 别名可自定义
案例:eth0 网卡设置别名
    alias vieth0='vim /etc/sysconfig/networ-scripts/ifcfg-eth0'

File attributes
ls - list directory contents displays the current file information
-i inode
-r alphabetical flashback
-t ordered by time
ls -lrt display the newly created file

ls -lhi

-Rw-R & lt 33,825,343 - r-- the root. 1 0-Aug. 5 20:03 3.txt the root.
The inode - number of hard links to the file type is a group of the owner of the file size
rw-r - r-- file permissions
. Selinux opening there is
a first row inode (index Node)
inode Node index file storage block pointer attribute and a pointing (pointing to the storage location of the file)
DF -i inode usage See
second column (ten) of file type and permissions
first type column file
windows file type
.exe executable file
.txt documents
.jgp picture
.mp4 video
qinghu.avi video
.PDF document
type Linux file system
view files file type
1) - a common type of file
1) ordinary file oldboy.txt
2) oldboy.txt command file LS
. 3) compressed data file

2)d 目录
3)l软链接文件 softlinks  相当于windows的快捷方式
4)b块设备
    ll /dev/cdrom ,ll /dev/sda
5)c字符设备
    /dev/null 黑洞

    ?上一条命令的变量
    echo $?查看上一条命令的执行结果1代表失败0代表成功
    /dev/urandom 白洞
    a tr 命令拓展
    b RANDOM 0-32767之间的数字 

-cd TR "the Z-A-zA" </ dev / urandom | head -C8 | TR "AZ" "0-9"
the RANDOM kept the 0-32767
[Oldboy the root @ ~] # echo $ ((+ 100% the RANDOM 1)) to generate the random 1-100
. 6) P plumbing
7) s socket device
permissions tenth column to the second column of the file
the third column of the plurality of file permissions later. this is emerging after opening SELinux, gone off
the number (a default file directory 2) the third column hardwired
hard link is equivalent to the supermarket to open more doors
in the fourth column owner is a group of
fifth column file sizes
sixth column time
seventh column file name
documents related to command
file
to view the file type
alias
alias
which
to view the full path to the command
whereis
to view the full path and associated command file path
the Find
(. try not find files use at work / work using an absolute path) to find the file
-name name
- MG size size k
-mtime chronological modifile time modification time access time access create time to create time
find a path (to find the directory) -type (file type - / fdbcpsl)
the Find. The -type f
-name find files by name
find ./ -type f -name "1.txt"
any character
the Find ./ The -type f -name "
.txt"
-maxdepth depth level
to find the current directory maximum depth rating level. 1
Find F ./ -name -type -maxdepth. 1 " .txt"
in accordance with the size of the lookup
to find files larger than 1M
Find F ./ -size + -type 1M
lookup file is less than 1OM
Find -type F ./ -size -10m
Find file greater than and less than 1M 1OM
Find F ./ -size + -type 1M -size -10m
Find and -and default
lookup file is larger than the end .txt and 1OM
Find -type F ./ -name "
.txt" -size + 1OM

    按照时间来查找
    find /tmp -type f -mtime +7 查找7天前修改过的文件
    find /tmp -type f -mtime -5 查找5天内修改过的文件
    find /tmp -type f -mtime 7 查找第7天修改过的文件

    如何把find结果交给其他命令来使用
    常用命令 rm mv cp cat

How the first result to the cat to use
the method. 1
Find / tmp -name -type F "oldboy.txt" | xargs cat
Method 2
Find / tmp -name -type F "oldboy.txt" cat -exec {} \;

The second result to how mv cp
method. 1
Find / tmp / F -type -name "1.txt.bak" | Music Videos xargs -i} {/ the root
Method 2
Find / tmp / -name -type F ". 1 .txt.bak "-exec mv {} / root \;

Guess you like

Origin blog.51cto.com/14465325/2428985