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

learn more… | top users | synonyms

4
votes
2answers
7k views

How to extract a single folder and its subfolders from a “tarball” (.tar.gz)

I need to extract a single folder and its subfolders from a tarball (.tar.gz) on a CentOS server. I haven't the slightest clue how to do it using an SSH terminal. I tried: gunzip -c ...
3
votes
1answer
163 views

output redirection with sudo [duplicate]

Possible Duplicates: How to append to a file as sudo? sudo unable to write to /etc/profile The following command does not work because the elevated privileges do not apply to the ...
5
votes
3answers
485 views

Why does sha1sum act differently with the same input?

I'm trying to replicate the behavior of the sha1sum executable in some java code, however, in the process I've discovered that sha1sum appears to behave differently given the same input in two ...
3
votes
4answers
1k views

Is there a program/script to modify .conf files?

I want to modify a file like /etc/gdm/custom.conf from the shell or a script. # GDM configuration storage [xdmcp] [debug] [daemon] AutomaticLoginEnable=true; AutomaticLogin=username; But the idea ...
7
votes
2answers
270 views

Why can bash cd to //?

In bash if you cd to // your pwd will be //, but if you cd to / or ///+ your pwd will be /. Is there a reason for this or is it just a weird bug? I have tried this in osx and ubuntu.
2
votes
3answers
2k views

What is the shell command to let a Linux box go sleep?

I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, ...
2
votes
1answer
207 views

find command in Linux

I try to find files changed in some interval of time in directory hierarchy beginning from current directory, I try: find . -mmin 60 find . -mtime 60 But I didn't get result. I get results only if I ...
7
votes
1answer
1k views

How do I unset or get rid of a bash function?

If you set or export an environment variable in bash, you can unset it. If you set an alias in bash, you can unalias it. But there doesn't seem to be an unfunction. Consider this (trivial) bash ...
1
vote
3answers
869 views

Double pipes in Linux

Is it possible to do a command in Linux with "double pipes", like this? blah | blah | blah
0
votes
4answers
793 views

Is there a reason not to run bash as root?

I just noticed that on OS X 10.6.4 root's shell is set to /bin/sh. Is there a security issue or something with running Bash?
1
vote
1answer
939 views

set terminal width in a debian shell?

How do I set the terminal width in a shell session on a debian machine? I'm talking about the Alt+Fn terminals, not a GUI terminal program. Right now it's at 80x25 (I guess), and I'd like it bigger.
0
votes
1answer
2k views

Ubuntu 10.04 LTS - jobs command not working

When I used to execute the jobs command I got a list of running processes with their respective process-ID, but in Ubuntu lucid lynx this doesn't seem to be working. Anyone have a solution?
22
votes
6answers
49k views

why run a Linux shell command with &?

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the ...
4
votes
3answers
946 views

Keeping my zsh or bash profile synced up on all my machines

I work on several different machines, all of which are *nix. I have a lot of specific things I like my shell to, or the prompt to look like, or aliases, etc, etc. I'm sure all of you folks deal with ...
47
votes
3answers
81k views

How to make new file permission inherit from the parent directory?

I have a directory called data. Then I am running a script under the user id 'robot'. robot writes to the data directory and update files inside. The idea is data is open for both me and robot to ...
5
votes
4answers
5k views

Explanation of command to uppercase the first letter of a filename

I'm trying to learn to rename files with the command line, and after browsing around a lot of pages I finally found a command that uppercases the first letter of a file, but the problem is that I want ...
2
votes
1answer
109 views

How to construct shell redirection on command line

Consider the following command in Unix: echo 0123456789 | cat >/tmp/foo &> /tmp/bar The echo is sent to /tmp/bar. However, what I really want is to redirect the stdout and stderr output ...
16
votes
9answers
10k 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 ...
5
votes
1answer
380 views

bash command history update before execution of command

Bash's command history is great, especially it is useful when adding the history -a command to the COMMAND_PROMPT. However, I'm wondering if there is a way to log the commands to a file as soon as ...
1
vote
4answers
3k views

Python: Check existence of shell command before execution

I'm trying to find a way to check the existence of a shell command before its execution. For example, I'll execute the command ack-grep. So, I'm trying to do: import subprocess from subprocess ...
7
votes
2answers
781 views

How do I delete a file named “-p” from bash?

How do I delete a file named -p in bash? Trying rm "-p" complains that -p is not a valid argument.
35
votes
2answers
839 views

How do I teach my linux command line manners?

Whenever I complete something in the command line while using Ubuntu and my computer does something of value to me, I enjoy saying thank you, just because it's the polite thing to do. A typical ...
4
votes
2answers
415 views

Mac Terminal.app: Force '^C' to be printed when editing current prompt, then aborting it

This is the opposite of Prevent “^C” from being printed when aborting editing current prompt. I'm using Bash. When I'm editing the commandline in Bash, and I hit Control-C to abort the commandline, ...
1
vote
4answers
143 views

Installing a program on Linux: providing a short command

Suppose you're distributing a program to run on Linux, call it Foo, and the program executable is called foo.exe (because it's a CLR program so it runs under Mono) and it needs a couple of DLLs in the ...
9
votes
3answers
4k views

Mouse cursor in Terminal?

I use Mac OS X Terminal.app. But the answer to this would probably apply to any typical UNIX-ish terminal emulator in a graphical environment. Question -- what do I do to: Use my mouse cursor to ...
13
votes
5answers
2k views

