[решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Kubuntu, Xubuntu и другие

Модератор: Модераторы разделов

aleksnsk
Сообщения: 180

[решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение aleksnsk »

ubuntu 13.10 Как отключить логи (введенные команды с терминала)?
Спасибо сказали:
Аватара пользователя
Bizdelnick
Модератор
Сообщения: 21395
Статус: nulla salus bello
ОС: Debian GNU/Linux

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение Bizdelnick »

Что?
Пишите правильно:
в консоли
вку́пе (с чем-либо)
в общем
вообще
в течение (часа)
новичок
нюанс
по умолчанию
приемлемо
проблема
пробовать
трафик
Спасибо сказали:
aleksnsk
Сообщения: 180

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение aleksnsk »

В терминале не должно быть возможности просматривать последние введенные команды.

Изменил в файле .bashrc следующие переменные:
HISTSIZE=1
HISTFILESIZE=1

Удалил файл .bash_history и создал заново.

Но последние введенные команды остались.
Спасибо сказали:
allez
Сообщения: 2223
Статус: Не очень злой админ :-)
ОС: SuSE, CentOS, FreeBSD, Windows

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение allez »

Попробуйте добавить в файл ~/.profile следующие строки:

Код: Выделить всё

export HISTSIZE=0
export HISTFILESIZE=0
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение drBatty »

aleksnsk писал(а):
27.02.2014 16:14
введенные команды с терминала

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.
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
aleksnsk
Сообщения: 180

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение aleksnsk »

aleksnsk писал(а):
27.02.2014 16:55
HISTSIZE=1
HISTFILESIZE=1
Удалил файл .bash_history и создал заново.
+ Перезапустил терминал - работает!
Спасибо сказали:
Аватара пользователя
SLEDopit
Модератор
Сообщения: 4824
Статус: фанат консоли (=
ОС: GNU/Debian, RHEL

Re: [решено] ubuntu 13.10 Как отключить логи (введенные команды с терминала)?

Сообщение SLEDopit »

Ага, только вам история в пределах сессии тоже не доступна. Так очень неудобно работать. Есть более хитрый способ:

$

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.
Спасибо сказали: