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
1k views

Execute a command stored in a variable

I have a command stored in a variable. Let's pretend the variable $i has the value: cat -nT index.php |grep 'someregex' When I try to execute the above variable by typing $i it fails because the ...
28
votes
5answers
931 views

Deleting millions of files

I had a dir fill up with millions of gif images. Too many for rm command. I have been trying the find command like this: find . -name "*.gif" -print0 | xargs -0 rm Problem is, it bogs down my ...
0
votes
1answer
74 views

How to create my own vpn service on linux shell?

My company has a private linux server, and I'm just a user of this server, my connection to it is via putty or nc. Is there anyway to install a private VPN on it? our server is connected to the ...
0
votes
2answers
144 views

Loop through a list of urls in a text file

I have a list of URL's that looks like the following: http://www.youtube.com/watch?v=QVgFCCQWBOs http://www.youtube.com/watch?v=8TrMhR7ZpBk http://www.youtube.com/watch?v=8ctAvtBJB3s ...
0
votes
1answer
481 views

Specifying an alternate shell with rsync

I'm using rsync to sync up files between two computers. On one machine, my default shell is set to fish, which breaks rsync ("protocol version mismatch -- is your shell clean?"). Is there a way to ...
2
votes
2answers
98 views

Delete files and exclude some with find [duplicate]

It was an old problem. I knew how to delete files and exclude some, like this: rm `find ~/temporary/Test\ 1 -mindepth 1 -maxdepth 1|grep -v 'A'` but the problem is the folder 'Test 1' containing a ...
2
votes
1answer
36 views

Why does `psql --file` misinterpret tilde?

Earlier I used pg_dump to create a database backup in my home directory called book_dump.sql. I want to restore the backup to an empty database called book. To restore the backup, I tried this ...
4
votes
1answer
84 views

Instead /bin/bash as a shell, /bin/passwd in /etc/passwd file

I'm a Unix support Admin and I have a rare situation here. I have a recently adopted an environment that has a user with a /bin/passwd binary as a shell. xxx:x:1:100:xx:/home/xx:/bin/passwd Anyone ...
0
votes
1answer
29 views

Clearing everything but current line in tmux

I have my Control-K shortcut bound in tmux like this: bind -n C-k send-keys -R \; clear-history \; This clears the scrollback buffer's history as well as the current screen, which is what I want. ...
0
votes
1answer
63 views

combining bourne shell and awk

This is my actual file WASfile #!/bin/sh sed -i '/^ *$/d' WASfile sed -i -e '/user=/,/group_1=/{w /tmp/1' -e 'd}' /home/wasdm/WASfile; Script to Add read -p "Press [Enter] to continue for ...
1
vote
1answer
60 views

How woulld I add $OPTARGs from one arg to an array

So I'm trying to add values from an optarg to an array. I've got: arrays=() while getopts a: args; do case $args in a) arrays+=$OPTARG;; esac done echo $arrays[@] When I run the script, ...
0
votes
3answers
66 views

How to “copy-paste” important commands?

This question is not about the cp command. I don't have a mouse nor a GUI installed on an Ubuntu server, but I would like to save some commands in a file so I can reuse them later. Is my only choice ...
1
vote
2answers
174 views

Is it possible to grab and store the returned window id of a terminal opened through applescript or bash?

I have been working on this "dashboard" to help control my localhost server environment. It has been scripted in bin/bash for reference. I recently discovered I can use the bin command "osascript" to ...
0
votes
1answer
152 views

Understanding the scope and lifetime of environment variables in shell scripting

I'm pulling my hair out trying to understand shell scripting and passing environment variables, and what not. I'm trying to execute a PHP script from TextWrangler, that in it's turn opens a new PHP ...
0
votes
2answers
771 views

Print current time (with milliseconds)

I want this command in windows with cygwin installed, so any Linux command will work for me.
0
votes
1answer
53 views

Use date to update date

I am trying to follow along to the exercises in Beginning the Linux Command Line. One of the exercises asks to set the current time to 1 minute ago. While I can get the time one minute ahead: echo ...
1
vote
1answer
592 views

