Questions tagged [shell]

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion.

Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

The name was first used by Unix operating system for an interpreter used for command prompt, but currently the term shell refers to BASH(Bourne Again SHell) and other command prompt interpreters too.

1348 questions
13
votes
7 answers

How to log every linux command to a logserver

I want every single command typed to go to a logserver. Already configured is the syslog-ng to send all logs to the logserver. I'm interested in any and all methods to do this. I would expect some discussion of rogue users and security but the…
Leo
  • 1,038
  • 1
  • 8
  • 13
12
votes
2 answers

What is the best way to set an environment variable in .bashrc?

When setting up a variable in .bashrc, should I use this? export VAR=value Or would this be enough? VAR=value What is exactly the difference (if there is one)?
Flávio Amieiro
  • 753
  • 2
  • 9
  • 18
12
votes
4 answers

gpg-agent says agent exists, but gpg says agent doesn't exist?

I'm struggling with some issues while scripting gpg with bash on a Debian 6.0.6 box. I have a script that does a batch of operations and wants to make sure that a gpg-agent is available before it attempts to proceed. Since gpg-agent will take no…
Craig Ringer
  • 11,083
  • 9
  • 40
  • 61
11
votes
4 answers

Bash: how to know if the last command's output ends with a newline or not?

Most of the time the output of a command ends with the newline character. But sometimes it does not, so the next shell prompt is printed in the same line together with the output. Example: root@hostname [~] # echo -n hello helloroot@hostname [~]…
GetFree
  • 1,500
  • 7
  • 23
  • 37
11
votes
9 answers

How to restrict the users' shell allowing to execute shell programs

Is it possible to prevent any user to not use commands like ls, rm and other system commands which could harm the system. But the users should be able to execute shell programs.
Hulk
  • 391
  • 1
  • 6
  • 17
11
votes
2 answers

Can I change the ownership of all the files of a specific user?

Is there a way to recursively find all files owned by a user and change them to another user/group in Gnu/Linux? I assume there must be some magic one liner but my command line wizardry skills are not up to that :) Thanks!
john
  • 1,025
  • 3
  • 9
  • 15
11
votes
4 answers

Linux / mysql: is it safe to copy mysql db files with cp command from one db to another?

Most guides recommend mysqldump and simple SQL for copying one table to anoter db. How about linux shell cp? Can I just simply do cp /db1/mytable.frm /db2/mytable.frm
giorgio79
  • 1,837
  • 9
  • 26
  • 36
11
votes
1 answer

How to concatenate streams?

I know cat can concatenate files, but I need to concatenate a mix of files and streams and pipe the result to another process. To make the question more concrete, I want to concatenate cat abc.sql together with gzip -dc xyz.sql.gz and cat qvf.sql…
rustyx
  • 1,676
  • 3
  • 21
  • 30
11
votes
5 answers

piping a password and security

I sometimes do echo "secret" | mysql -u root -p .... Now I'm concerend about security here: can someone listing all processes see the password? To check I tried with echo "test" | sleep 1000 and the echo command with the secret was not visible in…
gucki
  • 818
  • 2
  • 11
  • 29
11
votes
7 answers

Using telnet in shell script

I use the telnet command to check if MySQL port is responding. telnet 10.10.10.24 3306 I use the ctrl character to disconnect. This is working as expected. How do I use this command in shell script?
shantanuo
  • 3,579
  • 8
  • 49
  • 66
11
votes
6 answers

What distributed shell utilities do people feel are good, flexible, and easy to use?

I've been searching and collecting links for a lot of them, but many of these tools don't have enough use case or demonstration documentation to be able to evaluate their potential worth without installing and trying them out. I am hoping that…
deinspanjer
  • 340
  • 3
  • 9
11
votes
2 answers

ssh how to allow a very limited user with no home to login with pubkey

I have a very restricted user in my ssh server created with --no-create-home and --shell /bin/false. I know I can define authorized_keys file in sshd_configs for the user's public key. But how can I allow public key authentication for this user…
Mojtaba Rezaeian
  • 451
  • 5
  • 14
10
votes
3 answers

Find's -true option: what for?

GNU find (and others?) has a -true test along with the normal -name, -mode, -user and so on. From the man page: -true Always true. Every time I see the man page I notice this and wonder when it'd be useful. So, give me some examples of when it's…
markdrayton
  • 2,449
  • 1
  • 20
  • 24
10
votes
1 answer

How to "un-ANSI-fy" logs?

Lately there has been a tendency by command line tools to use fancy ANSI colors in their log output (for example, NPM and a host of nodejs based tools, rvm, docker, and a few other "modern" tools). This makes it nice to read on the screen(*), but…
Guss
  • 2,670
  • 5
  • 34
  • 59
10
votes
8 answers

Find directories, where files with a specific ending are missing

I want to display all directories, that do not contain files with a specific file ending. Therefore I tried using the following code: find . -type d \! -exec test -e '{}/*.ENDING' \; -print In this example I wanted to display all directories, that…
bamboo
  • 101
  • 3