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

learn more… | top users | synonyms

8
votes
2answers
4k views

What is the difference betwen /etc/environment and /etc/profile?

I understand that the former is used prior to the latter, but what is the conceptual difference? Is there any good reasons I should set some variables in one and not in other? Except the fact that ...
1
vote
4answers
3k views

How do you pass a file or folder containing whitespace as an argument to a command-line program in a GNU/Linux or Cygwin environment?

There are occasions when you are working with files and folders that contain spaces in them. The problem is any time you try and pipe files / folders containing whitespace to another command-line ...
2
votes
0answers
43 views

Prevent ARP spoofing in AP, “wl deauthenticate” command

I am in a situation where I cannot do MAC filtering in an AP and I need to block a user that is ARP spoofing the network. I am trying to use the command wl deauthenticate to kick the client. And I ...
1
vote
2answers
144 views

How can I have Emacs window(s) and cygwin shell running simultaneously on Windows?

I have Cygwin working with Emacs 24.3.1 on windows 8.1 with Emacs downloaded from the Cygwin installation, however I can't use Emacs and the Cygwin shell at the same time or open up multiple Emacs ...
25
votes
7answers
20k 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.
0
votes
1answer
46 views

How to make a Windows desktop shortcut (with shortcut key) to open a Chrome pop-up window

If you create a desktop shortcut, and set a shortcut key in its properties, you can use that shortcut key in any application. How can you make such a shortcut so it opens a Chrome pop-up window, not ...
28
votes
2answers
15k views

scp between two remote hosts from my (third) pc

I have two remote hosts. host1-> 10.3.0.1 host2-> 10.3.0.2 Both run an ssh server. The ssh server listens on port 22 in host1 and on port 6969 in host2. Now, using my local machine, I need to copy ...
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 ...
159
votes
19answers
84k 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 ...
1
vote
1answer
41 views

Disable audio output of a program

To disable text output we use > dev/null, for example, make > /dev/null But how to similarly disable audio output? For example, skype A>&1 /dev/null or whatever. EDIT: If it's ...
1
vote
1answer
21 views

Monitor SSH login's via slack but hangs on SCP

I'm playing around with some slack integration so that every SSH attempt gets sent to a slack channel The script below works perfectly for SSH attempts but the issue is that when I preform a SCP to ...
1
vote
1answer
29 views

Hit enter automatically when running apt-get install <package> prompts a dialog boxes

I'm running command apt-get install -y <package>. It overcomes confirmation like Do you want to continue? [Y/n] But in the process of updating, I got a popup which asks to hit enter in ...
3
votes
1answer
37 views

In bash, declare an alias that depends on current variable content

I would like to declare an alias (in my .bash_profile) that will use the content (value) of a variable when the alias is used, not when it is defined. E.g., alias goSomeWhere="cd $BASE/somewhere" ...
146
votes
13answers
124k views

How do I detach a process from Terminal, entirely?

I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy. However, I'm struggling with how to completely detach a ...
1
vote
1answer
35 views

FFmpeg performs every second task

Why does ffmpeg perform every second task that it is ordered to? for i in *.MTS; do echo ffmpeg -i \"$i\" -c:a copy -c:v copy \"$i\" | sed 's/MTS/mp4/2' done | sh For example. if I have 9 MTS ...
0
votes
1answer
19 views

How do I make an alias for a Unix command that includes both single and double quotes?

I defined the following command: top -b n 2 -d 0.01 | grep 'Cpu' | tail -n 1 | awk '{print "cpu=" 100.0-$8 "%"}' which returns me the CPU usage in the form cpu=nn% I now want to define the alias ...
0
votes
1answer
29 views

git rebase --interactive throws an error

I'm relatively new to git. Could anyone, please, help running git rebase --interactive properly? It throws an error when I try to execute it. Note: I don't want to uninstall Xcode unless it's ...
80
votes
9answers
60k views

How do I make rm not give an error if a file doesn't exist?

I'm writing a makefile that will clean up some useless files at the end of the compilation. If a target has already been made, it will of course skip that target and the useless file may not be ...
1
vote
3answers
555 views

Edit xml file using shell script / command

I need to do this using unix script or command There is a xml file in /home/user/app/xmlfiles like <book> <fiction type='a'> <author type=''></author> ...
26
votes
4answers
29k 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 ...
1
vote
3answers
82 views

Does “DOS” have a shell?

I have been reading the posts I found about shell , terminal , bash but I get more and more confused about these terms. Does the operating system DOS have a shell, like the bash in linux? Is this ...
0
votes
1answer
190 views

Android ADB Shell sendevent Not Working

I want to simulate pressing the power button on a rooted Samsung Galaxy Tab 2 GT-P5100 running Android 4.0.4 using the ADB shell. To do this I changed the relevant permissions using: adb shell su ...
0
votes
0answers
19 views

Stopping a process when a given file is accessed

I have a complex script that accesses/creates lots of files, and I'm trying to track down exactly when it creates a file with a given name. What I want is to be able to stop (e.g. as if using Ctrl+Z, ...
18
votes
5answers
8k 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.
1
vote
1answer
30 views

Escape-backspace behavior in fish shell like in other shells

I recently started using the fish shell for some things and generally like it. However I've run across one situation that would be great if there were a workaround. Say I typed a command like this: ...
2
votes
3answers
49 views

Extract version string from filename

We have a list of filenames in file a.txt with their version string embedded in them. Eg: gson-2.1 xmlParserAPIs-2.4.0 acrobat-1.1 orai18n-mapping-12.1.0.2 jdbc-se2.0 eclipse-core-runtime-20070801 ...
54
votes
10answers
82k views

