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

chsh: PAM authentication failed

i want to change default shell env and run chsh -s /bin/zsh as root user, but a error message appeared: chsh: PAM authentication failed. i find this thread http://ubuntuforums.org/showthread.php?t=1702833 but the answer did not solve my problem any…
txworking
  • 479
  • 2
  • 6
  • 15
19
votes
7 answers

Get list of transferred files from rsync?

I'm currently using rsync on a script that deploys a PHP application from a staging to a production server. Here is how: rsync -rzai --progress --stats --ignore-times --checksum /tmp/app_export/ root@app.com:/var/www/html/app/ This is currently…
Mauro
  • 386
  • 1
  • 4
  • 13
19
votes
2 answers

Running shell script with no environmental variables

As I know, newly running shell script inherits it's environment variables. Is there a way to block this? (running shell without variable inheriting)
Eonil
  • 10,459
  • 16
  • 36
  • 54
18
votes
6 answers

Hide the output of a shell command only on success?

Hiding the output of a shell command usually involves redirecting stderr and stdout. Is there any builtin facility or command which by default hides the output but on error dumps all the accumulated output? I would like to run this as a wrapper for…
18
votes
1 answer

How to automatically reconcile /etc/group and /etc/gshadow

Running grpck to check the groups, I see these errors: 'twinky' is a member of the 'foo' group in /etc/group but not in /etc/gshadow 'dipsy' is a member of the 'foo' group in /etc/group but not in /etc/gshadow 'laalaa' is a member of the 'foo'…
BryanH
  • 552
  • 1
  • 4
  • 16
17
votes
5 answers

nc (netcat) hangs, waiting for more data, in UDP mode.

I'm trying to send a small string to statsd via nc inside of a read block: while read line; do printf "folder.counter:value|1c" | nc -q 0 -u $host $port done Unfortunately, when in UDP mode, nc seems to want to wait indefinitely, even though…
bshacklett
  • 1,378
  • 4
  • 19
  • 39
17
votes
4 answers

How to delete empty source directories when moving folders with rsync?

rsync can be coaxed into moving folders very similarly and superiorly to traditional mv with the following options: rsync -axvvES --remove-source-files source_directory /destination/ However one thing I cannot yet seem to get it to do is to remove…
ylluminate
  • 1,155
  • 2
  • 17
  • 35
17
votes
4 answers

how to export VARs from a subshell to a parent shell?

I have a Korn shell script #!/bin/ksh # set the right ENV case $INPUT in abc) export BIN=${ABC_BIN} ;; def) export BIN=${DEF_BIN} ;; *) export BIN=${BASE_BIN} ;; esac # exit 0 <- bad idea for sourcing the file now these VARs are…
webwesen
  • 945
  • 4
  • 13
  • 21
17
votes
5 answers

How to remove many (200 000) files?

I must remove 200 000 files (all of them) from a folder, and I don't want to delete the folder itself. using rm, I get an "Argument list too long" error. I've tried to do something with xargs, but I'm not a Shell Guy, so it doesn't work: find -name…
FMaz008
  • 429
  • 3
  • 12
17
votes
3 answers

Where's my tab completion and up-arrow behavior? (Ubuntu 10.04)

I'm new to Linux, trying Ubuntu 10.04, preconfigured by host. When I log in (SSH) using the preconfigured account, the shell prompt is: user@hostname:~$ The up arrow scrolls through the list of recent shell commands, and tab-completion works as…
pastorius
  • 273
  • 1
  • 2
  • 5
17
votes
10 answers

Easy way to get IP address from hostname using a Unix shell

What is the easiest way to get the IP address from a hostname? I was thinking about trying a ping and parse it from the output. However, that doesn't seem very nice and will probably not work the same way on all systems. I searched a bit around and…
Albert
  • 332
  • 1
  • 2
  • 12
16
votes
9 answers

Calculating total file size by extension in shell

We have a set of directories containing lucene indexes. Each index is a mix of different file types (differentiated by extension) eg: 0/index/_2z6.frq 0/index/_2z6.fnm .. 1/index/_1sq.frq 1/index/_1sq.fnm .. (it's about 10 different…
barnybug
  • 293
  • 1
  • 2
  • 7
16
votes
5 answers

Can I disable interactive shell access while tunneling web traffic through SSH?

I am looking into implementing SSH tunneling as a cheap VPN solution for outside users to access Intranet-only facing web applications. I currently am using Ubuntu Server 10.04.1 64 bit with OpenSSH installed. I am using Putty on Windows boxes to…
CT.
  • 741
  • 2
  • 8
  • 20
15
votes
4 answers

Command line recursive/deep directory copy in Linux?

What is a good, general way to make a recursive/deep directory copy in Linux that works in most cases? I've used simple things like cp -R as well as fairly elaborate cpio incantations. Are there any significant strengths or weaknesses that cause you…
Greg Mattes
  • 324
  • 1
  • 4
  • 11
15
votes
1 answer

rsync: getcwd(): No such file or directory (2)

I want to sync Server1 and Server2's logs to LogServer. For Server1: rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/ This one works, but for Server2: rsync -avz -e 'ssh -p 2188'…
WoooHaaaa
  • 1,605
  • 4
  • 15
  • 13