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
40 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. ...
0
votes
2answers
127 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 ...
2
votes
3answers
103 views

In a Linux shell, why does backslash-newline not introduce whitespace?

When using the Linux shell, I come across the following situation: $ A=B\ > C $ echo $A BC In my mind, when the newline encountering escape character, it can not be a CR character but it still ...
0
votes
0answers
37 views

Writing a secure login script

I'm trying to write a secure login script to allow a user to have limited access to a server and change particular options. My method for doing so is via a python script executed by the users ...
0
votes
0answers
25 views

how to detect availability of GUI

For Linux: I have a text mode installation (bash) script and a graphical mode setup program (a Free Pascal binary). I'd like to run the graphical setup when a GUI is available. How do I detect which ...
1
vote
4answers
99 views

How to get first line of output from command line?

I'm running a find command that's returning multiple results, but I only need the first result. A bit of googling led me to the "read" command, but I couldn't figure it out, and the man page didn't ...
0
votes
0answers
55 views

ffmpeg - how to see what scaling algorithm is used

I'm upscaling a 200x200 video to 400x400 using the -sws_flags scaling option to set the scaling algorithm. Now, I can't tell by the console output if some algorithm was used, neither by the looks of ...
1
vote
1answer
142 views

alias not working with my mongo --eval command

I have the following mongo shell command to delete all users that aren't admins mongo --eval 'db.users.remove({group:{$ne:"admin"}})' collection This works. I want to create an alias for this ...
0
votes
0answers
8 views

Different low uplink machines hold the same data, how to speed up rsync to machine with faster connection?

Two different machines hold the same data (10G+), both with relatively slow upload. I want to transfer the data to a machine that can receive with a much faster speed. Now to speed up transfer of ...
0
votes
1answer
74 views

shellinabox - How can I restrict access to certain users only?

I've got a Ubuntu 14.04 machine which I've set up with shellinabox. Now I would like to restrict access to shellinabox to only a certain user account. Nobody else should be able to log in with it. ...
1
vote
2answers
78 views

Choose which binary is default binary on Mac OS X Mavericks

I have installed the latest SVN 1.8 via homebrew on my Mac. However now If I run svn --version I get back that I have 1.7. Next thinng I run which -a svn which then shows me I have it twice: ...
0
votes
1answer
35 views

How can I move a specific folder if there is a file with the same name in bash script?

I'm trying to write a shell script that finds a specific file and moves it to a folder. #!/bin/sh echo -n "/home/cosmoretro/movie/" read text2 while : do echo -n "Ara:" ...
0
votes
2answers
66 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 ...
1
vote
2answers
57 views

What is the meaning of “var=${str=expr}” in linux shell?

What is the meaning of "var=${str=expr}" in linux shell? Who can explain it for me specifically?
1
vote
0answers
19 views

Better line breaking in terminal?

I am not sure if my request is valid, doable or better than the default option, but I'll give it a shot anyway. Word-wrapping in a terminal usually bothers me, since it wraps in the middle of the ...
0
votes
1answer
37 views

compare 2 arrays eg. csv

i would like to know if it is possible to compare 2 list via shell. The setup: List "A" with about 6000 entries List "B" with about 300 entries Is it possible to detect wich are duplicate and wich ...
0
votes
0answers
31 views

path setting appears twice in env output

After an OS version upgrade I have the following strange problem: % port MacPorts 2.3.1 ... % sudo -i # port MacPorts 2.3.1 % sudo port sudo: port: command not found Furthermore, if I do it all ...
0
votes
2answers
73 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 ...
5
votes
1answer
100 views

Why there is an empty line begin with “*” in the result of history command on linux?

Today at work, I wanna know a history command which I am not very familiar with and I was sure that I just executed a little while ago. However, when I ran history on the same terminal window, I found ...
0
votes
1answer
120 views

Tried Installing ZSH through cygwin and then trying to use zsh through Cmder

I tried to install Cygwin (64 bit version) on my computer, and it went through hunky-dory until at the very end, autorebase.bat failed with exit code 1. I read through the logs and they weren't too ...
0
votes
1answer
23 views

psql ignores my PAGER variable

I want to use less as my default pager. Therefore I have PAGER=less in my .bashrc. It's sourced properly: $ echo $PAGER less However, psql still uses more if I call it with psql. BUT: If I call it ...
0
votes
1answer
19 views

exiting current terminal in a script

I have made alias for running certain program and i have put it in .bashrc file. I want to close current terminal inside the script. I've tried this but it is not working. alias mp='java -jar ...
-2
votes
1answer
150 views

how to run command in another terminal in Linux script

In Linux shell script I have to run few commands under another user but I am enable to. Please advice some suggestions. $ jumpto -T -u ... after this command it enters in another terminal and I ...
1
vote
4answers
70 views

How to rename a lot of files in bash shell?

Sorry for the question. I searched the internet a lot, but couldn't find an answer which worked (though there were a lot of suggestions). So, I want to rename A LOT of files. Writing all file names ...
0
votes
1answer
49 views

Small bootable package to enable ssh client?

I've been trying to find the smallest possible package to put on a cd/thumbdrive that will allow me to use an ssh client on a wired networked computer. I'm talking about really barebones stuff, no ...
0
votes
1answer
56 views

stop all child processes when 1 of then returned exit code 1

I have 2 or more build processes to run in background. I want to stop all the build processes if one of them exit with code other than 0. ./build-1.sh & ./build-2.sh & ./build-3.sh & wait ...
0
votes
0answers
20 views

Access script arguments from within script [duplicate]

