[решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
Модератор: Модераторы разделов
-
aleksnsk
- Сообщения: 180
[решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
-
Bizdelnick
- Модератор
- Сообщения: 21395
- Статус: nulla salus bello
- ОС: Debian GNU/Linux
Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
Что?
Пишите правильно:
| в консоли вку́пе (с чем-либо) в общем вообще | в течение (часа) новичок нюанс по умолчанию | приемлемо проблема пробовать трафик |
-
aleksnsk
- Сообщения: 180
Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
В терминале не должно быть возможности просматривать последние введенные команды.
Изменил в файле .bashrc следующие переменные:
Удалил файл .bash_history и создал заново.
Но последние введенные команды остались.
Изменил в файле .bashrc следующие переменные:
HISTSIZE=1
HISTFILESIZE=1
Удалил файл .bash_history и создал заново.
Но последние введенные команды остались.
-
allez
- Сообщения: 2223
- Статус: Не очень злой админ :-)
- ОС: SuSE, CentOS, FreeBSD, Windows
Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
Попробуйте добавить в файл ~/.profile следующие строки:
Код: Выделить всё
export HISTSIZE=0
export HISTFILESIZE=0-
drBatty
- Сообщения: 8735
- Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
- ОС: Slackware-current
Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
1. это не логи, а история.
2. man bash
HISTORY
When the -o history option to the set builtin is enabled, the shell provides access to the
command history, the list of commands previously typed. The value of the HISTSIZE variable
is used as the number of commands to save in a history list. The text of the last HISTSIZE
commands (default 500) is saved. The shell stores each command in the history list prior to
parameter and variable expansion (see EXPANSION above) but after history expansion is per-
formed, subject to the values of the shell variables HISTIGNORE and HISTCONTROL.
On startup, the history is initialized from the file named by the variable HISTFILE (default
~/.bash_history). The file named by the value of HISTFILE is truncated, if necessary, to
contain no more than the number of lines specified by the value of HISTFILESIZE. When the
history file is read, lines beginning with the history comment character followed immedi-
ately by a digit are interpreted as timestamps for the preceding history line. These time-
stamps are optionally displayed depending on the value of the HISTTIMEFORMAT variable. When
an interactive shell exits, the last $HISTSIZE lines are copied from the history list to
$HISTFILE. If the histappend shell option is enabled (see the description of shopt under
SHELL BUILTIN COMMANDS below), the lines are appended to the history file, otherwise the
history file is overwritten. If HISTFILE is unset, or if the history file is unwritable,
the history is not saved. If the HISTTIMEFORMAT variable is set, time stamps are written to
the history file, marked with the history comment character, so they may be preserved across
shell sessions. This uses the history comment character to distinguish timestamps from
other history lines. After saving the history, the history file is truncated to contain no
more than HISTFILESIZE lines. If HISTFILESIZE is not set, no truncation is performed.
-
aleksnsk
- Сообщения: 180
-
SLEDopit
- Модератор
- Сообщения: 4824
- Статус: фанат консоли (=
- ОС: GNU/Debian, RHEL
Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
Ага, только вам история в пределах сессии тоже не доступна. Так очень неудобно работать. Есть более хитрый способ:
тогда история в пределах сессии доступна, но после выхода ничего не сохраняется.
$
unset HISTFILEтогда история в пределах сессии доступна, но после выхода ничего не сохраняется.
UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. © Dennis Ritchie
The more you believe you don't do mistakes, the more bugs are in your code.
The more you believe you don't do mistakes, the more bugs are in your code.
Спасибо сказали: