New answers tagged

2

If your goal is to monitor the system, you want pam_tty_audit. As the name implies, pam_tty_audit is a pam module which when configured properly, is invoked any time a user opens a session (and gets a TTY). The module records all input & output, and sends everything it records to the auditd daemon. You can then execute queries against the auditd daemon ...


2

If you really want to, you could make a program (or shell script) which calls script writing to a timestamped "typescript" file (and in turn calling your real shell) and make that program your default shell in /etc/passwd. There are a few pitfalls: you may have to add this program to /etc/shells doing this sets the SHELL environment variable, which is ...


1

If you go a few levels deeper then it'll start truncating $ sweh in ~: cd D1 $ sweh in ~/D1: cd D2 $ sweh in ~/D1/D2: cd D3 $ sweh in ~/D1/D2/D3: cd D4 $ sweh in ~/D1/D2/D3/D4: cd D5 $ sweh in ~/.../D3/D4/D5: cd D6 $ sweh in ~/.../D4/D5/D6: Outside of $HOME it appears to truncates earlier: $ sweh in ~: cd /usr/local/share/locale/ $ sweh in .../local/...


1

The shell that you get when you execute a command remotely with SSH is neither an interactive shell nor a login shell: $ ssh server 'bash -c "echo $-"' chsB (there's no i and no l in the response) In Bash's case that means that none of the usual initialization files are read. You can force the remote shell to be a login shell by adding -l to your Bash ...


0

I had the same problem, and at first shopt -s expand_aliases didn't seem to help. What I've found out is that this options should be set before adding the actual aliases. So if aliases are created before your .bashrc sets the expand_aliases options, they won't be available. Therefore, you should load (or reload) aliases after setting the option.


0

One step up from an alias would be a function: function b2 { build "$@" beep } Name it anything you want, and then call it with, for example: b2 arg1 arg2.


2

Use a shell function: build() { command build "$@"; beep; } To make this function permanent, add it to ~/.bashrc.


0

Go to terminal preferances. And then click to "command" bar. Check the "Run a custom command instead of my sell" and write whatever command you want to execute at the startup of your terminal.


1

You can use bind -r "key" to remove the binding. For example if you have yank bound to "\C-y" issuing bind -r "\C-y" will remove that binding (in the current shell). To reset all key bindings to default use set -o emacs or set -o vi.


1

This is how its done in .inputrc: set editing-mode vi $if mode=vi # these are for vi-command mode set keymap vi-command # unbind space " ": "" # bind space-a, space-; " a":beginning-of-line " ;":"$" $endif



Top 50 recent answers are included