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

learn more… | top users | synonyms

20
votes
3answers
9k views

How to: Unlimited Bash/shell history?

Is there a way to define an unlimited history in Bash ?
20
votes
1answer
3k views

ZSH Completion colors and OS X

Consider this minimal .zshrc : export CLICOLOR=1; export LSCOLORS=exfxcxdxbxegedabagacad; # It is the default value on OSX, so this line can be omitted autoload -Uz compinit compinit zstyle ...
20
votes
6answers
79k views

How do I run the Windows 7 Explorer shell with Administrator Privileges by default?

The Windows 7 shell (Explorer) can be made to run with Administrator privileges by this manual process: Kill Explorer shell by holding down Shift+Ctrl, right-clicking the Shut down button in the ...
19
votes
4answers
23k views

Delete matching files in all subdirectories

How can I remove all .swp files in all of my subdirectories under Linux?
19
votes
3answers
7k views

Screen a running process

Sometimes I forget to run a program under a screen session and can't stop it in the middle, and I know it's going to take long. Is there a way to screen an already running process without restarting ...
18
votes
3answers
7k views

Random password generator: many, in columns, on command line, in Linux

A while back, I came across a random password generator for the command line that displayed a grid of "memorable" passwords. Output was something like this: adam@host:~$ CantRememberThisCommand ...
17
votes
6answers
23k views

Remove file without asking

How can I remove file without asking user if he agrees to delete file? I am writing shell script and use rm function, but it asks "remove regular file?" and I really don't need this. Thank you.
17
votes
4answers
6k views

Bash/ZSH: Undoing 'disown'

Is there a way to 'reattach' a process to the shells job table after it it has been 'disowned'? Edit: $SEARCHENGINE totally fails me. Doesn't look too good.
16
votes
3answers
7k views

How do I change a users default shell in OSX?

What is the correct OSX way of changing a users default shell? When I googled for it I found several references to an application called NetInfo Manager but I couldn't find it on my system. There were ...
16
votes
2answers
3k views

How do you run the previous command in emacs shell?

I am in terminal mode on Ubuntu, and I'm running emacs with 2 buffers open, one is a ruby file, and the other is a shell (opened by typing M-x shell ), and when I switch to the shell buffer, I want to ...
16
votes
3answers
10k views

What is the difference between CMD and Command prompt in windows?

Until now, I never thought (and never observed) that cmd and command are two different things. Well, are they? Take a look at this pic: Actually, I usually open cmd from the Run dialog whenever I ...
16
votes
6answers
312 views

Want to try out Linux, what do?

I've been learning ruby on rails for a while. At first I resisted using the console, but after a while I can say that I LOVE it. If Linux is anything like that, I think it's going to be legit. I ...
15
votes
10answers
16k views

Mac OS X - Could not start Terminal.app - shell has illegal value

I can not run the Terminal.app after rolling back my system from time machine. Mac OS X Version 10.6.2 It displays the following error. "Your are not authorized to run this application" "The ...
15
votes
10answers
40k views

Opening Explorer shell with admin privileges on XP (with IE7 installed)

I used to demote my user account so that it had no admin priveleges and used a 'sudo-like' trick where you create a shortcut to IE6 and enabled the 'Run with different credentials' option to open a ...
15
votes
1answer
10k views

zsh with Cygwin

How can I configure zsh to be the default shell under Cygwin?
15
votes
3answers
5k views

Use GNU screen as login “shell”

What's the best way to have screen automatically run when you open a new shell, whether by login, xterm, or anything else? I see the most common recommendation is to put exec screen in your regular ...
14
votes
7answers
857 views

Is there a way to go to any directory from any other directory directly?

Is there a way to go to any directory from any other directory directly? For example, lets say that I'm at root and I wanted to go directly to currentProject without doing: cd ...
14
votes
9answers
55k views

What is the shell command to display contents of a file?

Like that of .txt or .html
14
votes
3answers
7k views

How to remove shell integration of Notepad++?

I need to remove the annoying shell integration of Notepad++. How do I do that, please?
14
votes
5answers
39k views

How can I edit the $PATH on linux?

I am using ubuntu 9.04 I need to add some folder to my $PATH. I know how to read the path: echo $PATH I want to be able to edit it and add 2 other paths. Thanks
14
votes
5answers
359 views
14
votes
3answers
13k views

How do I fork a process that doesn't die when shell exits?

If I run emacs from the shell: $ emacs foo & and then kill that shell, emacs dies. How can I run a command so that it will not die when the shell dies? I found references to nohup, but that ...
14
votes
5answers
17k views

How can I do a recursive find and replace from the command line?

Using a shell like bash or zshell, how can I do a recursive 'find and replace'? In other words, I want to replace every occurrence of 'foo' with 'bar' in all files in this directory and its ...
14
votes
2answers
4k views

Putty SSH: CTRL+Cursor keys don't work skip to previous/next word

When I am connected to my local Ubuntu dev server with putty (from my Windows 7 box) via SSH, the following key combinations don't work to move the cursor forward and backward on word boundaries: ...
14
votes
3answers
2k views

Multiple standard input? How?

From this commandlinefu post: $ diff <(wget -q -O - URL1) <(wget -q -O - URL2) Seems like multiple standard inputs but---if I remember my Linux Porgramming course correctly---this can't be ...
13
votes
2answers
16k views

how to bring a background job to foreground

in Linux/shell, how can I bring background jobs to foreground and vice versa?
13
votes
6answers
17k views

Will rm -rf * remove all files/folders in the current directory?