Shell Shortcuts in Windows OS

to open send to folder in windows 7, we type shell:sendto and to open apps folder in windows 8, we type shell:appsfolder first of all, i would like to know what is this syntax known as (shell: ...
0
votes
2answers
137 views

split a textfile after each n matches to a new file using sed or awk

i tried to split a file in parts of n matches each. The file is just one line and the seperator is '<br>' foo<br>bar<br>.....<br> I just want to split the file in parts, ...
1
vote
0answers
193 views

Shell on my Vagrant box is slower than it should be

The shell on my vagrant box is incredibly slow, atleast at some things. For instance, if I press enter with nothing typed in, it takes about 3-5 seconds for it to be ready to take another command. ...
0
votes
1answer
47 views

Is there a free UNIX shell service that allows you to test function keys?

I am testing a program that is a terminal emulator that runs through a web browser. I'd like to use a free UNIX shell service to test the function key maps (this program can also generate a function ...
0
votes
1answer
70 views

Cannot export or set variable in new shell

I experienced something weird when working on a issue. This command does not seem to work. (Using ` to fill blank line). When using export > /bin/bash -c "echo $FOO; export FOO=BAR; echo $FOO" ` ...
1
vote
1answer
171 views

Why do I sometimes get 'sh: $'\302\211 … ': command not found' in xterm/sh?

Sometimes when I simply type a valid command like 'find ...', or anything really, I get back the following, which is completely unexpected and confusing (... is command name I type): sh: ...
1
vote
2answers
2k views

Feeding contents of a text file as command to telnet

With the command telnet docs.python.org 80 I can do a manual 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 the ...
1
vote
2answers
1k views

Non-ISO extended-ASCII text

when i tried to know the encoding of the file all.txt using $ file all.txt it shows this message all.txt: Non-ISO extended-ASCII text, with very long lines what is the kind of this encoding ...
2
votes
1answer
276 views

iconv cannot convert between CP1256 -t ISO-8859-6

i tried to convert from CP1256 to ISO-8859-6 encoding using Sygwin but it cannot convert! and help? $ iconv -f CP1256 -t ISO-8859-6 cca.txt > cca1.txt iconv: cca.txt:791:41: cannot convert the ...
1
vote
2answers
68 views

If I replace the windows shell, can I revert when I'm done?

if I install bblean or litestep, will I be able to get the default shell back by uninstalling the custom shell?
2
votes
4answers
280 views

init.d script with screen command does not work

I wrote this simply start script: SESSION_NAME="session1" COMMAND="python /opt/aaa/manage.py runserver 192.168.1.1:4300" case "$1" in start) screen -dmS "$SESSION_NAME" "$COMMAND" ...
0
votes
0answers
28 views

Resume the sessionsof yakuake from reboot

I often open a lot of virtual terminal sessions in yakuake. I'm wondering is there a way to resume all my sessions and its context (like working directory, tab name) from reboot? Or you can tell me ...
0
votes
2answers
64 views

what's the error code “123” of the wget means

when i use the gun wget (version 1.13) to fetch a file list like this: cat url.txt | xargs wget -c -P ../data/ Then, I get the exit code 123, what does it means? thx:)
0
votes
0answers
9 views

auto-complete files/directories name on newly created

Does anyone know of any existing shell that kind of pre-analyses your composite command and does auto-completes on "to-be-created" directories/files? That is, the shell in question would be able ...
1
vote
1answer
44 views

Return control to shell DURING `gvim -f`

I occasionally use gvim -f to start gvim but force the shell to wait for the gvim session to end before resuming execution of whatever it's doing (for instance, I usually edit my bash aliases using an ...
0
votes
1answer
177 views

Error while executing bash command stored in string

Wrote a bash shell script that uses rsync to deploy files to live web server. Right before executing, the script outputs the full command that the my shell script generates: rsync --chmod="ug=rwx" ...
0
votes
0answers
163 views

How to close Genymotion device with shell command?

