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

Why won't Cygwin run windows apps that interact with the shell/command line?

After a recent update, Cygwin bash shell works for any commands that don't require interaction, but if an app needs interaction (for example the python shell), it won't work, the prompt never appears, ...
1
vote
2answers
164 views

Remove folder structure from archive, ignore folder while archiving and fix error

I am trying to make a script to backup each of my plesk hosts to individual files, I am having two problems: I would like to remove the folder structure from archive, the tar is 3 folders deep I am ...
1
vote
1answer
1k views

How do I install GNU's 'make binary package' to android shell

I need make to install things, based on my current knowledge: I have reached a chicken and egg scenario. I have root access to the filesystem and shell, but the native android shell does not come ...
0
votes
2answers
232 views

Multiple SSH failing to run more than one command

When a use multiple SSH like below i am only able to run one command, if try to run more than one command its fails. This thing is failing: ssh -o UserKnownHostsFile=/dev/null -o ...
0
votes
1answer
35 views

Nano usablely open second file

Is it possible to open second file into Nano text editor not by browsing files in program interface (it's not so usable because you can't do nothing like search etc in it) but in command line or in mc ...
0
votes
2answers
199 views

What does the * mean next to a filename in the ouput of the command ll? [duplicate]

I have a doubt related the output of ll command. When, in my shell, I execute the ll command I obtain this output: -rwxrwxr-x 1 andrea andrea 104215 ott 15 15:56 atmosfs* Why I have the * next to ...
1
vote
3answers
682 views

Take all files in dir and for each file do the same perl procedure

I have dir, where are multiple files. a1, bb2, ccc3 At the moment I manually do: perl myperscitpt.pl a1 a1.txt perl myperscitpt.pl bb2 bb2.txt perl myperscitpt.pl ccc3 ccc3.txt How could I do ...
0
votes
2answers
104 views

linux pipeline/tee process sequence

I think for the linux command, the pipeline: $ command1 | command2 | command3 will execute with sequence command1 -> command2 -> command3. But what about using tee: $ command1 | tee >(command2) ...
1
vote
3answers
3k views

SSH session hangs when trying to open a shell

Since this morning I cannot login normally on my server using SSH anymore. Typically, when typing this: ssh foo@bar.org The shell hangs and does not acquire shell. The last line of verbose with ...
1
vote
1answer
64 views

How to fix.. my watch --interval=60 isn't working properly

Here is the code I use in my CentOS 5 32bit. But after this I see only some of files are zipped and a lot of them isn't included in produced gzip file. nohup watch --interval=60 tar -zcvf ...
1
vote
1answer
225 views

Fast way to send current line to the shell in Vim

Say that the current line in Vim contains: ls /home (or whatever shell command). Thus, what is a fast way to send this line to the (bash) shell and read the results in Vim? And without using ...
18
votes
1answer
3k views

Why do we have login, non-login, interactive, and non-interactive bash shells?

So the bash man pages explain what login and interactive shells are: A login shell is one whose first character of argument zero is a -, or one started with the --login option. An ...
1
vote
0answers
63 views

shell script for finding the unix noun phrase

one entry in the on database is: LPE-1*story#1/1 of pearl#1/2*historia de la perla*storia della perla* histoire de la perle* história da pérola*istoria perlei*TOPIC The fields are separated by ...
0
votes
3answers
305 views

Shell is interpreting IFS=$'\n' as IFS='n'

