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
70
votes
5 answers

How can I check in bash if a shell is running in interactive mode?

How can I tell (in ~/.bashrc) if I'm running in interactive mode, or, say, executing a command over ssh. I want to avoid printing of ANSI escape sequences in .bashrc if it's the latter.
Alex B
  • 1,714
  • 2
  • 18
  • 30
69
votes
10 answers

Linux: using find to locate files older than

find has good support for finding files the more modified less than X days ago, but how can I use find to locate all files modified before a certain date? I can't find anything in the find man page to do this, only to compare against another files…
DrStalker
  • 6,946
  • 24
  • 79
  • 107
67
votes
10 answers

Unique Features of bash compared to zsh

I have been a zsh user for quite some time (before that tcsh and before that csh). I am quite happy with it, but was wondering if there are any compelling features of bash that do not exist in zsh. And conversely, are there zsh features which do not…
Tim
  • 1,879
  • 3
  • 18
  • 16
62
votes
5 answers

How can I hide the output of a shell application in Linux?

How can I hide the screen output (printf) of a shell application in Linux?
Jader Dias
  • 4,705
  • 19
  • 50
  • 51
62
votes
7 answers

Choosing the shell that SSH uses?

How do I set the shell that is used when a user SSHs to a server. For example I can't stand BASH and need to use ZSH, how do I make it so ZSH is loaded along with my profile (.zsh_profile) when I ssh to the machine. I dont want to have to pass a…
JP Silvashy
  • 1,447
  • 6
  • 24
  • 30
61
votes
9 answers

How to split a PEM file

Note : This is not really a question because I already found the answer but since I didn't find it easily here I will post it so that it can benefit others. Question : How to read a concatenated PEM file as the one used by apache/mod_ssl directive…
Cerber
  • 1,221
  • 1
  • 13
  • 23
61
votes
5 answers

How can I set environment variable for just one command in fish shell?

In bash, I can do EDITOR=vim crontab -e. Can I get similar effect in Fish shell?
skalee
  • 723
  • 1
  • 5
  • 6
60
votes
1 answer

What is the difference between a 'Login' and an 'Interactive' bash shell

What is the difference between a ‘Login’ and an ‘Interactive’ bash shell? I have quoted Wikipedia below but can anybody give a better answer? EDIT: This is a community wiki so maybe rather than voting to close you could provide examples of which…
Gareth
  • 8,573
  • 13
  • 44
  • 44
59
votes
8 answers

Run a shell script as a different user

What's a good way of running a shell script as a different user. I'm using Debian etch, and I know which user I want to impersonate. If I was doing it manually, I would do: su postgres ./backup_db.sh /tmp/test exit Since I want to automate the…
Wadih M.
  • 1,032
  • 1
  • 10
  • 18
55
votes
1 answer

What's the difference between sudo su - postgres and sudo -u postgres?

PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I often see people using constructs like: sudo su -…
Craig Ringer
  • 11,083
  • 9
  • 40
  • 61
55
votes
3 answers

find command default sorting order

what is the default sorting order for entries returned by the linux find command? For example, if I issue find . -type f -name '*mp3' and the output consists of multiple files across multiple sub-folders, what is the default order in which…
Nasko
  • 553
  • 1
  • 4
  • 4
54
votes
6 answers

Cron: Only get errors in emails?

I finally set up a realistic backup schedule on my data through a shell script, which are handled by cron on tight intervals. Unfortunately, I keep getting empty emails each time the CRON has been executed and not only when things go wrong. Is it…
Industrial
  • 1,579
  • 6
  • 24
  • 37
53
votes
14 answers

Templating with Linux in a Shell Script?

What I want to acomplish is: Having a config file as template, with variables like $version $path (for example apache config) Having a shell script that "fills in" the variables of the template and writes the generated file to disk. Is this…
Markus
  • 867
  • 2
  • 11
  • 13
53
votes
7 answers

Force SSH to use a specific shell

Is there any way to force SSH to use a particular shell on the remote end, regardless of what the user's default shell is? I've tried solutions akin to: ssh host.domain.com /bin/bash -c 'complicated, multi-line command' but unfortunately the…
plinehan
  • 675
  • 1
  • 5
  • 6
44
votes
23 answers

Finding the Public IP address in a shell script

I can find my IP address using ifconfig or hostname -i command. But how do I find my Public IP? (I have a static public IP but I want to find it out using unix command)
shantanuo
  • 3,579
  • 8
  • 49
  • 66
1
2
3
89 90