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

learn more… | top users | synonyms

1
vote
1answer
11 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" ...
24
votes
6answers
36k 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. ...
3
votes
1answer
599 views

Windows 7 Primary Folder Icon File?

In Windows XP and earlier, when changing a folder's icon, you can select system32\shell32.dll for a wide selection of built-in windows icons that include most folder types. In Windows 7, you can ...
1
vote
3answers
92 views

Checking how many files there are of a certain type in a directory and all sub-directories

I want to find how many .py files I have in my GarlicSim directory and all its sub-directories. How do I do that? Either Windows or Linux is fine.
10
votes
4answers
8k 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
0answers
10 views

cygwin programs returning errorcode -1073741819 on Windows 7 cmd

Sometime in the last week or so none of my cygwin programs are running from the cmd shell of Windows 7 64-bit. Tried rebooting and reinstalling fresh, but with same results. After further analysis, ...
0
votes
1answer
20 views

How do I make sure that bash (not tcsh) is used in Linux?

I have a bash script where I use ssh to connect to another server and run some commands there. I found some sites that the error (Warning: no access to tty (Bad file descriptor). Thus no job control ...
1
vote
1answer
10 views

Shell, subshell, source, background process, PID == confusion

I am trying to get my mind straight as to how all these things are put together. For example with this script: #!/bin/bash . script1 ./script2 . script3 & ./script4 & sleep 5 How do the ...
0
votes
1answer
23 views

How do I build a script shell to send cmd via telnet and log only results?

I would like to make a shell script that can call a range of IPs via telnet, to send a command, and write the result to a file.
0
votes
0answers
9 views

What is a basic set-up to do C/C++, python, and octave programming from the bash shell?

Greetings fellow nerds, The administrator at my (Mac) computer lab is willing to install my programming set-up so I can do some coding if I want. Only problem is, I am used to having most of my ...
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
1answer
18 views

why following shell script function failing?

_exec() { CMD="$1" echo "Executing command: $CMD" EXEC_OUT=`$CMD` EXEC_RET=$? } _exec "hostname|cut -d\".\" -f1 " SHORT_NAME=$EXEC_OUT if [ $EXEC_RET -ne 0 ];then echo "Unable to ...
0
votes
1answer
24 views

Monitor process start time, end time using shell script

I am working on project in which we execute shell script which invokes the Node process and further processing happens. I want to design a script which should log the start time, termination time of ...
0
votes
1answer
15 views

'dd' command on Damn Small Linux?

I looked at the package list of DSL, and I don't see 'dd'. For example I would like to restore /dev/sdb from an .img file like so: dd bs=1M if=/home/myname/image.img of=/dev/sdb What command do I ...
16
votes
3answers
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 ...
3
votes
4answers
975 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 ...
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
25 views

Default prolog for all ZSH scripts?

I have a file that contains several helper functions, meant to be used only in other ZSH scripts. I do not want them to be loaded with my profile. To make these functions available in my script, I ...
0
votes
2answers
49 views

Crazy terminal behavior

I am trying to run a script to rip all the audio from a bunch of MP4 files. Everything works when I do it line by line cutting and pasting from my text editor into terminal, but when I create a shell ...
2
votes
3answers
51 views

Why is this sudo command try to run in /root?

I try to run a sudo command via SSH like this: ssh domain.com sudo -u user bash -c "cd /home/user/ && ls" (which is obiously just an example). I get back: /home/user/: line 0: cd: /root: ...
0
votes
1answer
20 views

Weird output in my mac iTerm bash shell. How do I make it clean?

Setting up my bash and made some mistake. Here is my bash shell: android-c26f663baae722eb:~ okyretina$ I have used a clean .bash_profile and sourced it and the shell still have that weird ...
2
votes
1answer
61 views

Default shell for running scripts (w/o shebang) in macos?

I have ZSH as default shell in MacOS, everything is working fine. ZSH is installed as brew package, Ive set default shell in my account, new shell is listed in /etc/shells... everything is set, like ...
0
votes
0answers
19 views

Automaticly run xinit from rc.local as different user

I'm working on some tuning of my raspberry pi b+. So I decided that midori should start automaticly after autologin. With startx it works without problems, but X is still to ressource hungry. So I'll ...
39
votes
2answers
6k views

Case insensitive tab completion in Bash

Is there any way to make Bash tab complete case insensitively? $ bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0) Copyright (C) 2007 Free Software Foundation, Inc. I am ...
2
votes
3answers
8k views

Is it possible to use putty as the UI for the Windows shell?

PuTTY is much better than cmd.exe. Can I use PuTTY to execute Windows commands?
86
votes
7answers
70k 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 ...
29
votes
9answers
85k 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?
5
votes
5answers
562 views

Is there any functional-like unix shell?

I'm (really) newbie to functional programming (in fact only had contact with it using python) but seems to be a good approach for some list-intensive tasks in a shell environment. I'd love to do ...
0
votes
1answer
22 views

How to get when run `top` command ports listed?

