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
2answers
53 views

Using a shell script: How to get the icon name (or path) of an open window in X-based window manager?

I am able to get window ids and window titles using wmctrl, but so far I haven't been able to get the path to the icon used by the window. I've tried looking at xdg utilities, but the closest was ...
0
votes
0answers
34 views

curl -X POST not working properly?

Here's what I'm running as a test and it is working: curl -X POST http://zone-h.org/notify When I run that, I get the HTML of the page returned. However, when I run this, it isn't returning the ...
2
votes
2answers
299 views

How to move files into corresponding folders which have the same name?

Example scenario: I've multiple files ending with .torrent and I would like to move them into folders which has the same name. For example given the following files: abc.torrent def.torrent some ...
0
votes
1answer
430 views

How do I replace the system shell (explorer.exe) with another process in Windows 10?

This is for Windows 10. Is there a way to replace explorer.exe with, for example, a powershell script? I'm looking to start a custom shell application without having to have explorer.exe run in ...
0
votes
1answer
72 views

ssh reverse shell permission issues

I'm taking part in a Capture the Flag (CTF) and I'm using Kali. I have access to a server (Server 1) via another server (Server 0) through which I pivoted. Now I'm tasked with setting up a reverse ...
1
vote
1answer
74 views

ConEmu / cmder last line of shell getting hidden / scrolled beneath bottom

I don't know if I've described this well, but the bottom line of the console keeps getting scrolled beneath the bottom. I imagine some setting I've tweaked caused this, but I can't figure out which ...
15
votes
4answers
2k views

dir C: vs dir C:\

I've accidentally found that if I do: dir C:\ I get a list of files that are direct children of the C: drive, in the root. However, if I do: dir C: I get a huge list of files that I'm not even ...
0
votes
1answer
13 views

npm doesn't start, nodejs-dev problems (ubuntu14)

I'm using ubuntu 14 and I installed nodejs-dev and nodejs and that's what appears me (photos below); can anyone help me to fix it? I really need it to continue with my project. I read about create a ...
1
vote
2answers
81 views

how to modify the “time offset from UTC” of files

I use stat to get information of files, I notice Access: 2013-12-28 13:12:11.244573123 +0100 Modify: 2013-11-12 22:54:42.274460079 +0200 Change: 2013-12-13 12:45:08.164394887 +0100 the +0100 +0200 ...
1
vote
1answer
92 views

Passing Env Variables to Batch File

I'm having difficulties passing a env var (declared in my .bash_profile) to a batch file script which executes a BTEQ operation (in Teradata). .bash_profile contains: export DBPASSWORD='password' ...
3
votes
2answers
56 views

Find location of shell script (or symbolic link) from shell

I'm on Ubuntu 14.04 and I have a shell script or a symbolic link (I can't remember which one - and I'm not sure how to tell what it is) called pbar that runs pianobar. So, to be explicit, from a ...
0
votes
0answers
32 views

Disable local files execution on certain drives (Windows 7)

Currently I'm running a kind of NAS based on Windows 7 Ultimate. The machine has one system disk and several data disks. I need to prevent accidental files execution on data disks so that EXE, BAT ...
0
votes
1answer
34 views

Distinguishing and Executing `set` & `env`?

What is the difference between the set and env commands? When would/should one be used as opposed to the other? How are they generally invoked? (Typical use; case scenario).
1
vote
0answers
81 views

How to restrict user's ssh to non-terminal access without changing /etc/passwd?

I have a user on my Linux system that is only allowed to use SSH to scp, sftp and rsync, but not allowed to have a shell session in a SSH session. I want to know a secure way to setup the restriction. ...
0
votes
2answers
44 views

xargs; How & When?

What exactly is xargs? How do you use it? When would it be considered pragmatic, or otherwise appropriate to do so?
0
votes
1answer
56 views

How to start a program on user login in Debian but disallow interactive shell

I want to have a user in Debian 7.x with the following restrictions: When the user logs in, a command-line program will automatically start in the user shell session. Then the program will parse the ...
1
vote
0answers
24 views

