Questions tagged [shell]

A shell is software that lets users interact with the operating system, usually by typing at a command-line.

Shells are used to interact with the Operating System (OS) and launch other applications.

Shells also have built-in commands, depending on the OS. Examples are directory listings, moving and copying files (Windows) or job control (Unix-like).

Most shells offer scripting capabilities, starting with simple sequential execution of commands. For more complex problems, control structures (like conditionals or loops) can be used.

Broadly used shell include:

  1. Windows:
  2. Unix-like:
    • Bourne Shell
    • Bourne Again Shell
    • Korn Shell
    • (Tenex) C Shell /
    • Z Shell
    • Friendly Interactive Shell

See Comparison of command shells on Wikipedia for a more extensive list.

4107 questions
1775
votes
10 answers

How can I sort the output of 'ls' by last modified date?

How can I sort the output of ls by last modified date?
nearly_lunchtime
1582
votes
6 answers

How do I make a machine "blank screen" for a period of time (as a penalty) if certain noise levels are reached?

My kids (4 and 5) yell a lot when playing games on the computer. I found an effective cure for this. When I hear loud noises, I ssh into the game computer and do: chvt 3; sleep 15; chvt 7 This will turn off the screen for 15 seconds on Linux.…
829
votes
13 answers

What does 'source' do?

$ whatis source source: nothing appropriate. $ man source No manual entry for source $ source bash: source: filename argument required source: usage: source filename [arguments] It exists, and it is runnable. Why isn't there any documentation about…
Andrea Ambu
  • 8,958
659
votes
42 answers

How to execute a command whenever a file changes?

I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file. Currently, I'm using this: while read;…
597
votes
16 answers

Reload a Linux user's group assignments without logging out

When assigning a user's secondary group list using: # usermod -G is it possible to force this group assignment to take effect without logging out all running sessions? This would be very useful in the situation where a Screen…
Simon
  • 6,462
568
votes
14 answers

How do I make rm not give an error if a file doesn't exist?

I'm writing a makefile that will clean up some useless files at the end of the compilation. If a target has already been made, it will of course skip that target and the useless file may not be there. So if I do this: rm lexer.ml interpparse.ml…
Jason Baker
  • 8,932
415
votes
21 answers

How do I detach a process from Terminal, entirely?

I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy. However, I'm struggling with how to completely detach a process (e.g. Firefox) from the terminal it's been…
AnC
403
votes
14 answers

Scroll shell output with mouse in tmux

Mouse scrolling doesn't work in tmux the way it works when I run shell without tmux (in Gnome Terminal). It seems tmux sends mouse scroll events as if I pressed Up/Down keys. But I want it to scroll though the shell output history. Is there a way to…
user31494
  • 4,143
379
votes
11 answers

chown is not changing symbolic link

I'm trying to change the user/group of a symbolic link with the command: $ chown -h myuser:mygroup mysymbolic/ But it's not changing. I'm logged in as root. The current user/group is set to root:root. What went wrong?
rizidoro
368
votes
19 answers

How to reliably keep an SSH tunnel open?

I use an SSH tunnel from work to go around various idiotic firewalls (it's ok with my boss :)). The problem is, after a while the SSH connection usually hangs, and the tunnel is broken. If I could at least monitor the tunnel automatically, I could…
Peltier
  • 6,504
366
votes
11 answers

If I know the PID number of a process, how can I get its name?

If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process? What do I have to do?
AndreaNobili
  • 7,381
261
votes
6 answers

What is the difference between shell, console, and terminal?

I'm confused with the terminology. What is the difference between shell, console, and terminal?
claws
  • 4,649
254
votes
12 answers

What to do when Ctrl + C can't kill a process?

Ctrl + C doesn't always work to kill the current process (for instance, if that process is busy in certain network operations). In that case, you just see "^C" by your cursor and can't do much else. What's the easiest way to force that process to…
247
votes
12 answers

How do I select all text in Vi/Vim?

Using VI tool for editing config files. How can I select all the text in a file (around 1000 lines), copy it, then paste into Google Docs?
Daniel t.
234
votes
13 answers

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh). How can I force it to use zsh?
re5et
  • 2,453
1
2 3
99 100