How to get when run top command ports listed ? I get info about process but I need port to see ( process dies very quickly , 0 seconds, and I cannot grep after ps aux ). Is possible to top command ...
0
votes
1answer
20 views

concurrent scheduled jobs and ora-27477

Need: To have Oracle kick off a shell script that performs processing on tables and data in the Oracle database. The script is instantiated by specific activity from web clients. Issue: Web clients ...
0
votes
2answers
41 views

is there anyway to get remote shell from windows to windows over WAN? [duplicate]

Is there any way to get remote shell (not RDP) from home PC to office PC? i have 2 pc's on 2 different places pc number one ip : 66.33.22.885 ( home PC ) pc number tow ip : 77.13.85.676 ( office PC ...
7
votes
1answer
10k views

How can I kill Firefox by console?

I know I can type: ps -A | grep firefox I get something like: 6818 ? 00:04:23 firefox Now I can kill it by means of: kill -9 6818 How can it be done in one command and how can I make ...
3
votes
5answers
13k views

How to recover Linux from 'repair file system' error

Unfortunately my mom did something that I don't know and Linux is in command-line mode. What is the key for exiting from the shell and going to the desktop? I tried Alt + F2 Alt + F6 Ctrl + Alt + ...
5
votes
2answers
849 views

Remove all “deleted” files in Git

Is there a better solution for removing manually-removed files from the Git repository than my current error-prone command? git status | grep deleted: | cut -d: -f2 | xargs git rm
2
votes
3answers
1k views

What's a reliable technique for killing background processes on script termination?

I use shell scripts to react to system events and update status displays in my window manager. For example, one script determines the current wifi status by listenining to multiple sources: ...
10
votes
9answers
3k views

Determine Linux distribution

I am trying to determine what flavor of linux server is running. I am not trying to determine the kernel version - but rater the distributor. gcc is installed, and in the version output, it says ...
20
votes
3answers
9k views

How to: Unlimited Bash/shell history?

Is there a way to define an unlimited history in Bash ?
0
votes
2answers
35 views

Renaming files from a list of filenames

I'm still very new to shell scripting so I'm sure this command is all kinds of wrong. I am trying to rename a folder of files to the names in a txt file. The precondition is that the filenames.txt and ...
5
votes
3answers
31k views

Run a shell script with an html button

I want to launch a bash script when a button is pressed on a website. This is my first attempt: <button type="button" onclick="/path/to/name.sh">Click Me!</button> But no luck. Any ...
0
votes
0answers
11 views

How to batch download wikipedia pages as pdf?

I have a list of wikipedia pages that I'd like to keep updated in pdf format. What would be the easiest way to do this? The ideal workflow for me would be something that I can put into a shell or ...
7
votes
4answers
17k views

How do I rename files with spaces using the Linux shell?

I named a number of files with spaces in them, and I want to replace the space with "_". However, every time I write a command in the shell with the file name (eg "Spring 2011"), the shell doesn't ...
1
vote
1answer
25 views

ZSH Cull Old Aliases

When I call alias in a zsh shell, I get a list of aliases. Some of them are desired, some are not. I originally created a .alias file in my home directory, and added source $HOME/.alias to my .zshrc. ...
56
votes
2answers
46k views

How do i change my default shell from bash to zsh?

I want to change my shell from the default bash shell to zsh on my Amazon EC2 instances. How do I go about doing it? Thanks!
0
votes
5answers
30 views

History in bashrc on login vs manual sourcing - clearing and loading

I use a bunch of different aix machines at work and need to share users with co-workers. To make my life easier but not bother others with my customizations, I have created a .bashrc file that I copy ...
0
votes
2answers
52 views

Linux zip and exclude directory in Bash script

I am trying to write a bash/shell script to zip up a specific folder and ignore certain sub-dirs in that folder. This is the folder I am trying to zip "sync_test5": My bash script generates an ...
0
votes
1answer
30 views

Memory usage of a process in a shell script

I want to find out the memory usage of a process in a shell script.I tried to use this piece of code : while[process] do if [ -e /proc/$pidno/statm ]; then m=`awk '{OFS="\t";print ...
2
votes
3answers
760 views

Windows 8.1 + Classic Shell, how well does it restore Windows 7's functionality?

I prefer a classic Windows UI. I enjoy Windows 7, but have heard that Windows 8.1, despite its unconventional interface, includes some under-the-hood improvements, such as faster boot times and better ...
1
vote
1answer
18 views

Hide all output from a background process

I have a bunch of commands in my zshrc which invoke another command in the background. The background command is an alias to a text-to-speech program (I use it to give me audio cues when processes ...
3
votes
1answer
235 views

How to use usbmon for knowing amount of data transferred from usb (pendrive )?

Please someone explain me in simple terms how to use usbmon to track the amount of data transferred from pendrive ?
1
vote
1answer
19 views

How to extract certain database from full Mysql dump?

I have regular backups of my mysql server.For convenience I set it up as a single Mysql nightly dump. Now I need to restore one of the databases from the dump. How do I restore a single database ...