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
296 views

copy a file with scp, which is not stored on a filesystem

I need to copy a .war file, which i currently just can reach over the UI with "http://server:host/directory/my_file.war". So its not stored on a fileserver. Im logged on a server A and the file needs ...
0
votes
2answers
445 views

rename multiple file add number to name using batch

I have files in folder named unix_aaa.txt unix_bbb.txt unix_ccc.txt and so on. How do I change all the files that start with unix to names like 001_unix_aaa.txt 002_unix_bbb.txt 003_unix_ccc.txt ...
-1
votes
1answer
43 views

Would shell command join cause out of memory?

I have two file to join. FILE 1: a A1 a A2 a A3 ... c C1 c C2 ... FILE 2: a feature1_of_a a feature2_of_a ... a featureN_of_a ... ... c feature1_of_c c feature2_of_c ... after join, i ...
3
votes
2answers
3k views

How to add commands of windows to local shell of XShell 4

XShell is a very powerful tools to ssh remote computers such as Unix/Linux. And it has built some internal commands for you to run within your Windows. Xshell:\> help Internal Commands: new: ...
2
votes
2answers
190 views

How to delete all folders that have the same name as their parent folder?

Somehow I got a copy of every folder inside itself. What is the shell command I could run to delete all folders that are inside folders of the same name? For example in the above, running the ...
0
votes
3answers
54 views

Perform shell operation through secure shell

Is it possible to perform a shell operation from a bash script through a secure shell. Here is an example of why you may want to do this. Lets say you have a simple unix operating system that you ...
1
vote
4answers
2k views

Get a script to run at startup (linux)

