A shell is software that lets users interact with the operating system, usually by typing at a command-line.
0
votes
1answer
22 views
Can you switch into Single User Mode Without Rebooting?
Is it possible to switch into single user mode WITHOUT rebooting and holding CMD+S.
For example, can I write a shell script to switch into single user mode?
0
votes
0answers
8 views
ImageMagick Script Error: ': No such file or directory @ error/blob.c/OpenBlob/2644
I am trying to run the following script in terminal:
mogrify -resize 900x10000 *.JPG
mogrify -resize 900x10000 *.jpg
for f in *.JPG
do
echo "<tr><td><img ...
0
votes
0answers
12 views
JScript.NET Exec() StdOut hangs, StdErr 2>&1 and redirect to file tricks not working [migrated]
Been doing hours of research on this and i'm thoroughly stuck, I'm looking to get the response from sending a command to cmd from JScript.net server-side on my website. Here's how far i've gotten... ...
54
votes
5answers
2k views
How do perform commands in another folder, without repeating the folder path?
I was wondering if there's any clever way to do copy and move operations, or if there's a command to duplicate a file, without having to do a cd, then mv after, at the same folder.
For example, I ...
0
votes
1answer
42 views
Counting by number of occurrences in first column
I have an input file like this:
ATTACK-RESPONSES id check returned root
BACKDOOR ACKcmdC trojan scan
BACKDOOR hack-a-tack attempt
BACKDOOR WinCrash 1.0 Server Active
ICMP Destination Unreachable ...
1
vote
1answer
4 views
grep fails in upstart script
I have an upstart configuration for a service which needs to check the existance of a process on it's startup. This sounds fairly easy but I'm already trying for 3 hours to get this thing solved and ...
1
vote
1answer
35 views
Manually run “Run” registry entries on windows
I am developing an appliance for a company. I have to develop a custom "explorer.exe" to be run as the shell. The problem is that the current explorer does some import operations such as processing ...
0
votes
1answer
29 views
How do I copy only one file (the newest one) from a directory using a shell script on Mac OS X?
I'm looking to periodically run a script which copies only the most recently edited file over from one directory, over to another one. How do I do this with a shell script on OSX?
0
votes
1answer
51 views
rm the current directory you are in and issues surrounding it
If I cd to a directory, is there a quick way to delete the directory I am in and move to the top directory? Usually I cd to a directory, ls it and then cd .. then delete the folder. I want to be able ...
0
votes
1answer
18 views
ZSH, colourify & autocompletion
I have zsh with oh-my-zsh, I added an alias to color the make output using
alias make="colourify make"
but when I use it, make autocompletion does not work anymore. If I use unalias make, the make ...
-1
votes
3answers
80 views
How to paste multiple Bash commands into a shell without losing some?
It's nice to copy-paste a series of Bash commands that you find on a website. But depending on the commands, sometimes you lose a few. Maybe they get swallowed up by programs that read from standard ...
0
votes
2answers
25 views
Windows shell integration command is not working, possible syntax error
I want to create a shell extension to run shiny apps in a local process on a Windows 7 Professional 64 bit. I need a command like R -e "shiny::runApp('~/shinyapp')" as defined in the shiny tutorial ...
0
votes
2answers
28 views
Computing average on a list of values for each value
I have a huge file (50k lines) with the following format:
52370581 2116
17996781 4314
47818829 2584
61421045 2158
...
25145813 2274
The first value can be present multiple times and I want to ...
1
vote
2answers
41 views
Unix moving/removing files from subdirectories
if there are several subdirectories in the current working directory, i would like to move only specific filetypes or possibly all the contents of those directories, to the working directory. and ...
0
votes
1answer
42 views
What does the default /etc/profile on Mac OS X 10.8 look like?
Some idiot altered my /etc/profile file, and I want to revert it to the system default, because I have now realized that I would rather override whatever needs to be overriden using files in my home ...
2
votes
1answer
50 views
How can you reverse the direction of alt-period in Bash?
In Bash, you can press Alt-. to insert the last argument of the previous command. If you press it multiple times, it cycles through the last arguments of all of the commands in your history. However, ...
1
vote
1answer
51 views
Flushing a named pipe
I am using the following to redirect output from my script to both terminal and log file while appending date to every line that goes to the log file:
NPIPE=/tmp/$$_$RANDOM.tmp
mknod $NPIPE p
tee ...
3
votes
1answer
50 views
Parse multiple HTML to text and rename as parent Directory
In a directory there are many folders .html inside, I would like all HTML parsed as new .txt with the name of the parent directory.
Example1/
Index.html>Example1.txt
Example2/
...
0
votes
2answers
12 views
How to execute a chained set of linux commands from python
Following is an example of a shell command I'd like to execute verbatim. Any way to do this in python (i.e. similar to the %x{command} construct in ruby that will take anything you give it..
kill -9 ...
1
vote
1answer
39 views
How do I remove files from parent directory?
I am trying to remove the files inside many folders
For example:
I am in project folder and I want to remove file with range of junk-5.jpg to junk-10.jpg.
junk-5 and junk-10 are within different ...
0
votes
2answers
36 views
Issue with find: invalid predicate '-delete'
I try to run (unix-shell, win7):
find . -maxdepth 1 -name "*.jpg" -size -50k -delete
and get the error:
find: invalid predicate '-delete'
any hints?
0
votes
0answers
15 views
How to Create One Installation Package from Multiple Debian Packages?
I have multiple Debian packages required to install Wine and Winetricks. I'd like to create a new package that will enable a user to click only once or twice (double click) and start a shell script ...
0
votes
1answer
25 views
Executable not found although in PATH
My $PATH is set to a lot of directories including ~/bin and ~/target/bin
I want to execute script.sh which is in ~/target/bin but I get the error bash: ~/bin/script.sh: No such file or directory
...
-5
votes
3answers
72 views
Shell script that reads a file and executes a command
I want to write a script which reads a file and executes a command for each row in the file. This command contains a variable for which we need to pass each row in the file.
File has only one column ...
0
votes
1answer
23 views
Invoke zsh, then *source* another file (while entering interactive mode)
This question is of course related, but different to the one about executing a command.
That questions’ solutions involve either starting a subshell – which isn’t possible due to the requirement of ...
3
votes
2answers
36 views
Wait until SSH succeeds creating a port forwarding
I am calling ssh (OpenSSH) from a OSX/Linux-C++-Application via fork/exec to create a dynamic port forwarding. This is done using batch mode (-o BatchMode=yes) and a private key which is supplied to ...
2
votes
2answers
51 views
How do I make “find” exclude the folder it searches in?
I'm running the following command:
find /var/www/html/content/processing -type d -mtime +1 -exec rm -rf {} \;
I would like to delete all the folders under the processing folder (the processing ...
0
votes
0answers
15 views
Can not delete folder with svn control files created by other user
this problem happened on a SunOS
I (not root user) want to delete a folder "def"(contains sub folder and files) created by other user, I have the full control of "def"'s parent folder(say "abc"), but ...
0
votes
2answers
50 views
Debian - bash is default shell, but “man sh” gives dash
On Debian stable. Running ps -p $$ shows bash is my current shell, ls -l $(which sh) shows sh is a symlink to bash. So why, when I run man sh, do I get the man page for dash? Is this just a bug in ...
0
votes
2answers
38 views
Find recursively a directory and remove it
I have a directory db-cache-db and there are a bunch of them under /home/{USER}/public_html. I know there is a way to write a script to that but I am not sure where or how to start.
I tried the ...
1
vote
0answers
21 views
Dummies guide to mailutils
As a prelude to learning more about postfix and dovecot (as a pure hobbyist) I'm trying to understand the mailutils package. I'm using Davmail so I have the server set up at localhost and my ...
0
votes
1answer
29 views
list (not connected) shared drives on mac via shell
On my mac I have shared location to my NAS, I see it in the finder.
On the shell, if I enter ls /Volumes I only get my hard disk listed but not the NAS, I need to navigate to a folder on my NAS (using ...
1
vote
1answer
37 views
Log in with different shell when original shell is “broken”
I managed to do something catastrophically stupid and below rookie level.
Clean install on my FreeBSD VPS, then upgraded to version 9.1 (from 9). For some unusual reason, rather than installing ...
0
votes
3answers
33 views
How to tar/zip a parent directory exculding a child direcory
I want tar a direcory which contains a number of child directories. But here my requirement is to tar the entire parent direcory excuding one child directory.
Is there any command or procedure for ...
0
votes
1answer
28 views
How to grep file with prefix pattern?
How can I grep for lines of a file wich start with a certain string?
For example, all lines with prefex 0x, where the file has the lines
0x002
0x003
abc
Output should be
0x002
0x003
10
votes
2answers
128 views
How to move folder in unix using mv, only when target is on the same drive
I need to move a folder using unix mv command, but only if the target is in the same drive or the same filesystem. What would be the best approach?
1
vote
0answers
22 views
Netstat doesn't work on FreeBSD by php function exec()
In my php-app I need list of all ip connected on 80 port.
i've chose this way:
<?php
$ips = exec("netstat -an |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c", $info);
...
1
vote
2answers
19 views
^S in terminal does not get sent to Vim
I'd like to overload both Ctrl+S and Cmd+S to save a file if I happen to be editing something in Vim.
After some head-scratching I think I've discovered that ^S in a terminal is perhaps being caught ...
0
votes
0answers
17 views
autologin to root user with .cshrc
How do we cause login cshell to automatically execute sudo su - when a user first ssh into the linux box from Windows putty ?
We tried putting this line sudo su - in .cshrc file but it is never ...
1
vote
1answer
33 views
one sudo for multiple terminals
Sudo root permissions are given for specific time, but only for one terminal. If I want to use sudo in another terminal in that time period, I have to type password again. How to force sudo to works ...
1
vote
1answer
41 views
Is it possible to kill a loop in bash without killing the instance of bash running the loop?
Suppose I execute (in an interactive bash shell) a loop that spawns a bunch of processes in sequence, such as the following.
for i in `seq 15 42`; do if [ -f F$i.flv.mp3 ]; then play F$i.flv.mp3; fi; ...
-1
votes
2answers
67 views
Extract IP addresses in each line of file in shell
I have this input file in ubuntu:
146.14.142.96.17747 197.102.40.184.13748:
146.14.142.96.17747 197.102.40.184.13749:
146.14.142.96.17747 197.102.40.184.13750:
146.114.142.96.17747 ...
0
votes
0answers
20 views
how to avoid this tesseract error! Cancelled repeat of length 0 due to Joined
Cancelled repeat of length 0 due to Joined
I am feeding thousands of jpg files into tesseract and for most of them it works fine, but sometimes tesseract gives the above error, and terminates my ...
0
votes
0answers
11 views
How can I use bindkey and zle in zsh to change a control key plus numbers to a variable string?
I use a set of shell scripts called SCM Breeze to give me an enhanced git status. It marks files in my git status with numbers that are set to variables, i.e. $e1, $e2, and $e3 can be used to ...
1
vote
1answer
59 views
How to log bash command with its output?
I want the actual command line be logged together with its output.
I routinely execute important commands like this:
PERL5LIB=${PERL5LIB}:/something/extra my-command.pl many arguments which I want ...
3
votes
2answers
71 views
How can I easily see the man page for builtin shell commands?
If I see a command in a script that I don't know and I type (for example) man pushd or man umask I see the man page for builtin commands. I know that I can do man bash and scroll to find the help for ...
3
votes
4answers
141 views
Why do I need a “./” before executing some scripts? [duplicate]
For instance, I have installed java and can just run java ... but if I create a shell script for instance, I have to run ./script.sh.
Why is this? What does the ./ signify?
0
votes
4answers
82 views
Regular expression to find senders IP using grep or other languages
I have input file that contains:
19:04:01.631948 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 48)
181.173.82.61.1985 > 250.66.33.195.1985: HSRPv0-hello 20: ...
0
votes
1answer
42 views
gVim does not source .bashrc, .bash_profile, or .profile from non-interactive non-login shell
I have the following on my .vimrc
set shell=C:/cygwin/bin/bash
set shellcmdflag=-c
set shellxquote=\"
So the shell I am using is non-interactive and non-login.
I thought that non-login shells ...
0
votes
0answers
19 views
Loop through folder with higher space usage in shell? [duplicate]
I would like to create an script where give me a report of which folders have the higher usage space and keep doing that until there's no folder anymore.
Today I do this manually, with:
sudo du -h ...