I am using a Bash shell on a Ubuntu 12.04 LTS server, and it seems that IFS=$'\n' is being treated as IFS='n'. Script in use: concat=$(echo -n "concat:" && find ...
1
vote
1answer
3k views

Adding a month to an input date in unix

I need to write a script that asks user for an input date. Then I need to add a month to that date or at least 30 days. Example: Date: 2009-05-12 I need to get 2009-06-12 this code is not working: ...
1
vote
1answer
147 views

Linux who --process option

I was playing around with who when I noticed that the who -p option does not give any output. Running the command as root also didn't change the output. I tried this on a CentOS, Ubuntu 12.04 and ...
0
votes
1answer
566 views

Ping test for 4 hours

I am trying to perform a ping a test to the servers for 4 hours I tried using ping -t '14400' IP-ADDRESS but i am getting a following error: "ping: ttl 14400 out of range" Is there any other ...
0
votes
1answer
106 views

Terminal auto-complete with @ symbol?

I have multiple directories that include the @ symbol within the directory name. When I do the normal tab to auto-complete a directory name it chokes if there is an @ symbol included in the name; ...
1
vote
2answers
88 views

ffmpeg resulting bitrate higher than expected. did i miss something?

i am using ffmpeg to create some h264 transport streams. the bitrate for video is 496k, for audio 64k. However when the ( 2-pass ) encoding is done, i get a stream with more then 600k. i am using the ...
1
vote
0answers
137 views

Record the sound of a program to the microphone

I want to record the sound of a program and to direct it as an microphone entry on linux. For instance, I'm listening a music on youtube, and I want that music to be send to my skype's conversation ...
1
vote
2answers
67 views

How to save linux command?

I am using grep -r [^a-zA-Z0-9]myVariableName[^a-zA-Z0-9] -n JS_files/ as mygrep file grep -r [^a-zA-Z0-9]$1[^a-zA-Z0-9] -n JS_files/ and then sh mygrep myVariableName But then I lose the ...
5
votes
1answer
418 views

How can I delete a just-typed newline character in bash?

I sometimes copy-paste paths into the terminal, and often accidentally copy the newline character. For example, I want to find then read the contents of foobar.txt. $ locate foobar.txt ...
2
votes
1answer
137 views

Is it safe to delete empty directories recursively on Linux?

Using the find command, it is easy to recursively delete all empty directories. Which empty directories are safe to delete, and which ones are not?
0
votes
1answer
247 views

How to prevent users from renaming files while providing write permissions on Linux

For some special purpose, I want to prevent non-root users of the Linux Server from changing the filenames. However, they can modify and write to the contents of the file. How to do this from command ...
2
votes
2answers
846 views

Cannot delete hidden file on network drive using DOS / batch script

I am trying to delete a file from a mapped network drive, I: In my batch script, I have: del /f I:\bin\.hiddenfile When I run the script, I go to the directory I:\bin and see that .hiddenfile is ...
3
votes
2answers
207 views

How can I get emacs 24.* under windows to autocomplete paths in shell buffers using “\” instead of “/”?

See How can I get emacs under windows to autocomplete paths in shell buffers using "\" instead of "/"? I use emacs on windows 7, when calling M-x shell, emacs opens a DOS-Shell. ...
0
votes
2answers
156 views

Instructions embedded in Bash script?

Is there a way to make a bash script require a set of parameters when it's loaded, and if not, it will automatically spit out an echo to the screen giving instructions? Looking at this example of a ...
0
votes
1answer
119 views

bash tab completion is showing commands instead of files and folders

I used chmod to make some scripts executable, and now my bash shell is tab-autocompleting all available commands. How can I make it go back to completing just files / folders in the current folder?
0
votes
2answers
5k views

Exit sudo in the middle of a shell script

I have a shell script in which most of the commands need to be run under sudo; however, the last few commands need to be run as the current user. Is there a way I can exit sudo and switch to the ...
2
votes
1answer
509 views

How to get a shell prompt in NX?

I have installed nxserver on a ubuntu machine and am able to connect to this machine via the free NX client on a windows machine. Things seem to be working fine except that the xterm has a weird NX ...
1
vote
1answer
53 views

What's the difference between 'chsh -s' and 'export SHELL'?

I think that the export command is only active per login session, but I'm not sure. chsh I think is more permanent. Can someone clear this up for me (preferably with links/docs)? Thanks.
1
vote
0answers
2k views

How do I fix an “Invalid license data. Reinstall is required.” error in Visual Shell Express (Isolated) 2010?

So I have recently instealled Visual Shell Express (Isolated) 2010 in Windows 7. The problem is, every time I open it, it says, Invalid License Data. Reinstall Required. I saw this: How do I fix an ...
2
votes
2answers
1k views

Auditd - auditctl rule to monitor dir only (not all sub dir and files etc..)

I am trying to use auditd to monitor changes to a directory. The problem is that when I setup a rule, it monitors the directory I specified, but also all the subdirectories and files underneath it, ...
4
votes
2answers
617 views

Is setting a mail user's shell to /usr/bin/passwd in the /etc/passwd file a safe way to allow them to change their own password by simply ssh'ing?

I have a machine which is used mostly as a mail server: $ uname -a Linux myhost.com 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux and I would ...
1
vote
1answer
30 views

Register a file specified by open

So I have this small bundle with applescript made, and it even seems to work as it should. However, it appearently doesnt open my files when it is asked to via the open utility. It works though when I ...
0
votes
1answer
155 views

How do you determine if you're on a linux or BSD system inside a script?

I've got a rather extensive selection of dotfiles thats been kept in a git repo for the longest time - I just maintain a separate branch of code for bsd-isms (for instance, on Linux, to get colored ls ...
0
votes
1answer
94 views

Can't remove a directory

I'm trying this: rm -fr /app/foo But getting error message: rm: cannot remove `/app/foo': Is a directory What I'm doing wrong?
0
votes
2answers
258 views

Syntax Error 'Cat' Unexpected

I wrote this script for copying XML files I received to a spot on my sdcard. However when I run it in terminal i get the following. Can someone explain if i did something wrong or whats going on? cd ...
2
votes
1answer
241 views

How to get a bash prompt in a ssh tunnel with rsa keys?

After setting client and server with the public keys and allowing PubKeyAuthentication yes, I issue the following command and get a shell that waits indefinitely. mad@amd:~> ssh -T ...
14
votes
5answers
15k views

Is there a way to edit files inside of a zip file without explicitly extracting them first?

I sometimes need to make changes to a .zip or .jar file, so I usually move the file to /tmp, extract all the files with unzip, edit a few files, and then re-zip up the files. This works, but it can ...
1
vote
0answers
271 views

Mac: Run screen command from launchctl

I have a Python script that I would like to run on a Mac at system start up in a detached screen session. The Python File (foo.py): import time import datetime while True: print 'hello', ...
3
votes
2answers
414 views

restrict rsync (or bash script) to a directory

After a bad accident with rsync deleting wrong files due to wrong destination parameter, I want to restrict rsync (or the bash script running it) to be able to delete/modify files only under a certain ...
1
vote
1answer
612 views

FreeBSD csh style history auto completion in bash

I am looking for a way to make it so that my ubuntu bash shell has the same kind of history completion as you get with csh in FreeBSD. The behavior is that on the command line if i start to type ...
3
votes
3answers
507 views

Xterm control sequence to get RGB value for ANSI color

The meat In (some) terminals you can use a sequence like this; printf "\e]4;3;rgb:cc/78/33\e\\" to set the third color in the ANSI color palette to the RGB values represented by #CC7833. Can you ...
0
votes
1answer
242 views

Stopping command from terminal without stopping shell script that started that command

I have a script like this: #!/var/bin/bash tail -f /path/to/file.txt tail -f /path/to/other/file ... ` How can I stop tail -f without stopping whole script? Any idea?
1
vote
2answers
383 views

Stdout and stderror in CentOS

I am exec command: yum info mcrypt | grep -i error > /dev/null yum info mcrypt | grep -i error 2> /dev/null But i see: Error: No matching Packages to list How I can hide this messasge ...
2
votes
1answer
304 views

Using the same file as stdin and stdout results in empty file

If want to filter a file but if I use the same file as input and output the output file is empty. Is there another solution instead of using a second file? php -r "echo preg_replace('~/\* DEV ...
4
votes
2answers
464 views

Linux command line / Move files filtered by lexicographic order

I have some files in a directory that are named IMG_0001.jpg ... IMG_9999.jpg. I want to move to another directory the files that lexicographically have a name greater than IMG_9431.jpg How can I do ...
1
vote
2answers
109 views

Forked Processes and Shared variables

I have a bash script with two forked functions all writing to a log. When both have finished, I'd like to delete this log. The problem I'm having though, is that processFinishCount is never greater ...
1
vote
0answers
245 views

“Script” command in Bash on Mac OSX

quick question regarding the "script" command in Bash on a Mac OSX 10.8.4 system. In any other bash environment on Fedora, CentOS, etc; when I use the script command it just begins recording with no ...