vi或者vim文件加密和乱码的处理
vi或者vim文件加密和乱码的处理
在使用vi或者vim编辑文件是,在存盘退出的时候,应该使用:wq或者:x退出,但是有时候可能不小心按了:X,
这时体统会提示:
Enter encryption key:
如果你没有仔细看提示,比如继续输入:x,
Enter encryption key: *
Enter same key again: *
那么实际上就给这个文件加密了,下次打开就会要求你输入密键,例如:
[oracle@ts01 admin]$ vim $ORACLE_HOME/sqlplus/admin/glogin.sql
Enter encryption key: *
--
-- Copyright (c) Oracle Corporation 1988, 2000. All Rights Reserved.
--
-- NAME
-- glogin.sql
--
-- DESCRIPTION
-- SQL*Plus global login startup file.
--
-- Add any sqlplus commands here that are to be executed when a user
-- starts SQL*Plus on your system
--
-- USAGE
-- This script is automatically run when SQL*Plus starts
--
-- For backward compatibility
SET PAGESIZE 14
SET SQLPLUSCOMPATIBILITY 8.1.7
-- Used by Trusted Oracle
COLUMN ROWLABEL FORMAT A15
-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR FORMAT A65 WORD_WRAPPED
-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
-- Defaults for SET AUTOTRACE EXPLAIN report
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44
set linesize 132
set serveroutput on size 1000000
set timing on
--set trimspool on
set long 5000
set linesize 132
set pagesize 9999
column plan_plus_exp format a80
column global_name new_value gname
set termout off
define gname=idle
column global_name new_value gname
define gname=idle
column global_name new_value gname
select lower(user) || '@' || substr( global_name,1,
decode( dot, 0, length(global_name), dot-1) ) global_name
from (select global_name, instr(global_name,'.') dot from global_name );
set sqlprompt '&gname> '
set termout on
[oracle@ts01 admin]$
否则就显示乱码。
要接触密码,步骤如下:
vim file
Enter encryption key: 输入密码
:set key=
:w!
例如:
[oracle@ts01 admin]$ vim $ORACLE_HOME/sqlplus/admin/glogin.sql
Enter encryption key: * 输入密码
。。。。。。。。文件正文原文
:set key=
:w! 存盘
现在这个密码的口令限制就解除了,呵呵。