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
3answers
226 views

Script for Running Program from Command Line

I am new to Linux so please excuse my ignorance: On my current work machine if I type: $ matlab ...the machine is configured so that matlab is executed. I want to do the same thing for ImageJ ...
5
votes
2answers
1k views

Remove all “deleted” files in Git

Is there a better solution for removing manually-removed files from the Git repository than my current error-prone command? git status | grep deleted: | cut -d: -f2 | xargs git rm
2
votes
2answers
7k views

How to access a shared drive from the command prompt on OS X

I have a shared drive called "music". It shows up in Finder without problems. How do I access this from the command prompt on a Mac? I can't find it anywhere – is there a way to access it?
3
votes
1answer
2k views

accessing the mapped network drives using mingw shell

How to access the mapped network drives from the mingw shell? When I try cd y: or cd /y or y: All I get is No such file or directory or sh.exe y:: command not found. I am able to access the same ...
0
votes
3answers
8k views

Zipping files greater than 2GB in bash shell

I ve been trying to zip all the files in partcular directory into a single zip file and then transfer it to destination server. command i ve used is like zip -j $Zipfilename * the problem is ...
0
votes
1answer
527 views

How to find all files recursively except those in a certain directory

How can I find all files in a directory recursively, except those in the .git directory? I tried the folowing: find . \! -name ".*" but that didn't work.
2
votes
2answers
129 views

Why is a shut down performed faster when initiated from the command line?

Whenever i use a command like shutdown -s -f -t 00 I can see that the shutdown occurs faster than when I go and click the shutdown button in the Windows GUI. This scenario can be compared with my ...
1
vote
2answers
270 views

Continually compressing a stderr stream

Is there some way to continually compress the output of a program (in almost realtime)? For example I have this program that produces (a lot of) output to stderr. I want to do something like ...
2
votes
1answer
589 views

Bash alias history substitution similar to \!* in csh

My question is very similar to that of this old post. I would like to do something similar: place in an alias the last argument(s) typed on the current command line. This would be equivalent to the ...
0
votes
1answer
453 views

personal .txt archive; utf-8 or utf-16?; need chinese and scandinavian characters; performance irrelevant

So I use plain text for pretty much all information I keep. The files are (or will be) used with shell scripts, emacs, vim, terminal etc. on OSX and Linux. It would be ideal to be able to use English, ...
2
votes
2answers
1k views

Remove directories from a file with list of directories

I have a list of directories in a text file and each of them need to be deleted. How can I read in that list into the command (rm -r or rmdir)?
3
votes
4answers
480 views

Command-T for shell

I'm looking for a shell extension that allows me to do filename completion similarly to Command-T. Command-T a feature in TextMate and a plugin for Vim that allows you to select filenames by typing ...
3
votes
1answer
4k views

ssh ForceCommand vs. ProxyCommand

I need to have a group of users hop through a server ('bastion') into another machine ('dest') via ssh to commit code. Seems like my options are: tell users to use ProxyCommand in their .ssh/config ...
0
votes
1answer
726 views

How to insert thousand separator with `sed`?

I want to insert thousand separator into a number sequence with sed and this ugly RE sed -e :a -e 's/\(.*[0-9]\)\(\([0-9]\{3\}\)\(,[0-9]\{3\}\)*\(\.[0-9]*\)\)/\1,\2/;ta' [filename]. Is there a more ...
0
votes
1answer
40 views

How can you use the domain of the client connected over ssh in the shell?

Is it possible to get the users ip address, domain name, or host-name of an established ssh connection in the shell? For example, when I connect over ssh the first printed line says something like ...
0
votes
1answer
790 views

How could I get the second line of grep's output as the input paramemeter to vim?

$ grep -l -R "myEditor_Init" * Public/Js/eWebEditor/dialog/ewebeditor.htm Public/Js/eWebEditor/ewebeditor.htm Public/Js/eWebEditor/js/ewebeditor.js For example, I would like to grep and vim the ...
0
votes
2answers
12k views

how to fix Permission denied on directory in unix?

I have a ksh file which will download a zip file from the internet in the /tmp directory with name f.zip Why do I get Permission denied? $ ./downloadbcfi Current name is ...
12
votes
5answers
2k views

Which directory does path `//` represent in Linux?

When I want to go back to upper level directory in Linux by typing cd .., I typo-ed cd //. To my great surprise, no errors are reported. What's more the prompt becomes username@hostname://$. ls ...
1
vote
1answer
207 views

Pipe and watch piped output?

I want to make a shell-pipe like this: producer | analyser > report.txt and watch the output of producer while it is generating data (a big log-file) for analysis. How can I do that?
2
votes
2answers
231 views

Basic command line tutorials for Windows and *NIX

I am writing "how-to"s for Plone CMS. Often "how-to"s begin with: you need to know the basics of command line use.. Are there any really basic tutorials for: Windows command line (cd, dir, ...
0
votes
3answers
494 views

Oneliner for multiline regex s/,\n]/]/g?

Can someone provide a simple one-liner to remove certain line breaks? In vim I use %s/,\n]/]/g This should be possible with a very simple one-liner IMHO, but how?
1
vote
1answer
842 views

Use user-installed shell? [duplicate]

How do I change my shell to one installed in my home directory? I installed a new zsh in my home directory, which is picked up: >> which zsh >> /home/myname/bin/zsh It's not listed in ...
0
votes
2answers
5k views

change default shell from zsh to bash

I'm trying to change my default shell in RHEL5 from zsh to bash. I tried to the methods mentioned in this thead. By typing sudo /usr/bin/chsh -s /bin/bash, the system says sudo: /usr/bin/chsh: ...
0
votes
2answers
490 views

Is it possible to add an exception with a “ls -l *”

Is it possible to do for exemple: ls -l * which print the content of all a directory. And add an exception, for exemple, test.cpp In order to print all files except the test.cpp.
2
votes
1answer
4k views

Convert ppt to jpg

I am using an Ubuntu system. I want to convert ppt or pptx to jpg using terminal commands. I have libreOffice and ImageMagick installed in my system. I am successfully converting pdf to jpgs using ...
0
votes
1answer
394 views

Generate xml file from city list

I have a city.txt file with over 1000 lines (one city name per line) , and also a format.xml file with this code block: <ss:Row ss:Height ="22"> <ss:Cell> ...
2
votes
2answers
194 views

How different shell scripts map to different OSes

New to Linux and have a few questions about shell scripting: shell C shell Bash shell Bourne shell korn shell So many "shells"! With respective to these, how do I tell which interpreters my Linux ...
2
votes
3answers
836 views

Grep fail to ouptut to a pipe?

I'm having problems with grep filtering of make output. In particular, make target 2>&1 | grep -E --color=never "^make.*" works as expected, but the following will print no output to the ...
1
vote
0answers
36 views

Windows 7 - right click menu commands for file types [duplicate]

Possible Duplicate: What program do you use to edit file associations in Vista and Windows 7? it was fairly easy to setup addition right click commands in windows XP. for example you ...
0
votes
4answers
1k views

Can I create a configuration file for a shell script?

Is it possible to create a .sh shell or .command file with a configuration file? I need to backup websites via Terminal and be able to put some data to configuration files, and have the shell execute ...
5
votes
3answers
3k views

How to “undo” unzip command?

I used "unzip XXX.zip" to extract a zip file, unfortunaly, i make a mistake. Now i want to delete all the file and directorys generated by "unzip". How can I undo it?
8
votes
1answer
244 views

Is there a way of using ctrl-r after typing part of command in bash?

In bash the Ctrl+r command is very useful, I type Ctrl+r whatever and it searchs my history for commands containing the word whatever. But if I type whatever and realize that I would like search that ...
0
votes
1answer
74 views

Clear a line in the terminal

I sometimes start writing a command in the terminal (iTerm2) which half-way written I want to erase. How can quickly remove all the characters on the line being worked on in the terminal?
1
vote
1answer
120 views