I am trying to get a simple script to run automatically at startup. A friend told me to do this but it did not work. Could someone take a look to see what it is missing? *(Also I am brand new to ...
1
vote
1answer
228 views

Pass filename to shell script

On Windows, I can drag and drop a file to a batch file to pass the filename. On Ubuntu 12.10, I can't drag and drop to an .sh file. Opening terminal and running ./sh-file-name.sh file-name.txt ...
0
votes
0answers
363 views

Automation script to SCP from UNIX to Window Server

I'm new to server/Unix trying to transfer file between AIX to Windows I'm trying to create SCP or SFTP script that will run on cron and transfer text file on /usr/apps/11.111.1.11.log file to window ...
2
votes
1answer
113 views

unix move cursor after last character

After I use my arrow key to move my cursor left, I am unable to move it back to the end of the line. For instance: If I type: $ echo hello wordl_ Then if I move the cursor left to fix typo $ ...
1
vote
2answers
372 views

How to disconnect a running bash job from the shell in Linux?

I have a script that starts a server on a remote VM. All works great until I close the shell where I executed the script. When the shell closes, so does the server. After some looking around I found ...
0
votes
1answer
229 views

tar -rvf not working

I am trying to append a .txt file to my already created .tar archive file. But the following error is showing up: tar -rvf kits.tar example.txt tar: This does not look like a tar archive ...
1
vote
1answer
110 views

Stream the contents of a text file that is being continuously written to.

So I have a python script which is executed by cron job on a nightly basis to capture data on my data server (Ubuntu 12.04 LTS), this data is being written to a text file. Is there a command to stream ...
2
votes
2answers
785 views

Tool for diffing large files

When I use "diff" to find the difference between two large data files, diff A.txt B.txt > dif.info it is output: diff:memory exhausted or add the argument "-H" diff -H A.txt B.txt > ...
2
votes
1answer
2k views

Horizontally split-screen with two programs?

I have two programs A and B. I want a single command, which will run Program A and Program B in two different terminals but in the same tab, i.e, in a horizontally split terminal. I know screen can do ...
0
votes
1answer
261 views

shell script : rsync exclude

I'm building a shell script and at some point I'm excecuting thie command : rsync -arv --delete --exclude=".svn,*.db,.DS_Store" Source/ Dest/ However it seems the my exclusion doesn't work. Am I ...
1
vote
1answer
262 views

Is there a way to reverse-search zsh history with more than one search term?

I'd like to be able to reverse-search (CTRL+R) on zsh, but have the commands searched using more than one search term. For example, I'd like to search through commands that included both "scp" and ...
1
vote
2answers
440 views

Difference between running commands locally vs using SSH to make remote commands

I am trying to SSH into a remote machine, and run a .ksh file on a that machine to run a Java program. If SSH into the machine with a tool like Putty, and run this command: cd ...
0
votes
2answers
181 views

How to start a local server and open it in a browser from a shell script

I have a test suite which runs in a browser (using QUnit, though that's unimportant). The test suite requires a local server running on a particular port. Running the tests currently involves a few ...
3
votes
2answers
2k 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 ...
0
votes
0answers
97 views

Running different programs via ssh

I got some problem when I tried to run different programs via SSH. The problem is, let's say I have 2 different java programs, then I would like to run them simultaneously on different JVM, in order ...
1
vote
1answer
479 views

Increase width of command line / cmd.exe? [duplicate]

Possible Duplicate: Widen the Win 7 command prompt window? Any way to change the width of the windows command line / cmd.exe? How about using another "shell", is that possible?
5
votes
1answer
168 views

Explaining the -W flag for rm

What does the -W flag for rm do? According to its man page, the flag attempts to "undelete the named files." And currently, "this option can only be used to recover files covered by whiteouts." What ...
1
vote
1answer
149 views

“Gnome 2.28.2: LCtrl+LShift as a combination to change layout” Issue

I am used to change the layout using keys combination CTRL + SHIFT. Not to mention that lots of applications use that combination as a part of another complex combination. Say - CTRL + SHIFT + TAB in ...
0
votes
1answer
276 views

script to convert GB to TB

I have (multiple) files like below list. Few of them has both the values in TB and couple of files in GB. Now if you clearly see the file output there are two rows with Total capacity and Capacity ...
1
vote
1answer
386 views

How to save environment variable on my Ubuntu Linux system

I am using Maven to the build process of my Java project. To launch the mvn command in any position within the shell I am using the following command to declare the environment variable in this way: ...
2
votes
2answers
165 views

In Vim, what are the differences between using :sus and :sh to access the shell without ending the Vim session?

I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things: Use :sh (a.k.a. :shell), then log out from the shell to return to Vim Use ...
1
vote
2answers
2k views

How come the ls command prints in multiple columns on tty but only one column everywhere else?

Even after using Unix-like OSes for a couple years, this behaviour still baffles me. When I use the ls command in a directory that has lots of files, the output is usually nicely formatted into ...
0
votes
1answer
209 views

Can I run one bash shell script on many machines simultaneously?

I would like to run one bash shell script on two or more machines simultaneously.Can I run one bash shell script on many machines simultaneously? I place this shell script on centos 5.5 and other ...
0
votes
4answers
149 views

how to do grep in the man command of linux using xargs?

I want to grep into a manual of a particular command say man grep |grep 'insensitive'. One of friends told me that It can be done using xargs but I cant seem figure out how. I want to do it using ...
-1
votes
2answers
321 views

how to write a shell script to know other computer in local network

I want to write a Bourne shell script that takes a machine name as an argument and displays a message informing you whether the host is on the local network
3
votes
1answer
598 views

.bashrc function is not working on Cygwin

I recently installed last version of Cygwin. Right now I'm just configuring some alias and functions to use. Cygwin is reading the .bashrc file correctly, because some alias are working, I just have a ...
2
votes
2answers
541 views

Why there is difference between output of linux command du and ls?

I have a file in linux machine whose size is 3404494030 upon doing "ls -l". When I do "ls -lh" it shows 3.2 GB which is correct when converted from bytes to Gigabytes. But when I do "du -h" for the ...
2
votes
2answers
868 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: ...
2
votes
5answers
8k 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 ...
2
votes
2answers
1k views

Setting pipefail for a single piped command

I need to execute a number of piped shell commands from a non-BASH script (namely PHP script) like these: command1 | command2 | command3 so that, if command1 fails with a non-zero exit code, each ...
2
votes
3answers
832 views

execute sub command within xargs

I want to make soft link of all the binary files of folder A to folder B like, find /home/A/bin/* -print | xargs -I {} ln -sf {} /tmp/B/$(basename {}) the problem is that I cant execute sub command ...
0
votes
1answer
327 views

How to zgrep by file pattern and timestamp?

I have a list of several thousand gzip (*.gz) files that I'd like to zgrep through, but I only want to run it on files with a last-modified-timestamp on or after yesterday (11/22/2012) and that ...
4
votes
2answers
5k views

Is Git Shell Windows Power Shell?

I have a simple question. What is Git Shell? IS it the same as Windows Power Shell? Because when I run Git Shell on my Windows 7 machine the Windows Power Shell is opened. Thanks for clarification. ...
4
votes
5answers
302 views

How do I pipe a list of numbers straight from the shell into a command?

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this [1,2,3,4] | sort would give 1 2 3 4 EDIT: In response to the answers kindly posted so ...
1
vote
1answer
329 views

/usr/bin/mail equivalant for | sendmail -t

been searching for few hours, and came to no solution. Is there an equal expression for the bash command myfile | sendmail -t where my information needed for sending mails is stored in the ...
1
vote
1answer
272 views

$HOME environment variable edit

I have a question which might sound quite naive but I would like to confirm the behavior of the $HOME environment variable on the MAC OS X. I would like to know if we can append paths to the $HOME ...
4
votes
2answers
215 views

“set -o vi” how to get the yank in the clipboard

My goal is to yank a line in the shell (for example with yy) into the system clipboard and then paste it somewhere else (for example in the internet browser). How can I accomplish that?
0
votes
3answers
178 views

Ubuntu bash script: the shell is changing without any reason

I'm having a strange behaviour with a shell script on Ubuntu 12.04.1 LTS. My script is scheduled to be launched every hour (in crontab). It uses /bin/bash, but sometimes it switches to /bin/sh ...
-2
votes
1answer
66 views

Need script FOR loop in shell or perl

I am looking for loop condition which would help me to run below commmand. mccli backup show --name=abc.com name=server_name I dont want to run the command everytime with changing server name. ...
0
votes
1answer
105 views

Problems with rsh

I have problems calling a remote command by different users on different machines. This remote command shall be executed on one single machine and the rsh-session shall be terminated immediately after ...
0
votes
1answer
322 views

How to detect flash process in Google Chrome?

I'am using this script -- lightsOn, to delay screensaver when flash playing. However, the script provide only the Chromuim way: flash_process=`pgrep -lfc "chromium-browser --type=plugin ...
3
votes
3answers
2k 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
2k views

why doesn't my .gitconfig work? (for external diff)

I added this in ~/.gitconfig: [diff] external = mvimdiff [difftool] prompt = false and made a 755 /bin/mvimdiff that: #!/bin/sh mvim -d "$2" "$5" in order to invoke MacVim as my git ...
0
votes
1answer
169 views

Home folder missed after “sudo mv -t /usr/local/src ~/”

My home folder is missing after I run this command sudo mv -t /usr/local/src ~/ How can I recover this?