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

learn more… | top users | synonyms

4
votes
5answers
2k views

Change default shell on MSYS2

I want to change MSYS2's default shell from bash to zsh. I've tried chsh - not available in MSYS2. Editing /etc/passwd does nothing. It seems to be ignored. I took a look at the batch scripts in ...
-1
votes
0answers
15 views

Windows Shell Functions

So I was following this tutorial: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127427(v=vs.85).aspx when I cam across the sentence that casually says "Call the SHChangeNotify function"....
0
votes
1answer
9 views

Shell script fails when executed by systemd service

So I have a systemd service called startup.service: [Unit] Description=startup scripts [Service] Type=oneshot ExecStart=/home/user/Documents/Tools/Scripts/startup.sh [Install] WantedBy=multi-user....
0
votes
1answer
12 views

How can I set a modified PATH for a non-interactive non-login POSIX shell invoked by Scons on Cygwin?

Because I work on a number of separate projects, (each of which uses a different compiler), I don't like to have the path to any one compiler set in my PATH. Now I have joined another project where ...
0
votes
0answers
23 views

How to boot tablet from usb

I need to boot my tablet from usb stick where my windows 10 install files are stored. There are no boot settings, I can access only UEFI shell see: That usb is blk0 and blk1 (when i unplug they ...
0
votes
1answer
19 views

how can i make zsh tab completion fix capitalization errors? for directorys and files

I switched to zsh completely on a previous arch install and i LOVED it mainly because arch is one of the distros that capitalizes your Documents, Downloads, Music and such directories in your ~ ...
1
vote
0answers
23 views

Create tmux session in seperate shells

I'd like to use tmux sessions to manage windows / panes in different shells. What I've noticed is that tmux will always use the shell from which it was first launched for all subsequent sessions ...
1
vote
1answer
40 views

Matching a randomly generated integer with a specific place value in a string

In bash I want to prompt user for input in a script. Lets say the input is: #!/bin/bash echo "Please enter a number." read NUM # User enters "12345678" How can I use the next command to generate ...
1
vote
2answers
59 views

Ctrl-enter for fish shell

I had tried to create some accept completion and execute right away combination in fish on pressing Ctrl+Enter. function fish_user_key_bindings bind \c\n accept-autosuggestion execute end ...
0
votes
0answers
10 views

FreeBSD google cloud image / set password auto for root etc

i want to use FreeBSD intro google cloud but i can't make the password work. Sorry for my bad english. Soo , i have this shell script for create image : VERSION=10.3-RELEASE VMSIZE=10g SWAPSIZE=1G ...
4
votes
6answers
2k views

What is the simplest way to remove lines from one file matched with lines from another file?

What's the simplest way to remove lines from one file matched with lines from another file? For example, if I have the following files: file1.csv: u2@domain.com file2.csv: 1,u1@domain.com,...
2
votes
1answer
43 views

LibreOffice on OS X: running soffice keeps saying no Info.plist or no NSPrincipalClass in Info.plist

I'm trying to run LibreOffice 5.1.3 from the OS X terminal, to script some conversion tasks. However whenever I run soffice, I always get this error: No Info.plist file in application bundle or no ...
0
votes
2answers
57 views

Importing variables in one shell script from another without executing the referred shell script

I have 2 shell scripts, file1.sh and file2.sh file1.sh #!/usr/bin/env bash export var1="/data/share" export var2='password' echo "Hello" file2.sh #!/usr/bin/env bash source file1.sh echo $var1 ...
1
vote
2answers
4k views

On Unix, open xls file, and read the content, only the data

Does any one know how to open xls file in shell on UNIX? whether is there any tools to convert XLS to CSV?
4
votes
4answers
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: ...
0
votes
1answer
5 views

(Linux) How to launch instance of an already running application in blocking mode?

For explaining I use Firefox, but it also happens with other applications, here's the script: $ cat ff.sh #!/bin/sh firefox http://superuser.com/ echo "$?" Let's say Firefox is closed, when I run $...
4
votes
1answer
1k views

How to use regex quantifiers to rename multiple files with zmv?

I have the following files in a single directory: 1-1 - different text for each file here.txt 1-2 - different text for each file here.txt . . 1-9 - different text for each file here.txt 1-10 - ...
0
votes
1answer
23 views

Prepend file names in shell

I have 100 .png files in a folder say test.png, example.png, etc. I want to prepend them with New_ so that it will be renamed as New_test.png, New_example.png etc. How can I do it in shell.
31
votes
7answers
24k views

zsh with Cygwin

How can I configure zsh to be the default shell under Cygwin?
9
votes
3answers
3k views

How to change the default shell in Cygwin?

I am trying to change my default shell from bash to zsh in cygwin. The normal unix command chsh isn't available on cygwin The etc/passwd file it seems isn't used anymore in existing versions of ...
2
votes
2answers
617 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
3answers
5 views

Shell command to calculate certain % of disk size

I am writing shell script to calculate 15% of total disk size of user's home directory. I have this command which gets me(somewhat) what I want but not sure if there is better way of doing this. df -...
234
votes
27answers
131k 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 ...
4
votes
4answers
3k views

How do I `cd` and then* `ls` automatically in linux?

I have found myself keep doing cd some_dir quickly followed by ls for quite some time now, and have been trying to write a bash alias to let me do this, such as: alas cd="cd $@; ls"; Problem with ...
1
vote
1answer
31 views

Linux Shell script to change grep for a string, then comment out 2 lines above and 1 below the string found in the file

Looking for some help on this task. I have tried several shell scripts to do this, but not sure I am approaching this problem right. I have a file that contains several blocks of data like this: ...
-2
votes
0answers
18 views

take a word of a list and search for comparison in other lists

I am trying to make this as simple as possible with Linux commands/script without much programming, but if it is not possible, just let me know. I have a document with lots of words (in each line a ...
-1
votes
1answer
11 views

Apply the “expand” command to a file in-place like sed -i

The expand command does not have the equivalent of sed -i <file> expand actually does have a -i option - but it means only after blanks Is there a sed - expand dynamic duo combination ...
0
votes
2answers
469 views

How to customize the eshell prompt?

How can I customize the prompt of eshell? Specifically how can I prevent it from showing the full current path?
0
votes
1answer
22 views

Add character before a very large file to send to a shell script

I am trying to run a shell script on a 31,65 Go json file. ./oetl.sh database.json I need to have brackets before and after the file. What I have in database.json : {..},{..},.. What I want : ...
0
votes
0answers
15 views

Disable zsh prezto “completion” module autocorrect

I'm using prezto with zsh and its "completion" module has some autocorrect stuff which I don't want. I just want the autocomplete and menu highlights, but no autocorrection (which is dangerous and ...
14
votes
2answers
14k views

How to calculate a relative path from two absolute paths in Linux shell?

We have two paths. First one is directory, second either a directory or a file. /a/b/c and /a/d/e.txt Relative path from first path to second will be: ../../d/e.txt How to calculate that in Linux ...
-1
votes
1answer
21 views

How to write shell script to mount a sd card into a folder?

I need to write a shell script which should run on startup. In this script my aim is to mount my sdc dev into a folder . Normally if run mount /dev/ /foldername on terminal it will mount How can I ...
-3
votes
0answers
17 views

AIX version 7100-03-05-1524 -need shell script version of perl code

We are using AIX version 7100-03-05-1524 Please provide shell script version (bash or ksh) of below perl code,since we need to have line breaks in huge XML files #!/usr/bin/perl # # Purpose: Read an ...
1
vote
1answer
29 views

LibreOffice OS X: converting a .odt to .pdf from terminal?

Using LibreOffice, I can open an ODT document and export it as PDF manually. Is there also a command line do to this from the shell?
0
votes
1answer
4k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
1
vote
1answer
14 views

Change user in shell function?

I would like to change the user within a shell function. I guess its not possible to change the user in such a enclosed function, but is there another way to achieve something like that?: myFunction()...
1
vote
3answers
112 views

Good way to bookmark/navigate relative directory paths?

I work on a linux system with bash 4.x where I frequently find myself navigating different copies of very deep (and large) file directory structures. However, in reality I only need to access a ...
5
votes
2answers
4k views

UTF-8 locale portability (and ssh)

I spend a lot of my time sshed into various machines, all of which are different (some are embedded, some run Linux, some run BSD, &c.). On my own local machines, however, i use OS X, which of ...
1
vote
0answers
22 views

What is the difference between ulimit -r and -e?

What is the real-time scheduling priority mean (ulimit -e) ,and how to use it ? -r The maximum real-time scheduling priority -e The maximum scheduling priority ("nice")
0
votes
0answers
17 views

Why there is inconsistence of a shell command in the same shell

Like sed, there are shell command (or should I say it script language?) which don't behave in the same way in the same shell. Behavior of them seems to be different depending on OS (BSD or GNU) not on ...
7
votes
2answers
11k views

Feeding contents of a text file as command to telnet

With the command telnet docs.python.org 80, I can do a manual HTTP request to http://docs.python.org/2/license.html, by typing the actual request. Now, instead of typing it in live, I'd like to feed ...
0
votes
1answer
17 views

In Windows 8, where to manage shell context menu commands associated with file types?

Maybe this is a duplicate, but I cannot guess the correct teminology to find answer if it was posted already. Where in Windows 8 can I open the user inteface to add/edit/remove shell context menu ...
4
votes
3answers
56 views

How to create linux user with only and only READ permission not EXECUTE and WRITE permission?

I have created user, e.g. ronly, now I want to give them read only access to few directories on other user home like abc/,xyz/,pqr/ so I put this ronly user in others means not created any group for ...
3
votes
2answers
35 views

How to check every directory size using one shell command?

I want to get database sizes for - test, mysql, performance_schema, sakila, information_schema [root@linux data]# ls -ltrh 总用量 32M drwx------ 2 mysql root 4.0K 4月 27 17:44 test drwx------ 2 ...
-4
votes
2answers
3k views

“rm -rf /” VS. “mv -r / /dev/null”

Might be a stupid question, but what would be the worst for your system ? (I think both) But to my opinion mv would be the fastest to "delete" it all. Am I wrong ? (don't wana test aniway ^^ )
5
votes
6answers
23k views

Running scripts from another directory

Quite often, the script I want to execute is not located in my current working directory and I don't really want to leave it. Is it a good practice to run scripts (BASH, Perl etc.) from another ...
1
vote
8answers
11k views

How can I move files from Windows to Linux using WinSCP?

I have PuTTY and WinSCP, but WinSCP doesn't work in this case because I need to use a command cd ../public in order to enter the directory as I can't find it for some reason. How would I use PuTTY or ...
-1
votes
0answers
27 views

Can I wrote an script for Receive an sms and does something on linux os like ssh or restart the system?

I'm trying to write a script that when Receive an sms ,does some actions like ssh to other server or kill some processes ,... . it isn't important that it be shell script or php script .
8
votes
3answers
27k views

Disable color in shell/terminal

I want to disable all color in my shell. Not ls, not nano, not vi, nothing. What's the best way to achieve this?