List of links that will be taken without a proxy in linux

How can I add a list of links that will be taken without a proxy in linux or another shell programm (etc. proxychains)? I need it to exclude the download proxy .avi files proxychains firefox
4
votes
1answer
75 views

Actions before logout from ssh session

Is it possible to bind some actions which will be executed before logout from ssh session? I mean some config like .bashrc, etc.
5
votes
1answer
115 views

Execute same command for each non-interactive bash session

I need to implement some config - I need to execute some code, if someone on my system calls for bash command in any form (interactive, non-interactive and bash -c form). For example this is command I ...
3
votes
1answer
38 views

Get find output to delete files later

I would like to take the results from this command: find . -type f -size +200M -exec ls -lh {} \; store the content to a variable of some form, and then delete the found files. How can I do this?...
2
votes
3answers
17 views

How to pass heredoc defined variable to command

How can I pass this heredoc defined variable to a command? read -r -d '' tables <<'EOF' table1 table2 table3 EOF tables=$(tr '\n' ' ' < "$tables"); I want the table variable to be defined ...
2
votes
1answer
126 views

Exchanging input data between shell scripts

I have a simple shell script to run in Android adb shell. while true; do read var1 echo $var1 > /data/local/tmp/debug.txt am force-stop $var1 done It works ok if I enter a value in ...
0
votes
0answers
17 views

Shell Scripting - Mac - Emailing

I'm just messing around with shell scripting after doing some in the past, and I have figured out how to Email myself from writing a script by using: mail -s 'Backup status' lcharlton@vldbsolutions....
1
vote
1answer
70 views

what do +0100 +0200 mean in linux command `stat` results

I use stat to get information of files, I notice Modify: 2011-03-02 14:23:33.489430232 +0100 Modify: 2012-11-15 10:13:26.534178635 +0200 what do +0100 +0200 mean?
0
votes
1answer
33 views

Getting output of another script while preserving line-breaks

I'm running a C program from a bash script and would like to capture the last line of output and the exit code. This is what I did: echo output=$(echo $op | ./compute) echo $output echo "$output" ...
0
votes
1answer
82 views

How to write “!” symbol between double quotes in bash? [duplicate]

I can't figure out how to write ! symbol in bash scripts when putting it in double quotes strings. For example: var="hello! my name is $name! bye!" Something crazy happens if I type the following ...
2
votes
0answers
96 views

Force Ubuntu user to use specific shell

After years of reading helpful questions/answers on superuser, today it's my turn. I'm playing around with "lshell", a linux shell written in python (lshell on github) which gives the opportunity to ...
-2
votes
1answer
89 views

Shellscript Looping Through All Files in a Folder

I want to write a shellscript that will loop through all the files in a folder and echo only the .sql files. Can anyone point me in the right direction? currently I am getting all the files along ...
1
vote
0answers
433 views

Merge xml files using Linux shell scripting

I have 2 files named file1.xml and file2.xml respectively. The contents of the files are: file1.xml: <EJB:Service> <EJB:ServiceId>123</EJB:ServiceId> <EJB:ServiceName&...
0
votes
0answers
61 views

LInux csh shell: gaining full command history

I am trying to retrieve some recent commands which I entered using the csh shell in Linux. However, when attempting to use the history command and various combinations of flags I am unable to view ...
0
votes
1answer
74 views

Save shell execution output to file and display in terminal [duplicate]

I know you can save the output of executing a script/file to another file by using: ./script.sh >> script_output.log but this doesn't display the output in terminal during execution. Is there ...
2
votes
1answer
53 views

Special equal character with sed from shell

My environment: I am working with the command interpreter on Windows. I use an sh.exe that came with some proprietary tools I have installed. I do not know the details of that sh.exe but here is ...
0
votes
1answer
47 views

How to bash complete an alias as the command [duplicate]

I have an alias alias gi=git Unlike git, gi cannot complete on subcommands, paths, branches. How can I tell bash to "complete X as if it were Y"?
0
votes
0answers
22 views

tmux: what is the mode I get periodically locked in when (attempting) pressing Ctrl-B Z

