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

learn more… | top users | synonyms

18
votes
6answers
75k 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 ...
2
votes
1answer
42 views

A List Of Windows Shell Commands [duplicate]

I would love a list of Shell commands for Windows. Not to be confused with commands that you would run in Windows DOS. Over time I have come across these commands here and there. Like for example if ...
0
votes
0answers
16 views

redirecting output in crontab

I have a shell script to monitor table stats and java apps. It works fine when I run manually. But if I put it in the crontab it will get stuck if I don't redirect it's output with export display ...
0
votes
2answers
18 views

CLI tool to graphically select lines during piped commands

Is there a tool similar to choose that I can plug into chain of commands that will let me select (multiple) lines for the next step? choose unfortunately doesn't "pass on" the line you select, ...
0
votes
1answer
10 views

alias can't find a file that actually exists

On my personnal computer, not a server, in my .bash_profile (I'm on OSX) — sym-linked to .bashrc, I have the following line among some others : alias deploy=sh ~/dir/ectory/deploy.sh The file ...
1
vote
2answers
19 views

How to stop shell script if curl failed

I have script that used curl when i pass wrong parameters to script curl failed but script continue executing. I have tried use curl -f/--fail parameter but problem does not solved. What is the best ...
1
vote
2answers
1k views

Mac server default file permissions

How do I change the default file permissions for files created on a Mac server? In case it's relevant, this is a Mac Mini running Mac OS 10.6.7. It's currently used mainly as a file server, and there ...
60
votes
3answers
16k 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?
0
votes
0answers
25 views

Unable to run tmux on OS X

So I got brew on my mac and I had tmux installed and running just fine. Then after I refreshed my system every time I try to run tmux i get this error: "-bash: tmux: command not found" So since I'm ...
0
votes
2answers
1k views

How do IRC clients, shells and bouncers work?

let's say I take free shell and start irssi with the nick: nick_test and of course nick stays online 24/7, right? But if I connect with my IRC client, like mIRC or xchat and set my nick to nick_test ...
0
votes
1answer
17 views

What is the ZSH equivalent of 'expr'?

The expr utility evaluates an expression and writes the result on standard output. What is the canonical ZSH way to evaluate an expression, and print the result? Solution: I believe the answer is ...
22
votes
7answers
65k views

How do i select all text in Vi/Vim?

I always use vi for editing config files. Today I wanted to select all the text in a file (around 1000 lines), copy it, then paste into Google Docs. How can I do that?
0
votes
1answer
17 views

Where does Internet Explorer store the last used upload directory?

I have an image of a user's hard drive from which I need to recover some photos, but I don't know the file names or directory they are stored in. The photos are not in any of the typical profile ...
1
vote
3answers
78 views

Linux if elif else fails

I am trying to find if mount point 1 is available if not mount it, if mount point 1 fails, mount 2nd one if that fails dispaly failed message. Here is the code: mount > /tmp/log; if grep -ohw ...
1
vote
1answer
17 views

Background chained ssh tunnel dropped instantly

I'm trying to establish the following chained ssh tunnel: ssh -A -t gatewayuser@gatewayserver 'ssh -N -A -t -R 55520:127.0.0.1:55520 user@dbserver' & This is part of a shell script, I want the ...
1
vote
2answers
224 views

zsh completion doesn't work under Cygwin for other drives

I'm on Win7 x64, Cygwin 1.7 and zsh (and using oh-my-zsh). Zsh newbie here. I've reviewed zsh autocompletion not working on cygwin and tried the solution there but no luck. My mount table: C: on ...
61
votes
6answers
47k views

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 ...
0
votes
0answers
9 views

Why does CygWin shell uses TAB completion for .DLL files?

If I type in a CygWin Bash shell forma TAB, the result expands to format.com. But if I type modeTABTAB, the results expands to: $ mode mode.com modemui.dll As long as .DLL files are not ...
30
votes
5answers
14k views

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?
0
votes
2answers
323 views

Print current time (with milliseconds)

I want this command in windows with cygwin installed, so any Linux command will work for me.
2
votes
3answers
722 views

Using wildcards in commands with zsh

Using commands such as rsync and scp with ZSH I've run into trouble. Instead of the (normal) behaviour of giving me all matching files, it won't run and returns: ➜ ~ rsync -azP user@server:~/* ~/ ...
0
votes
1answer
20 views

Using find and wc -L to find files containing lines longer then 500 characters

I have this command: find . -name "*.php" -exec wc -L '{}' \; And I believe it gives me the count of the longest line for each file. But I'm looking for a way to only print out the count and file ...
0
votes
0answers
14 views

Kill display manager and start another one with a script

I have a small script in which I kill gdm3 and start up an X Session. It works, but I have to run it 3 times. export DISPLAY=:0 var = $(pidof gdm3) kill $(var) X :0 & xterm & export ...
0
votes
1answer
25 views

How to print process id into statment

I have assigned a work to take take all process and make them into a statement. So I tried this script. #!/bin/bash a= ps | awk '{print $1}' echo select $a So I am getting this output PID 1838 ...
1
vote
1answer
21 views

How do I identify shell script execution vs dot execution

I'm writing a bash script that needs to run on the current process for it to be useful. That is, I want to make sure that the script was invoked with source script.sh or . ./script.sh and not ...
5
votes
5answers
2k views

Delete all empty folders, even with .svn folders in it

I'm trying to delete all empty folders within a directory. However, find . -type f -empty does not find anything because every folder contains a hidden .svn folder. How can I work around this?
1
vote
1answer
19 views

writing more complex math input to fish shell

The fish documentation explains that the math command is essentially a thin wrapper to bc. The bc documentation has further info about more complex ops: If bc is invoked with the -l option, a math ...
16
votes
3answers
8k 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 ...
1
vote
0answers
30 views

Terminal's bin/bash not responding

I have Googled through several instances of this issue but cannot get Terminal to open up with bash. I restarted the program, the computer and even logged in through another Administrator account but ...
4
votes
3answers
690 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 ...
0
votes
3answers
44 views

How can I add a program path to the Windows environment variables for easy command line access?

Let's say I want to add the following path to the Windows environment variables: C:\Program Files (x86)\VideoLAN\VLC\vlc.exe Such that I can simply type the following from a command line without using ...
0
votes
2answers
1k views

script calling script as other user

Using CentOs, I want to run a script as user 'training' as a system service. I use daemontools to monitor the process, which needs a launcher script that is run as root: : #!/bin/bash exec >> ...
0
votes
2answers
26 views

Zsh: how to auto complete after a command?

everyone. It's a little difficult to explain what I want to do. I want to create a script 'example', which can input long commands for you after you run it with short parameters. For example, $ ...
21
votes
6answers
51k views

looping through `ls` results in bash shell script

Does any one have a template shell script for doing something with ls for a list of directory names and looping through each one and doing something? I'm planning to do ls -1d */ to get the list of ...
2
votes
1answer
39 views

What's the ZSH equivalent of BASH's $PROMPT_COMMAND?

BASH supports a $PROMPT_COMMAND environment variable that defines a command to be executed before any first-level interactive prompt. I'm looking for a ZSH equilvalent of that. The documentation says ...
39
votes
3answers
57k 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 ...
2
votes
1answer
18 views

Are there limits to file length piped from find to xargs or using find -exec +

In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands: find . -name test -type d -print0|xargs -0 rm ...
4
votes
2answers
995 views

Unable to preserve hard links. Why?

I'm trying to create a Makefile that would automate remastering Knoppix distribution. I'm trying to copy filesystem from the read-only compressed loop device to normal filesystem to be able to modify ...
2
votes
2answers
242 views

Why shell commands for PNG file in Windows 8 doesn't work?

I have exactly same task like here: Windows 7 - Add shell command for .png file But this solution doesn't work in Windows 8 for unknown reason only for PNG files. And I don't know why. I tried some ...
4
votes
2answers
651 views

How can I tell if OS X is connected to a VPN network from the command line?

How can I tell if OS X is connected to a VPN network from the command line? By running ifconfig without any arguments when I am connected, I see that there is a utun0 interface which appears to be ...
3
votes
3answers
562 views

Linux : To monitor a Service and restart if stopped?

Actually I'm not so sure whether i should use Shell Scripts, or if there some ways already. But whatever approach we use, i would like to keep a Service running all the time. Let's say iptables as an ...
0
votes
1answer
18 views

find files older than create its parent folder in a directory and move them there

I've been trying to create a bash script that does the following. Use the find command to search for files older than 7 days (find . -type f -mtime +7 ! -iname '.*', take the parent directory(of the ...
0
votes
2answers
93 views

Loop through a list of urls in a text file

I have a list of URL's that looks like the following: http://www.youtube.com/watch?v=QVgFCCQWBOs http://www.youtube.com/watch?v=8TrMhR7ZpBk http://www.youtube.com/watch?v=8ctAvtBJB3s ...
2
votes
0answers
264 views

loop curl could not resolve host

I've had working script, which suddenly doesn't works. It contains something like this: while read url; do curl $url done < links links file: http://duckduckgo.com http://google.com And I ...
0
votes
1answer
32 views

Shell script truncated when run from cron or at

I'm seeing some very strange behavior on a Linux based NAS (DNS-323) I have. I'm using a simple shell script to back up the files on the NAS to another box. After making some recent additions, the ...
0
votes
0answers
172 views

How can I get Linux to interpret keyboard characters properly? [duplicate]

Possible Duplicate: How to configure PuTTY so that Home/End/PgUp/PgDn work properly in bash? I access a linux server shell via putty, but many of the keys I use do not translate across, up, ...
0
votes
1answer
2k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
1
vote
1answer
98 views

Switch back to VIM before shell command finishes

When executing a shell command in VIM, it waits for the command to finish. You can press Enter to switch back to VIM, but it will only switch back after the command has finished. In the event of a ...
3
votes
3answers
148 views

Run command on shell and get output in vim

I know how to run shell commands within vim using :!r and :!, but is there a way I can do that from outside, i.e. from bash? Something along the lines of vim 'ls -al'. The output of ls should be in ...
0
votes
1answer
806 views

ImageMagick's “import” command line program failing to take a screenshot from CRON script

Hello I wrote a simple command line script which is suppose to take my screenshot every 5 minutes. (using ImageMagick's "import" program) here is the script (shottr.sh): #!/bin/sh ...