I need to close genymotion via shell command, does anyone know if it is possible to do this?
1
vote
2answers
913 views

What does the command “chmod a=w g+x alpha” do?

I was asked this question but didn't know what it does. I know chmod and its usages but what does this exactly do ?
0
votes
0answers
91 views

can't execute scripts compiled with shc

I'm trying to use SHC to compile a shell script so that I can set the SUID bit on it and obfuscate what it's doing (I'm attempting to have it run as part of all new users' .bashrc). As a test, I ...
0
votes
0answers
11 views

Remove duplicated images with the shell [duplicate]

I have a folder with osme images. Each of them has a different name but some of them are duplicate. What is the best way to delete the duplicates? I have to do it sistematically so I need some shell ...
1
vote
4answers
465 views

How to columnate text with tabs (in vim or on the shell)

I have a frequent need to manually manipulate tab-delimited text for data entry and other purposes, and when i do this it helps if the text is aligned properly into columns. For example (assuming ...
1
vote
1answer
683 views

How to find out is a program run with nohup or not?

There is no difference in ps -ef | grep sleep output to commands: nohup sleep 60 & sleep 60 & In which way can I discover that program is run with nohup?
0
votes
1answer
75 views

shell or perl script to replace the double quotes with their unicodes

I am having two files names as a.html a.xml in a folder and in a.html file i have a tag <div class="snippet abstract"> We present a new "model" for multiple-input-multiple-output ...
0
votes
0answers
40 views

which command doesn't work after uninstalling fink

I was trying to install something using homebrew.. so it complained that I had more than one package manager (either macports or fink).. so I followed fink's uninstall instructions which instructed me ...
1
vote
1answer
98 views

Bash preexecute

I'm trying to write bash command wrapper, which will be patch bash current command on the fly. But i'm faced with the problem. As i'm not a good Shell user, i can't write right expression of variable ...
1
vote
1answer
245 views

In a Shell scripts, check version of installed package, make a decision based on output

Looking to write a cross distro / cross version shell script that makes sure a forced version of PHP is installed Example: Ubuntu 12.04 has 5.3, Ubuntu 13.10 has 5.5, Debian 7 has 5.4 I need this ...
0
votes
2answers
185 views

ip namespace non-root shell

I am trying to run ssh command to another ip namespace. I can do it right now, but it runs as root. I want to run it as a normal user. I want to know if there is a way to enter a non-root shell in ...
1
vote
1answer
146 views

How to remove files which are copied after running `make install`?

So the question is how am I supposed to uninstall or remove the files that has been installed after running the make instal? (Specially when I stop it in the middle of the process by a "Ctrl+C" or ...
0
votes
2answers
57 views

What is the difference between different “make” commands?

So after running configure file on source codes for different applications one enters make and make install to install the application. My question is what is the difference between make and make ...
1
vote
1answer
50 views

confused about file owner in linux

---x--x--- 1 root stapusr 87992 Oct 20 23:44 staprun What I showed above is the owner of file staprun. But user root doesn't belong to groupstapusr. What does it mean? I assumed that before ...
1
vote
3answers
72 views

Enter a string containing “!!” on a shell without it being interpretted

I'm trying to send a string that contains "!!" in it. However, every time I execute it on zsh, zsh replaces !! with the last command entered. How can I get zsh to not interpret "!!"? I have also ...
0
votes
1answer
172 views

uuencode to attach all files in a directory

I am using uuencode and mail to do basic file attachments to an email. $ path/to/targetdir/audio.gsm audio.gsm | mail user@mail.com This works but my problem is I am trying to find a way to ...
1
vote
1answer
234 views

Append text with dynamic value in a text file by echo command in bash

I want to append some text in a file through a shell script. I have the following script bash -c 'echo -e "\nserver.id=$1" >> file.properties' saved in the file script.sh This is how I run ...
2
votes
1answer
378 views

Fastest way to delete a non empty directory in Linux

I use the command rm -rf directory but i came across the following article : Article That suggests that rsynch to an empty folder is the fastest way? rsync -a –delete empty/ a Why is this the case ? ...