Finding the definition of a bash function

I work in an environment that has a lot of legacy shell script magic lying around. One thing used heavy from the command line are bash functions that get sourced from some file included from some ...
87
votes
4answers
27k views

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

I'm confused with the terminology. What is the difference between shell, console, and terminal?
1
vote
4answers
119 views

Why is the output of ls is like this?

I am using Mac OS X Snow Leopard and when I type ls c * this is what I get in my terminal: clock: PSD demo.html jquery.tzineClock script.js styles.css clock2: ...
3
votes
2answers
516 views

how to google a symbol keyword like “$?” [duplicate]

Possible Duplicate: How to Google a question mark? I saw a trick in a book: In a linux shell, we can use $? to get the return value of a command. For example, after we run a command, if it ...
1
vote
1answer
398 views

environment variable issue in shell

I am using Red Hat Linux Enterprise 5. I know the theory that -- using export to set environment variable, the environment variable will apply to current and child environment, but without using ...
12
votes
4answers
9k views

Why is the size of a directory always 4096 bytes in unix?

I am sure a directory file has much less information than 4096 bytes. I know the sector size is 4096 bytes. But normal files smaller than that do exist. Why does Unix reserve 4096 bytes for each ...
2
votes
2answers
440 views

using “uniq” and ignore the first chars, instead of words

i have a list of files in a folder. the list of files is displayed using: ls now, i want to pipe that to uniq so it'll ignore the first 6 charactes before comparing. is it possible? or perhaps i ...
1
vote
3answers
3k views

How do I measure or track the progress of a command on a GNU distro?

If I run cp file1 file2 I'd like to be able to track it's progress. Is there a command I can use for this? rsync --progress has this, but is there something generic, usable for "any" command?
4
votes
1answer
3k views

Bash Shell Scripting - How to iterate through directories, and copy and rename files?

I have a directory setup as follows: /hosted/partner1/logo.png /hosted/partner2/logo.png /hosted/partner3/logo.png /hosted/partner4/logo.png /hosted/partner5/logo.png ..etc. I want to write a ...
6
votes
3answers
29k views

How can I disable the CTRL-ALT-DEL key combination completely on XP/Vista/7?

I have been googling extensively to figure this out, and nobody seems to be able to give a direct answer. Let me start by saying that I'm NOT talking about requiring CTRL-ALT-DEL to enter logon ...
0
votes
4answers
120 views

Linux standard input issue

I am new to Linux. And I am using Red Hat Enterprise Version 5. There is a ruby program which use standard input as its input (e.g. the Ruby program process input from standard input). I think ...
3
votes
2answers
9k views

How can I sort ls by owner and group?

How can I list directories with ls and sort them by their owner and group?
3
votes
1answer
4k views

Selectively delete entries from Windows 7 autocomplete history dropdown box

Random question, and I'm sure it has a very simple answer, if not already asked and answered in some shape or form. How do you selectively delete entries from the autocomplete history dropdown ...
10
votes
2answers
12k views

How to calculate a relative path from two absolute paths in Linux shell?

We have two paths. First one is directory, second either dir or file. /a/b/c and /a/d/e.txt Relative path from first path to second will be: ../../d/e.txt How to calculate that in Linux terminal? ...
8
votes
2answers
7k views

Indicating end of Standard Input

How does one indicate that one has finished entering test in stdin? For example, let's say that I wish to encrypt 'blue' using MD5 (I know MD5 is unsecure, but just for this example). I tried user$ ...
22
votes
4answers
5k 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 ...
4
votes
3answers
674 views

linux shell, keep task alive for specified time

I am looking for a tool to keep a task alive (restarting if necessary) for a specified amount of time (in seconds), and then kill it and stop. For example: keep_for 3600 rsync foo bar:faz should for ...
1
vote
1answer
6k views

What are the icons contained in the Windows 7 shell32.dll

I wanted to change the icon used for a Custom Library I've created in Windows 7. I found a great article How to Customize the Library Icons in Windows 7 which describes exactly how to do that. ...
1
vote
1answer
1k views

how in unix enter folder with whitespace in name

as in topic. How I can do that?
7
votes
3answers
21k views

How to delete files on the command line with regular expressions?

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, ...
27
votes
4answers
13k views

How to: Unlimited Bash/shell history?

Is there a way to define an unlimited history in Bash ?
7
votes
4answers
280 views

What to use for Shell Access? [closed]

I just purchased a virtual dedicated server-plan that comes with shell access. It's been a while since I've actually used shell access remotely, so I'm a bit behind the times. Years ago I used PuTTY, ...
5
votes
3answers
795 views

Ctrl-C behavior in gnome-terminal

I have installed Ubuntu 10.04. It works fine, but when I press Ctrl-C in gnome-terminal I get: user@desktop:~$ ^C user@desktop:~$ ^C user@desktop:~$ In Ubuntu 9.04 (I did have it before) it was so: ...
2
votes
1answer
432 views

Moving a process from a shell to another? [duplicate]

Possible Duplicate: Screen a running process Is it possible to move a process from one shell to another? Ex: I have launched a process in some shell, and I decide I'd like to move it to my ...
0
votes
2answers
2k views

Can I use REG_EXPAND_SZ for the locations of shell folders instead of REG_SZ

I'm working on re-arranging a number of the shell folders in windows 7 to utilize Dropbox to keep a set of machines in sync. I'd like to create a .reg file which I can use to update the locations of ...