I have a script that I can run like this: bash myscript.sh -ram 4096M -jar something.jar -dir /home/something I would like to be able to access the variable ram, jar, and dir from within the script. ...
0
votes
1answer
54 views

CentOS 6 - Send user defined command from PHP

I have a web control panel and I need my allow my users to send commands to their application. I a similar problem to SQL injection. $user_input='good command'; shell_exec('tmux send-keys session1:0 ...
1
vote
1answer
217 views

Batch convert txt file encoding

I have about 700 files that were the results of a closed caption software process. I can open the files on my PC or Mac in a GUI, but when I open it on the server with nano, I get this: ...
0
votes
3answers
55 views

Starting programm into window manager

Is there a way to start a program from a terminal, that is not a "child" of the window manager (p.e. XFCE), into a window manager? The executed program has to be detached form the terminal (and my ...
1
vote
1answer
34 views

Different globbing behavior with same shopts?

I have multiple shells (bash) open on the same machine, and in one of them, globbing seems to have stopped. ls * gives ls: *: No such file or directory, and so on. I figured that I must have set some ...
0
votes
1answer
29 views

Apply new Windows shell context menu item to encrypted files

I am trying to add a context menu item which will only appear if a file is marked as being encrypted. With an AppliesTo entry, I can successfully apply the menu item to only text files with ...
0
votes
0answers
148 views

mc-wrapper does not exit to MC_PWD directory

I recently installed openSUSE 13.1 and set up the mc in typical why by aliasing mc with mc-wrapper.sh to have it exit into the last working directory in mc instance. However this does not seem to be ...
0
votes
2answers
155 views

Is it possible for a root user to watch others' shell session secretly in live?

I see a similar question on stackoverflow: http://stackoverflow.com/questions/1353253/linux-terminal-how-to-capture-or-watch-other-terminal-session Someone recommends conspy. However, it seems that ...
0
votes
1answer
59 views

Bash doesn't source file unless manually started

bash won't source files from an login terminal unless I manually run bash from a terminal, I have bash (and not sh or dash). When I source a file, it returs errors (like "syntax error near unexpected ...
-1
votes
1answer
17 views

Record directory sizes on shutdown

What would be the easiest way to record and store the sizes(and a timestamp) of a few chosen directories upon each shutdown - say in a .csv file.
1
vote
1answer
42 views

Using fdisk -r to read disk in Solaris

Upon reading the fdisk's man page on Solaris, I came across the -r flag: -r Read from disk and write to stdout. See -o and -s, which specify the starting point and size of operation. Using ...
1
vote
2answers
42 views

Execute a previous command in a shell and get the command directly after

Once, a colleague of mine shown me a very useful method (shortcut?) on a shell (bash? csh?) to, after executing a previous command, automatically show the command after in history. For example, ...
-1
votes
1answer
160 views

Run shell script (.sh) from wine

I am new to the wine community. I need some help with a project I am trying to do. I have installed Wine over Ubuntu 14.04 and I have installed ffmpeg on my machine (ffmpeg as a linux program). I ...
-1
votes
1answer
104 views

Using /usr/bin/env to change directory [closed]

I want to automatically execute commands with the prefix /usr/bin/env $/usr/bin/env composer install (this runs OK) $/usr/bin/env cd public (failed ---> /usr/bin/env: cd: No such file or ...
0
votes
0answers
27 views

Running Custom commands in a Terminal Application

I am running a terminal application in /dev/pts/X terminal that has its own console as sampleapp> what I need is to run commands specific to this application but from another terminal.
0
votes
2answers
52 views

Piping Several commands in a BASH shell

I am trying to recursively loop through a directory which contains numerous other directories and files and then find all the .rb files and copy them to another directory. This is what I have so far ...
1
vote
2answers
586 views

Equivalent of (foo &>/dev/null &) in Windows shell

I'd like to run a particular application (let's call it foo) from the command line, but I don't want it holding up the terminal, putting any junk in the terminal from its output or error streams, and ...
0
votes
0answers
97 views

is the chromebook developer mode shell a fully capable linux shell

I have enabled developer mode on my chromebook. Is the command line shell a fully implemented linux shell? Would there be any point in installing something like ubuntu?
1
vote
2answers
32 views

Start application from a numbered list of choices

I want to display all applications dynamically within a folder in a numbered list, and launch them by entering the number associated with the application. So far I have the easy part working, the ...
0
votes
1answer
28 views

What's the difference between --param=“value” and “--param=value”?

In the past I've read (can't recall the source) that: ./script --param="value" can have different results compared to: ./script "--param=value" and that due to these differences (which might ...
0
votes
1answer
242 views

How to escape “!” and “&” in docker's environment varibles

I have a docker container I want to run and hand it over some passwords. One with an exclamation mark ! and the other one with an ampersand &. So I want to run this: docker run -i -t --rm \ -e ...
0
votes
0answers
20 views

Win 7 - default commands upon starting shell [duplicate]

Is there any way to set "default commands" that would be executed whenever a windows shell (cmd) is opened? E.g. I like to execute "prompt $g && cls" before doing anything else. Can I ...
-1
votes
1answer
61 views

how to escape '$' in an awk statement in shell alias

I'm trying to write an alias that will kill all running php processes.. this is the command i got in my ~/.bash_profile alias killphp="ps aux | g [p]hp | awk '{print $3}' | xargs kill -9" this ...
1
vote
1answer
41 views

realpath (GNU coreutils 8.22) does resolve “.” symlink regardless of “-s”

I'm trying to use realpath in a script which has to ensure that it is located under a certain (possibly symlinked) path. Also the script has to be runnable from any location, so it cannot presume that ...