sudo with password in one command line?

On busy days, I'd like to run $ ./configure && make && sudo make install && halt on the night and go to bed, hoping the application would automatically be installed. But ...
2
votes
1answer
71 views

Append text to first occurrence of a pattern using sed

Say there is a text file as below: Hello world types="" Mario types="Game" What I want to do is find the first occurrence of type="" and append with word "program". I need output as: Hello world ...
1
vote
0answers
41 views

How do I start the taskbar after changing the “shell” registry key that runs at login

So, I have made a version of windows that looks like it isn't running windows (no logos or common windows tropes), so that it looks like it is only the software I choose that is running, sort of like ...
3
votes
1answer
42 views

Can't run default shell

What to do if I uninstalled my default shell (/opt/local/bin/bash)? I can't open terminal under my account unless my default shell is valid or at least exists. Are there any elegant ways to fix it? ...
2
votes
1answer
105 views

Is there a Unicode-aware LC_COLLATE sort order which respects punctuation?

As far as I can tell, setting the environment variable LC_COLLATE=en_US.utf8 changes four things compared to LC_COLLATE=c, regarding how programs like ls will sort files: Unicode characters are ...
0
votes
1answer
25 views

Is it possible to delete directory when in the directory in shell

I have a directory which I run a program in. /usr/bin/my-dir I need to run the program from within the directory So I must go cd /usr/bin/my-dir ./my-program I have a script that from a ...
4
votes
7answers
3k 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
229 views

"bin/sh: can't access tty; job control turned off” error while installing

I am installing CernVM Software appliance in VirtualBox in Ubuntu. After I start the virtual machine, it starts to install but in the midway gives the following error bin/sh: can't access tty; job ...
1
vote
2answers
8k views

Run a shell script on Ubuntu startup

I have a shell scrip that runs on jvm, it works as I write: sh /opt/bin/myshel.sh I added a shell script to /etc/inti.d with this detail: #! /bin/sh ### BEGIN INIT INFO # Provides: ...
2
votes
0answers
51 views

OSX - Custom lockscreen incorrect password script

As you probably know, in Mac OS X you can enable a lock screen when waking from sleep, where the user enters their password. I am looking for a way of running an Automator.app workflow when an ...
1
vote
1answer
33 views

Why can't I use my newly created user with chown?

So I am attempting to create a new user and group, and then change ownership of a directory to that new user/group. However, when I do, chown comes back with an "illegal user name" message. Here's a ...
3
votes
2answers
295 views

Format stdout as multi-column text

I'm trying to take some single column data and display it in a tty as columns, much like ls does. Basically, you can think of this as trying to take the output from ls -1 and make it look like the ...
1
vote
0answers
7 views

Including a fallback in default shell

I have an account on a network, and my shell is set to zsh, but when I log onto a computer that doesn't have zsh installed on it, a terminal I launch tries to run zsh and fails, so I get an empty ...
0
votes
1answer
36 views

Fish Shell STDERR not outputted by default

I am using the fish shell, which until this moment had been a perfect replacement of the good old bash, but I came across the following problem. fish does not forward STDERR to STDOUT. Of course if I ...
0
votes
0answers
41 views

How do I undo this terminal command?

The following was supposed to stop my f8 key from automatically opening my itunes on my Mac. "#!/usr/bin/env python import sys, os, subprocess launch = True blocker = "" apps = ["Spotify", ...
1
vote
1answer
59 views

How to run elevated shell from within console2 (Windows 8.1)? Possible?

I come from Linux, and for days I have been pulling my hair out trying to run an elevated shell (powershell, ipython interpreter, and bash) from within Console2. However, it always pops open a new ...
0
votes
1answer
71 views

Mac OSX restart from command line and close all windows

I want to use command line to restart my mac OSX, I'm using: sudo shutdown -r now But i want to restart without the reopen windows option, I've looked at the documentation here but with no luck, ...
1
vote
1answer
85 views

Starting Zsh in ConEmu in specified directory

ConEmu runs zsh under CygWin fine. I want to add a right click option to explorer to "Start ConEmu With CygWin Zsh In This Diretory" ConEmu provides an Integration settings page to set explorer ...
19
votes
4answers
18k 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 ...
4
votes
5answers
14k views

How do you run Vim in Windows?

I just installed gVim, and tried using the usual "vim myfile.java" technique that usually works for linux to open up a file and edit it. But unfortunately, this doesn't seem to work. I've also tried ...
22
votes
4answers
16k views

zsh with Cygwin

How can I configure zsh to be the default shell under Cygwin?
0
votes
1answer
18 views

Where does device mode and state output come from, and how do I disable it?

Whenever I change my wlan broadcasting details with hostapd I get some output like this: [ 6706.929857 ] device wlan0 entered promiscuous mode [ 6707.986991 ] br0: port 2(wlan0) entered forwarding ...
2
votes
1answer
25 views

Search for files created at specific time in folder OS X

I have a folder with 2000+ image files in it from a time lapse camera. I want to find/select all the images that were taken at the time 10:00 and 15:00. The find function has a "date created" but I ...
41
votes
3answers
26k views

How to change the Login Shell on Mac OS X from bash to zsh?

I'm trying to change the Login Shell of Mac OS X from bash to zsh. I see it is possible in Mac OS X Leopard, but for OS X Lion I can't find a way. I really hope it is possible to change the Login ...