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

learn more… | top users | synonyms

0
votes
1answer
32 views

How to run an infinite loop program on startup on a raspberry pi without halting boot up

I have a shell script: #!/bin/bash while sudo /home/pi/MyCode; do :; done echo Error with MyCode which runs a program in an infinite loop. I want to set up the shell script to run at start-up ...
0
votes
1answer
20 views

How to use the awk to print the output

This command nstats gives me output like below. How can I use awk or grep to give me the uptime with only days on it? I cannot use the "" to get the output. HOSTNAME LOAD MEMORY SWAP PROCS ...
1
vote
0answers
18 views

Showing context menu option if extension is not .aent

I have made an application that can basically encrypt anything, I have added a registry entry in HKEY_CLASSES_ROOT/*/shell/ so that it's shown whenever one right clicks a file. but I don't want to ...
0
votes
1answer
16 views

what's the way to explicitly provide memory to shell script?

How can I give a shell script specific amount of memory to run? If I run a java program I can use -Xmx. But what if it is a shell script?
0
votes
3answers
12 views

How do I close stdin in a shell script?

I have a misbehaving program that I need to call from my script. It exits as soon as it sees something on stdin. Is there a way to close stdin?
3
votes
2answers
2k views

How to add commands of windows to local shell of XShell 4

XShell is a very powerful tools to ssh remote computers such as Unix/Linux. And it has built some internal commands for you to run within your Windows. Xshell:\> help Internal Commands: new: ...
0
votes
0answers
9 views

SSH commands through HTTP REST API [on hold]

Is there any tool / server for running shell commands through http REST API? Preferably in Ruby. I need to run some commands in OpenShift Origin but they don't have API interface yet implemented.
0
votes
3answers
30 views

Moving folders in Linux inconsistency

I have a shell script that deploy an application to a staging server. However, one of the application's directory needs to be backed up and restored after the deployment (so it is not overwritten). I ...
42
votes
6answers
23k views

Reload a Linux user's group assignments without logging out

When assigning a user's secondary group list using: # usermod -G <grouplist> <user> is it possible to force this group assignment to take effect without logging out all running ...
0
votes
2answers
22 views

Shell script to SFTP file to remote server

This is probably a question asked before, but I can't find a good question/answer. I need to write a shell script that will be called by PHP program (exec function) to move all *.pdf files to a remote ...
0
votes
0answers
8 views

how to debug perl program like shell script debug is there using option -x [on hold]

sh -x shellscript.sh Already tried perl -d perscript.pl it works but quite lengthy process
81
votes
6answers
77k views

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

Aptana Studio: Git: shell directory: attribute added to end of directory prompt

I'm running Aptana studio 3.3.2. The command echo $SHELL outputs /bin/sh. However there is no value for the PS1 environment variable which I would like to inspect. I cannot there is no .bash_profile ...
94
votes
17answers
48k views

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

Why is this echo command not working?

I want to overwrite /etc/postfix/master.cf with my own content. I'm using echo "<content>" > /etc/postfix/master.cf to try and accomplish this. But when I do: echo "# # Postfix master ...
0
votes
2answers
26 views

How to execute multiple multiline mysql queries with a shell script?

I want to run multiple MySQL queries from a shell script. I'm using the following code: mysql -u <redacted> -p<redacted> servermail << EOF CREATE TABLE `virtual_domains` ( `id` ...
0
votes
1answer
429 views

Using the Linux split command to create N Files

I need to split files into guaranteed number of buckets. The size do not have to be equal. Here is my logic count = wc -l filename split_count = (count)/4 split -l split_count filename core_ ...
1
vote
1answer
437 views

mv - move dir with destination-dir having the same subdirs as source-dir

In FreeBSD (I suppose it works like Linux et al in this regard), I'd like to move src_parent/mydir to dst_parent/mydir. dst_parent/mydir already exists, and it contains some subdirs that's also ...
0
votes
2answers
190 views

How to automate shell script to run when I open a particular app in OSX?

I've been running into a rut recently with one project I've been trying to accomplish. Using Automator, but I don't know how to exactly to go about this project. There's this script editing app called ...
0
votes
2answers
18 views

followup: why are shebang files not suid-able?

followup question to http://unix.stackexchange.com/questions/364/allow-setuid-on-shell-scripts . there is a very good answer by Gilles. alas, I do not understand it. nothing described there seems ...
1
vote
1answer
29 views

Can't start new fish session after incorrectly closing fish_config

I'm trying out fish (the friendly interactive shell), and tried out the browser-based config with fish_config. I didn't close this correctly. I hit ctrl-C in my shell. Now I see the error "The ...
0
votes
0answers
7 views

how uninstall video card driver(integrated) in linux with shell command

Here is my problem: I was trying to update a new video card driver for my computer's Intel integrated display card, but the command " modprobe -r " return module is in use. I try to disable the ...
2
votes
4answers
2k views

loading local shell aliases to ssh session dynamicaly

When I log in to some machine using ssh I wish my aliases and functions are there. In other words, log in to some machine I wish I can use my command shortcuts. I need it be dynamic, every time I'm ...
0
votes
0answers
6 views

Keep tclsh open after running script through notepad++

I'm currently writing a tcl script using Notepad++. I've edited the F5 key such C:\TCL\bin\tclsh.exe "$(FULL_CURRENT_PATH)" This will open a tcl shell & run the current script I am writing. I ...
1
vote
2answers
24 views

How to remove file modification tracking on an Emacs buffer?

I have a *shell* buffer in Emacs where I get a Linux command line shell interface. On occasion, I wish to save the buffer's contents to disk for future reference were my session to exit and once ...
1
vote
3answers
1k views

SSH session hangs when trying to open a shell

Since this morning I cannot login normally on my server using SSH anymore. Typically, when typing this: ssh foo@bar.org The shell hangs and does not acquire shell. The last line of verbose with ...
0
votes
2answers
44 views

How can I colour-code files and directories in my shell environment?

I've seen many screencasts online in which the files and directories are colour-coded differently for ease-of-use. I'd like to achieve the same on in my bash terminal, on OS X 10.9 and using iTerm2. ...
0
votes
0answers
22 views

Netcat redirect remote console application

I have a windows interactive command line application ('pianobar', Pandora client) that I'm running on a Win2k8 server that I would like to control remotely, possibly using netcat. I need to be able ...
1
vote
4answers
159 views

Shell script: ssh to remote machine, then exit: 'exit' does not work

I have a shell script of the following type: #!/bin/bash ssh mylogin@myremotemachine.com echo "Hi" exit I run it locally to do something on a remote server (represented by 'echo "Hi"'). However, ...
0
votes
2answers
2k views

Exit sudo in the middle of a shell script

I have a shell script in which most of the commands need to be run under sudo; however, the last few commands need to be run as the current user. Is there a way I can exit sudo and switch to the ...
0
votes
2answers
47 views

linux shell command to grep Unicode Character 'ZERO WIDTH SPACE' (U+200B)

How can I grep for Unicode Character 'ZERO WIDTH SPACE' (U+200B) in linux grep '%U200B' filename?
7
votes
4answers
13k views

How can I use a bash like shell on windows

I use Linux and a Mac. I'll be teaching some command line stuff soon. What can I install on Windows to give me a terminal window most similar to a basic mac/linux bash shell. Would like to be able to ...
93
votes
7answers
74k 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
3answers
39 views

How to find length of string in shell

i need to calculate it using pure sh shell only. What happening is /bin/sh is actually a soft link to bash or other shell.Hence ${#STRING} gives length of string as it is advance bash feature. Can ...
0
votes
1answer
65 views

OneDrive Subfolder Icons Keep Resetting

I'm having a frustrating time with my OneDrive client where, when I customize the shell icons for subfolders inside my cloud drive, it resets the icon to default upon synchronization. As frivolous as ...
0
votes
0answers
32 views

sqlmap os-shell help needed

I am asking this question just for educational purposes. I run this command to upload php shell: ./sqlmap.py -u http://target.com/myfile.php?id=1 --os-shell And it succeeded: The shell uploaded ...
9
votes
5answers
6k views

gzip all files without deleting them

I need to gzip all files in a dir separately including all files in sub-directories without deleting the originals afterwards. So let's say I have index.html, I want to have at the end index.html.gzip ...
0
votes
1answer
3k 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
3answers
2k 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 ...
0
votes
1answer
12 views

Surpress execution trace for echo command?

I'm running shell scripts from Jenkins, which kicks off shell scripts with the shebang options #!/bin/sh -ex. According to Bash Shebang for dummies?, -x, "causes the shell to print an execution ...
4
votes
3answers
2k views

How to “undo” unzip command?

I used "unzip XXX.zip" to extract a zip file, unfortunaly, i make a mistake. Now i want to delete all the file and directorys generated by "unzip". How can I undo it?
0
votes
1answer
11 views

How to send process in background which has not started from shell?

I know how to send process to background and foreground which has started through shell using bg and fg commands. How can I send process which has started by clicking icons or menu? like I open ...
2
votes
1answer
30 views

What does this zsh for syntax mean?

I working on source controlling my dotfiles and a lof of what I'm doing is based off of Zach Holman's dotfiles. I want to source all zsh files like he does in his files but before I just throw the ...
1
vote
1answer
16 views

How can I run `M-x compile` under a particular shell in emacs?

I've a piece of software that can only be compiled under my-weird-sh. I like to use some-better-sh in my day-to-day work, so that is my login shell (via chsh). This changes the shell in Emacs to ...
10
votes
5answers
9k views

Stop Windows 7 Explorer from automatically expanding folders

Windows 7 Explorer can be opened in any folder from the command line. But, it automatically expands (on the left nav panel) the Favorites, Desktop, and [Username] folders. This makes it hard to see ...
0
votes
1answer
23 views

including timestamp in file name

I tried to create a file like this to put a timestamp in the file name vim Customer1-$(date).txt The result was Customer1-Sat.txt, however, I wanted the full timestamp Sat 30 Aug 2014 09:41:27 PDT ...
1
vote
1answer
4k views

How to turn the laptop built-in webcam on/off from shell

Fn+F6 key combination turns my laptop's integrated web camera on/off. Looking at the dmesg output, it seems that the webcam (USB device) is being more or less virtually connected/disconnected to/from ...
0
votes
2answers
303 views

Search for exe file within a condition

I want to search for all .exe files greater than 200 kB or smaller than 120 kB in the current folder and its subfolders. Then I want to move them to another folder called "folder" and execute in this ...
1
vote
1answer
19 views

What's the soonest I can send a signal to a background process (trap)?

I have a script from which I run a second script in a subshell. What's the soonest that can send a signal to the second script? script1: ./script2 & kill -SIGCONT $! script2: echo "~~ ENTRY" ...
25
votes
6answers
37k views

List open SSH tunnels

I use a lot of SSH tunnels to various servers on my linux machine (for tunnelling to databases, web servers etc) and it would be really handy to view a list of current open tunnels via a shell script. ...