I am quite new to tmux (but familarized with the basics). Regularly, I end up in a mode, I do not understand, and I do not know how to leave anymore. This happens sometimes when having multiple panes ...
0
votes
1answer
83 views

Shell Script to pass arguments to another script

I am new to the linux and shell scripting. I have a script, which has some read commands in it. So, something like #script1.sh echo "something here" .... read var1 read var2 ... Now, i want to ...
1
vote
2answers
129 views

How can I change the “last modified” (or “last changed”) time of files on Linux?

I tried touch -t, but its precision is only one second: when I use stat, I see there are 9 digits all zero after the decimal (.): Access: 2013-10-10 15:12:00.000000000 +0200 Modify: 2013-10-10 15:12:...
0
votes
1answer
183 views

linux command to find out if folder exists or not in a windows ftp server

I have connected a Windows server from a Linux machine via ftp. I want to find out if a particular folder exists or not in the Windows FTP server. How do i find out that using Linux shell scripting?
0
votes
1answer
82 views

cURL in shell vs. knockd

I want to use curl to control features of a IPcam. This works fine in a shell (/bin/sh) but fails when called from knockd. I am trying this on a QNAP NAS (Busybox Linux). The script I am using is: #!...
-2
votes
1answer
58 views

Is it useful to replace old styled linux shell command with well designed?

I found out that linux commands are too old and require a lot of effort in order to learn all of them. Is it reasonable to replace them with new ones?
0
votes
1answer
22 views

Is there a way to log what application or device is using a USB port?

I have a DAQ connected through USB, and every now and then it drops signal and the application using it crashes. I have a feeling that some other process or service is interrupting the USB. Is there a ...
1
vote
2answers
34 views

Bash: execute when job in background completes

If you want to run a series of commands, one after the other, you can execute command1 & command2 & command3 & If I execute command1, then Ctrl+Z, and then bg, it will run command1 in ...
1
vote
0answers
35 views

make environment variable available inside cmd script in windows

I am running a script like below, but the environment variable path does not contain C:\tmp inside script.cmd, how to make it available? Os is windows. cmd.exe /c "set path=%path%;C:\tmp && ...
0
votes
1answer
29 views

Substarct two float numbers in shell script

I have written shell script to substract two float values For eg. below are the two values : debit_amount=7.853117806000353E7 credit_amount=3223649.619999993 val1=$(printf "%f", "$debit_amount") ...
0
votes
0answers
22 views

Recursive wget strip GET parameters

I am downloading a website I have using wget -r http://example.com but in order for the css files to not be cached, the website adds GET parameters to those files such as styles.css?foobar. How can I ...
1
vote
1answer
192 views

How do I configure Babun to work with Meteor?

I've tried adding the Meteor plugin in the .zshrc file like so: plugins=(git meteor) I couldn't find any documentation on http://babun.github.io/faq.html that would answer this question directly.
0
votes
2answers
80 views

How can I run a script to do some configuration for a brand new user?

I want to perform some configuration tasks for a brand new user, like applying default settings. For example, I would like to create some default directories (Documents, Downloads, Music, Pictures ...
0
votes
0answers
63 views

Beginner issues with shell scripting

I'm pretty new to the scene so I came across a few problems when I used vi I can't figure out how to apply commands to it. I was supposed to look for the string "happy" in a file, which I could do ...
0
votes
1answer
169 views

Batch run multiple commands in a new shell

I'm trying to open a new Konsole and run multiple commands on it basically from my opened terminal shell I need to: Open a new terminal shell Set environment located in a specific folder Run gedit ...
1
vote
1answer
82 views

Calling bash script recursively with different parameters

I'm trying to write a bash script that counts all the files in the given directory & sub-directories, so I wrote this: #!/bin/bash var=0 if ["$#" == "0"] directory="$(echo pwd)" then ...
0
votes
1answer
105 views

How to execute shell script from PHP with non-standard extension?

I've Windows with shell integration installed from Git (as well as Cygwin) and the following PHP code fails to run external shell script which has .launcher extension: <?php passthru("foo.sh"); ...