Windows Shell integration parameters

I'm trying to integrate a shell menu entry for all files (*) to encrypt them using a tool i already have made. I have managed to create the entries but I don't really understand how to send the path ...
1
vote
4answers
236 views

Learning Shell Script, What's Next? [closed]

I've had finished learning "Shell Script" in Linux so I'm now intermediate near advanced level but I can't guess how can I use this scripting language to make things/tiny programs! Just as having the ...
2
votes
2answers
1k views

Show PID of process just launched in ZSH

Can I show the PID of a process that I just launched, ideally at the end of the line of the command? Example: root in ~: mysqld .................. [PID 34567] 12121 mysql-logs start to come in... ...
8
votes
6answers
4k views

Best practices to alias the rm command and make it safer

Some time ago I erroneously deleted my home folder because I ran a rm -rf * on the wrong terminal, whose working directory was the home folder! I wish I had an alias for the rm command, but it was ...
2
votes
1answer
2k views

Add time to an OS X Parental Controls managed account with a shell command

I imagine that there's a simple counter for daily usage, and that this can be modified, but I've been unable to find any documentation on where or how to do this. Does anyone know?
1
vote
3answers
826 views

Syntax Highlighting for MySQL Shells?

Are there any MySQL shells that support syntax highlighting? I know in my.cnf, you can set the shell string with, for example: [mysql] prompt=(\\u@\\h) [\\d]>\\_ But is there any more ...
8
votes
6answers
6k views

unix - split a huge .gz file by line

I'm sure someone has had the below need, what is a quick way of splitting a huge .gz file by line? The underlying text file has 120million rows. I don't have enough disk space to gunzip the entire ...
2
votes
3answers
269 views

How to let shell return to the previous line after exiting a full-screen process like Vim

I connect to Z-Shell on a Red Hat Enterprise Linux 6.2 machine via Putty. After I exit a full-screen process, eg Vim and less, in Unix shell, the shell prompt starts at the last line of the screen. ...
1
vote
2answers
1k views

How to by-pass user interactions in a script?

I am trying to automate the installation of a program through a shell script. There are a few steps which require user interaction from the command line (confirmation, yes/no, etc.). What is the best ...
0
votes
3answers
206 views

What provides autocompletion? Shell or emulator?

I have been using Linux for some time now. Now, I have question about auto-completion of commands and directories in a terminal window. When I press a tab key the terminal auto-completes or gives ...
2
votes
1answer
631 views

How to get ZSH previous command's history number in prompt?

I'm wanting to add the previous command's history number to my prompt, as well as the exit code. At present, %h[%?] Gives me the current history number, as well as the last exit code. What I'd ...
0
votes
1answer
461 views

Sed pattern for multiple lines

I want to remove all create table statements from a mysql script, but the statement runs over multiple lines. Like this: Create table ......NEWLINE... NEWLINE... NEWLINE....; So I tried this ...
0
votes
1answer
305 views

seq with regex, error message for mysql quotes

Is there some tool that auto quotes regex for seq? I can't figure out what I'm doing wrong. I always get this error unterminateds' command` sed -i 's/INSERT INTO `tablename.*`/INSERT INTO ...
1
vote
1answer
415 views

How can I change the shell in Windows 98

How do I change the default Windows shell from explore.exe to my own custom shell in Windows 98?
3
votes
2answers
185 views

hardlinking takes a lot of space

I made an rsync incremental backup script for my server that will copy a MySQL database backup and a specified folder path to a remote server. Here's the code on Github. Code excerpt from lines ...
0
votes
1answer
204 views

How to write a script that does what less does?

Question: Create a script such that it is a command that has the same effect as the "less" command (implement the script by calling "less"). What I wrote: #! /bin/bash for index in "$@" do less ...
1
vote
1answer
3k views

How to get window title in windows from shell

I can set title via windows shell using command title some string but how can I get the title of some process? I tried command tasklist /v, but my title is very, very long, that's why I receive only ...