Questions tagged [shell]

The shell is Unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks. Use this tag for questions applying to /bin/sh and most compatible shells (ash, bash, ksh, zsh, …). For shell scripts with errors, please check them in http://shellcheck.net before posting here.

Filter by
Sorted by
Tagged with
299 votes
14 answers
457k views

How to monitor CPU/memory usage of a single process?

I would like to monitor one process's memory / cpu usage in real time. Similar to top but targeted at only one process, preferably with a history graph of some sort.
  • 3,786
56 votes
12 answers
37k views

make my zsh prompt show mode in vi mode

I use bindkey -v (for bash-ers set -o vi I think that works in zsh too) or vi(m) mode. but it bugs me that I don't have any visual cue to tell me whether I'm in insert mode or command mode. Does ...
93 votes
15 answers
91k views

Best way to search through shell's history

Is there a better way to search my history file for a command than grep? I do have some idea what the command starts as, but I don't know how far back in the history it is. update: was formerly zsh ...
12 votes
7 answers
6k views

Practical tasks to learn shell scripting [closed]

I'm looking for some common problems in unix system administration and ways that shell scripting can solve them. Completely for self-educational purposes. Also I'd like to know how would you go about ...
  • 1,456
87 votes
3 answers
55k views

The 'less' command-line equivalent of 'tail -f'

I would like to open up a file using less, and have it automatically scroll the file similar to tail -f. I know that I can do less file, and then hit Shift-F to forward forever; like tail -f. I need ...
24 votes
7 answers
14k views

Unix equivalent of PowerShell?

I've always found it awkward when complex shell commands involve parsing text output with AWK. Basically we're converting structured data into text, then parsing the text again to get back at the ...
  • 1,263
251 votes
11 answers
209k views

Allow setuid on shell scripts

The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor: > cat setuid-test.c #include <stdio.h> #include <unistd.h> int ...
308 votes
25 answers
901k views

Colorizing your terminal and shell environment?

I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist ...
12 votes
3 answers
368 views

Which less popular shells do you use and what are their advantages? [closed]

Apart from what you can (arguably?) call the more popular shells (bash, csh, Korn, zsh) what other ones do you know and use and what unique features do they have? ps - One answer per shell would be ...
93 votes
63 answers
51k views

What are your favorite command line features or tricks?

Share your command line features and tricks for Unix/Linux. Try to keep it shell/distro agnostic if possible. Interested in seeing aliases, one-liners, keyboard shortcuts, small shell scripts, etc.
8 votes
1 answer
478 views

What is Linux for VMS DCL "ON ERROR"?

Using VMS DCL command scripts one can catch errors by using the on error command: $ on error then goto MyErrorHandler $ directory samiam.txt $ delete x.txt $ exit $MyErrorHandler: $ print "Something."...
512 votes
15 answers
301k views

Turn off buffering in pipe

I have a script which calls two commands: long_running_command | print_progress The long_running_command prints progress but I'm unhappy with it. I'm using print_progress to make it nicer (namely, I ...
5 votes
2 answers
7k views

What is Linux for $DECK and $EOD?

In VMS DCL one may embed data in a command file using $DECK and $EOD. What is Linux for this?

1
232 233 234 235
236