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

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 ...
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
0answers
26 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 ...
9
votes
1answer
15k views

When using “gzip --decompress”, the result is “gzip: MYFILE.zip: unknown suffix — ignored” on Windows

In Windows PowerShell (if it matters), I would like to decompress a zip file with gzip with the argument --decompress, but unfortunately it doesn't work. Please look at the screenshot below. gzip ...
2
votes
2answers
2k views

Extract a zip file to your own directory

Im trying to extract the contents of a zip file but I want to extract it to my own directory. I'v tried -d from unzip but that just puts the contents of the zip into that directory. But I want to ...
0
votes
0answers
6 views

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

Hey all guys and thanks a lot for come to read and try to help! I don't know why..I'am using ubuntu 14 and I installed nodejs-dev and nodejs and that's what appears me (photos below); can anyone help ...
1
vote
2answers
22 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
25 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' ...
1
vote
1answer
145 views

Linux unzip: don't prompt user

I need to unzip a file in my nodejs script: var exec = require('child_process').exec; var execOptions = { timeout: 15000 }; exec('bash unzip.sh', execOptions, function (error) { ... }); In ...
2
votes
3answers
3k views

Terminal unzip outside default directory

Using terminal command "unzip" seems to be extremely useful when deploying a CMS to a remote server, since you can transfer a zip and unzip it remotely. However, I cannot find a way to unzip the all ...
2
votes
3answers
2k views

Can't rename a file the name of which starts with a hyphen

I'm trying to rename a file with a hyphen at the beginning of its name and both this: mv -example-file-name example-file-name and this: mv '-example-file-name' example-file-name result in: mv: ...
3
votes
2answers
38 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
17 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
28 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).
2
votes
2answers
413 views

How to run pip in non-interactive mode?

Most of tools I'm using have some mode (often ON by default) where they ask me zero questions while running the command. apt-get is an example close to pip. There's -y option which makes it ...
142
votes
7answers
55k views

Scroll shell output with mouse in tmux

Mouse scrolling doesn't work in tmux the way it works when I run shell without tmux (in Gnome Terminal). It seems tmux sends mouse scroll events as if I pressed Up/Down keys. But I want it to scroll ...
1
vote
0answers
40 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. ...
1
vote
2answers
36 views

When to use `xargs`?

In what kind of situation can xargs be used? And when would it be considered pragmatic to do so?
2
votes
1answer
392 views

Crossfading Video AND Audio with ffmpeg

This Super User answer crossfade between 2 videos using ffmpeg has got me so far, but now that I have tried many solutions and seen every SO link out there, it's time to ask you all for help. I am ...
0
votes
1answer
19 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
48 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.
3
votes
1answer
34 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 ...
-4
votes
2answers
7k views

shell script to send an alert mail if disk usage exceeds 90% and another alert at 95%

I am new to shell scripting and want to implement a script on my server which will automatically send email alerts if the disk usage goes over 90% and second email alert when it goes over 95%. my ...
3
votes
3answers
13 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
670 views

Shell: how write multiline text file without escaping special symbols?

I know the question sounds to be discussed thousands times before. But somehow I can't find good solution. Problem: I need to write multiline text from shell. The text might contain special chars ...
1
vote
0answers
383 views

Getting complement of two text files on the Unix command line

Is there a fast Unix-based utility (ideally written in C) for getting efficient, streaming intersection/union of tab-delimited text files? For example, allow queries such as "give me the all the ...
0
votes
0answers
12 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 ...
5
votes
3answers
6k views

How do I change my default shell to use ZSH in Ubuntu? [duplicate]

Possible Duplicate: How do I make Bash my default shell on Ubuntu? I want to change my default shell in Ubuntu to ZSH. What's the command to do this?
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' ...
5
votes
2answers
11k views

The application “SomeApp.app” can’t be opened

Problem: after downloading an application in OS X Yosemite (10.10.x) trying to open the application (either from the command-line or by double-clicking the application) produces an "The application ...
1
vote
1answer
62 views

Upstart: What is the first tracked PID w/o expect, but with script AND exec?

I have some Upstart configs used to start some foreground and blocking processes to run in the background as some kind of "daemons", especially those processes do not fork in any case. What I want is ...
1
vote
2answers
451 views

howto change screen hardstatus dynamically with format, from shell?

howto change screen hardstatus dynamically with format, from shell ? I successfully configured screen using 256 colors and tabs and so on, here is my .screenrc : http://pastebin.com/g8XbMWBH I use ...
2
votes
1answer
40 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?
6
votes
3answers
2k views

How to list directories names but not their contents, in *N*X?

If I do a simple ls specifying a filename pattern, like ls A*, for directories that match the pattern, it will enter the directory and give the full listing, but how could I get just the listing for ...
3
votes
2answers
5k views

How do I run an Automator action, shell script or AppleScript on startup in OS X?

I know you can run applications on startup on a Mac, but can you run an Automator action, a Service, a shell script, or an AppleScript on startup instead? I also know you can save all of these as an ...
0
votes
1answer
48 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 ...
0
votes
1answer
29 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
66 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
56 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 ...
0
votes
1answer
43 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: ...
0
votes
1answer
56 views

Result of | grep in a variable

Here is my script: var= $( $line | grep -Po '.*(?=.fr)' ) echo $var I have an error and it only displays: command not found Have you any idea what is wrong?
0
votes
2answers
71 views

How can I get the hostname of the machine I work on?

I am wondering how can I get the hostname (fully qualified domain name) of the machine I am working on? Here is my script: #! /bin/sh hostname=$(host $ipaddr | awk '{print ...
-2
votes
1answer
46 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 ...
0
votes
1answer
72 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
0answers
108 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> ...
0
votes
0answers
32 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
41 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 ...
11
votes
12answers
13k views

how to `tail` the latest file in a directory

In shell, how can I tail the latest file created in a directory?
0
votes
1answer
32 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"?