Will rm -rf * remove all files/folders in the current directory ? I want to make sure the wildcard * won't move up in upper directories and erase all my filesystem. :D I remember doing chmod 777 .* ...
13
votes
9answers
9k views

Command aliases in Command Prompt?

How can I make command aliases in Windows' Command Prompt like I would with bash? I found out about doskey in a forum thread, so I can do something like: doskey ls=dir /b ...and now the command ls ...
13
votes
5answers
14k views

Console like Gnome Terminal for Windows

I'm looking for console like the Gnome Terminal for Windows to replace cmd.exe. I'd like to have tabs and easy copy&paste. Do you know a tool like that?
13
votes
6answers
5k views

How to retrieve the absolute path of an arbitrary file from the OS X

I'm looking for a simple command that can be used within Bash to find the absolute and canonicalized path to a file on an OS X (similar to `readlink -f' under Linux). The following sample bash ...
13
votes
4answers
3k views

A command before every bash command

Does anyone know a mean of putting a 'time' command before every command in a bash session?
13
votes
3answers
12k views

How to cd to a directory that contains a space in its name?

I have a directory called "Reader 0.5" in my Desktop on Mac Os X. When to access the directory in terminal, I am using below code: cd /Users/niho/Desktop/Reader 0.5 but it throws: No such file or ...
13
votes
1answer
14k views

When creating a symbolic link, how do I troubleshoot 'too many levels of symbolic links'?

I'm trying to create a symbolic link on Ubuntu 10.04 it says: me@laptop:~/PHPUnit$ ls assertions.php LICENSE PHPUnit README.markdown build.xml package.xml phpunit.bat ...
13
votes
2answers
6k views

Check number of pending security updates in Ubuntu

Let me start by saying I have been forbidden to enable automatic updates on our Ubuntu servers, for both security and regular packages. When I log into any of my four Ubuntu servers, the welcome ...
13
votes
5answers
7k views

Linux Shell: Copy output into clipboard w/o using the Mouse?

Is it possible to copy the output into the clipboard without using the mouse? For example, I would like to do something like this: $ pwd >> clipboard
12
votes
5answers
2k views

Which directory does path `//` represent in Linux?

When I want to go back to upper level directory in Linux by typing cd .., I typo-ed cd //. To my great surprise, no errors are reported. What's more the prompt becomes username@hostname://$. ls ...
12
votes
8answers
27k views

How to resume CUPS printer from command line?

I have printer in CUPS that due to driver problems (HP 1010) from time to time goes into pause. I would like to write a shell script that will execute once per hour to resume a printer in CUPS. But ...
12
votes
4answers
2k views

Equivalent/Alternatives for Alt+Dot in Mac

One thing i miss from the Linux shell is the Alt+Dot shortcut. What it does is insert the last argument of the previous command. It appears to be a trivial technique, but it's really useful. i.e. if ...
12
votes
2answers
2k views

How to use a pipe to edit a file with vi

Lets say I have a file called file.txt. In it is a name of a file that I want to edit with vi. I want to do something like this so that I can edit the file: cat file.txt | vi However, that doesn't ...
12
votes
5answers
8k views

How can I find the oldest file in a directory tree

I'm looking for a shell one-liner to find the oldest file in a directory tree.
12
votes
3answers
10k views

Clear terminal using keyboard shortcut

I was curious if there is a way to clear the terminal buffer/output through some keyboard shortcut. I am using Ubuntu. I am aware that Ctrl + L clears the terminal, but you can still scroll back to ...
12
votes
3answers
8k views

Mac OSX: conventional places where binary files should live

I'm only vaguely familiar with Unix and the filesystem convention for Macs, so sorry if this is a dumb/easy question. I've downloaded an application that is a command-line application, and want to ...
12
votes
5answers
2k views

How to show the current Vi mode when using Vi keybindings in the shell?

I use the vi keybindings in my tcsh shell. Now, I don't know which vi mode I'm in (insert mode or command mode), which leads to a lot of frustration. Does anyone know of a way to show the current ...
11
votes
7answers
18k views

Make ls sort by file type (then name)

By default the ls command sorts just by filename, but I want directories to appear before other file types. I might even want files to be sorted by extension, like the way Windows explorer sorts by ...
11
votes
6answers
7k views

Full command text with unix ps

When we enter: ps -f ... the CMD column text doesn't show the full command. Any way to prevent this truncating? Seems like it's showing the first 80 characters. We are running a fairly ...
11
votes
2answers
11k views

Unix: How to merge two directories

Say I have two folders with various content, foo and bar. How can I merge bar into foo so that: Files in foo that are not in bar are untouched. Files in bar that are not in foo are now in foo. Files ...
11
votes
2answers
3k views

How do I host a mintty shell inside of Console2?

I like to use Console2 for my Windows shell work, where I usually make it open a cygwin bash prompt. I'd like to try out MinTTY (2), and want to host it within Console2 as well. If this is possible, ...
11
votes
5answers
13k views

Is there a way to escape single-quotes in the shell?

E. g. I want to say perl -e 'print '"'"'Hello, world!'"'"', "\n";' Is there a less awkward way to do it, e. g. escaping single-quotes? Yes, I know that I can write perl -e 'print q[Hello, ...
11
votes
1answer
2k views

Vim Ignores Aliases

If I map a command in vim using something like map <f4> :! pdflatex %<cr> Vim will ignore my alias for pdflatex (something like alias pdflatex='pdflatex --temp-dir=something'). Is it ...
11
votes
3answers
3k views

Making Linux shell prompt show last return value

I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple). My own computer ...