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
31
votes
2 answers

When to use single quotes, double quotes, or no quotes in grep?

While trying to search for a simple pattern "hello" in a file, all the following forms of grep work: grep hello file1 grep 'hello' file1 grep "hello" file1 Is there a specific case where one of the above forms work but others do not. Does it make…
TheLameProgrammer
31
votes
3 answers

Did a cat /dev/urandom - Broken terminal

Out of curiosity, when your shell character set breaks from doing something like cat /dev/urandom is there a way to fix that in place?
31
votes
7 answers

Don't need the whole line, just the match from regular expression

I simply need to get the match from a regular expression: $ cat myfile.txt | SOMETHING_HERE "/(\w).+/" The output has to be only what was matched, inside the parenthesis. Don't think I can use grep because it matches the whole line. Please let me…
Alex L
  • 591
  • 2
  • 5
  • 12
31
votes
6 answers

Linux server out of space

I have been asked this question in two consecutive interviews, but after some research and checking with various systems administrators I haven't received a good answer. I am wondering if somebody can help me out here. A server is out of disk space.…
Abhijeet Jahagirdar
30
votes
11 answers

Live view of Linux shell commands executed by another user?

Is it possible for the root user in Linux to have a real-time (or close to real-time) view of the shell commands being run by another user logged in via a terminal or SSH? Obviously they're stored in .bash_history, but that's only saved when the…
EMP
  • 5,172
  • 10
  • 37
  • 33
30
votes
13 answers

Is there a paging version of `watch`?

Under a UNIX shell, how can I get a similar effect to the watch command, but with paging so that I can scroll around in the output if it takes up more than one screen? In other words, I want a program that is to watch what less is to cat. As an…
David Dean
  • 441
  • 1
  • 6
  • 11
29
votes
2 answers

How to interpret output from Linux 'top' command?

Following a discussion made HERE about how PHP-FPM consuming memory, I just found a problem in reading the memory in top command. Here is a screenshot of my top just after restarting PHP-FPM. Everything is normal: about 20 PHP-FPM processes, each…
Googlebot
  • 1,047
  • 2
  • 15
  • 30
29
votes
12 answers

How can I display the IP address of an interface?

If I want to display the IP address that is assigned to eth1, how can I do this in Bash?
user47556
  • 509
  • 1
  • 5
  • 11
28
votes
1 answer

Force "net user" command to set password longer than 14 characters

I'm issuing some "net user" commands to setup a local user on my desktop for some testing purposes and require setting a password longer than 14 characters. In doing so Windows barks back a propmt to confirm the long password, and I'm wondering if…
jxramos
  • 789
  • 1
  • 8
  • 11
27
votes
5 answers

Git shell not enabled?

I'm trying to install git server. When I set default shell for my git user to /usr/bin/git-shell I get an error upon login as git. fatal: Interactive git shell is not enabled. hint: ~/git-shell-commands should exist and have read and execute…
Peter
  • 405
  • 1
  • 5
  • 8
27
votes
2 answers

What's the Busybox default shell?

My guess is this defaults to Bash, but would like to know for sure. Thanks.
vivekian2
  • 538
  • 3
  • 8
  • 13
27
votes
2 answers

Can I call pushd/popd and prevent it printing the stack?

After calling pushd/popd in bash, it will print off the current directory stack. Is there any way to prevent this behaviour, so that it will act 'quitely'? This sort of noise in a command is uncommon in unix tools.
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
26
votes
2 answers

Proxy exceptions when using $http_proxy env var?

In a typical browser, when we set a proxy server, we can define a list of hostnames/IP addresses that are not to use the proxy server. How do we accomplish the same thing when using $http_proxy? I rely on setting $http_proxy to use the proxy server…
feicipet
  • 565
  • 1
  • 6
  • 13
26
votes
12 answers

How to find the gateway IP address in Linux

What command can you use to find the Gateway IP Address (ie. home router address) for eth0 in Linux? I need to get the IP address from a command line app to use in a shell script.
J. Polfer
  • 529
  • 2
  • 6
  • 9
26
votes
6 answers

From a shell script, how can I check whether a MySQL database exists?

mysqladmin -uroot create foo returns an exit status of 1 if foo exists, and 0 otherwise, but of course it will also create the database if it doesn't already exist. Is there some easy way to simply check whether a database exists?
ithinkihaveacat
  • 1,624
  • 3
  • 14
  • 18