A shell is software that lets users interact with the operating system, usually by typing at a command-line.

learn more… | top users | synonyms

12
votes
8answers
4k views

Growl Notifications for Shell Task Completion

(OSX Specific) I, like many others besides myself often find myself kicking off a process in the shell that takes a minute or two to complete (a large svn commit for example). During that time, I ...
2
votes
3answers
2k views

Have a list of files, move them using one command

I have run a command which finds a lot of files based on some search criteria. It returns the files like so: ./somepath/somepath/file.something ./asdf/asdf/s.php ./etc/a.php ./a/b/c/d/e/f/g.jpg So ...
0
votes
2answers
2k views

Open new terminal from script to get user input and use input in script

Is it possible from a background shell script to open a new terminal (xterm, gnome-terminal, whatever), get some user input, close the newly opened terminal and use the data that was input?
17
votes
7answers
9k views

How to retrieve the absolute path of an arbitrary file from the OS X

I'm looking for a simple command that can be used within Bash to find the absolute and canonicalized path to a file on an OS X (similar to `readlink -f' under Linux). The following sample bash ...
0
votes
2answers
163 views

When I run /usr/bin/time my_program, how to kill my_program?

I want to check how long time my program takes. Then I using "/usr/bin/time my_program". When it takes more than 5 seconds, I want to kill it. I tried "kill -9 TIME_S_PID", time is killed, but ...
3
votes
3answers
5k views

Is it possible to play a song in vlc player out of the command line?

is there a shell command in Linux (for VLC media player) to open a *.mp3 file?
0
votes
1answer
129 views

How do I fix unix so that I can use the cursor on the shell?

I was able to use the up/dow arrow to cycle through previous commands, now when I press a directional key it outputs "^[[A". I'm running on a bash shell. How do I fix this? Thanks
0
votes
2answers
547 views

How to know if the command find any result?

#!/bin/sh LOOK_FOR="NTLMAuthenticationFilter" for i in `find ./ -name "*jar"` do echo "Looking in $i ..." grepjar -e $LOOK_FOR $i done I wrote the script above, and try to find if there any file ...
21
votes
3answers
4k views

Multiple standard input? How?

From this commandlinefu post: $ diff <(wget -q -O - URL1) <(wget -q -O - URL2) Seems like multiple standard inputs but---if I remember my Linux Porgramming course correctly---this can't be ...
1
vote
1answer
784 views

-o: command not found

I am trying to download file using curl, but I get the following error message. -o: command not found My command was curl ...
4
votes
1answer
502 views

how to copy I/O not just redirect (Windows and Linux)

I have a simple call command call calabash -D sim.xpl >test.txt 2>&1 and this redirects into test.txt, how do I do both redirect into a file and allow it to show up in the prompt? (I ...
4
votes
4answers
1k views

How can I check if the current shell is being used from vim?

I am running OS X. On vim, if you do the :sh command, you can drop to a shell to execute commands. I constantly forget whether I am in this shell or not. Is there any way to check if I am in the ...
3
votes
2answers
6k views

remote shell for windows 7?

Could recommend a remote shell for windows 7? Or is there already a remote shell funtionality inside windows 7?
14
votes
3answers
10k views

Check number of pending security updates in Ubuntu

Let me start by saying I have been forbidden to enable automatic updates on our Ubuntu servers, for both security and regular packages. When I log into any of my four Ubuntu servers, the welcome ...
2
votes
2answers
1k views

Conky starts above windows in Ubuntu Maverick

I did not run into this problem until I upgraded my Ubuntu box to Maverick Meerkat (10.10). Basically, whenever I start my computer, conky runs as expected, except it gets drawn over any windows that ...
5
votes
2answers
1k views

How to keep remote script running when dropping ssh?

I ssh from my MacBook to a remote Linux and started a lengthy script (import 2000000+ lines of csv text records into MySQL). Too bad I have to take away my MacBook one hour later. How can I keep the ...
4
votes
3answers
212 views

Accidental Extract Location - How to Clean Up?

Sometimes I will do a command such as unzip tons_of_files.zip And I will forget to put a -d to point to a subdirectory. This causes the current folder to get filled with tons of files that are ...
1
vote
2answers
1k views

Shell scripts on OSX that opens an SSH and Logs in [duplicate]

Possible Duplicate: How do I set up SSH so I don't have to type my password? I'm trying to write a shell script to connect my MBP to my server (for tunneling) every-time it boots. I'm ...
1
vote
2answers
2k views

Modern Shell For Unix - Something like Powershell

I'm looking for a modern shell for Ubuntu. Here is the first qualifying issue, say in a build style script (not looking for a build system btw): In powershell: new-item workspaces\crm\builds\demo ...
4
votes
1answer
946 views

gnu screen automation

i'd like to launch GNU screen, some shell command in it, then open new screen window(s) with different command(s) - all that automatically, from a script. is it possible? UPDATE the screen windows ...
2
votes
2answers
4k views

Is there a command to clear the screen of MYSQL under Windows?

Is there a command to clear the screen of MYSQL under Windows? I could not find it. Could you help?
2
votes
3answers
738 views

What escape code do I need in PS* to make sure terminal is back in normal settings on shell prompt?

Sometimes I accidentally cat some binary data; sometimes some ncurses program crash - for plenty of reasons terminal can end up in bad state, requiring manual reset. This is happening too often. Such ...
26
votes
2answers
16k views

Bash Shebang for dummies?

I have some bash scripts I have setup that mostly use #!/bin/bash but I regularly come across some that look like #!/bin/bash -e #!/bin/bash -x #!/bin/bash -ex and so on. Can someone explain ...
1
vote
1answer
1k views

Re-redirect STDERR in K/SH?

Once STDERR is redirected, for example to a file, how can it be redirected back to the original file descriptor 2? #!/bin/sh exec 2>/tmp/err print -u2 'log errors to file' exec 2>&2 (how ...
3
votes
2answers
1k views

How can I move folders that contain a file with a specific extension to a destination folder?

Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them ...
1
vote
3answers
288 views

.login and .cshrc

where can I find these two files if I want to modify them? EDIT: when I use echo $0 I receive -tcsh but I found only .bash_profile .bash_history .bash_logout, but not .login .cshrc
5
votes
1answer
2k views

newline in bash variable

My script contains something like this: ifc=$(ifconfig) With this, the ifc variable contains the output of the command ifconfig but without newlines. So, when I print it with echo $ifc I get only ...
5
votes
6answers
8k views

Is it possible to gunzip multiple files to a specific directory without deleting the original gz files?

I know this can be done for single files, e.g. gunzip -c my.gz > somedir/my Can it be done for multiple files? [UPDATE] I have a directory with a large number of .gz files (not .tar.gz), and I ...
1
vote
3answers
106 views

Checking how many files there are of a certain type in a directory and all sub-directories

I want to find how many .py files I have in my GarlicSim directory and all its sub-directories. How do I do that? Either Windows or Linux is fine.
3
votes
1answer
408 views

Check folder sizes and report combined size for identical named folders in Linux

I have 2 folders that have subfolders (named after users). Most subfolder names exist in both folders, but not all. Now I want to create a list of space used by each user. I can use the following ...
4
votes
3answers
7k views

How can I change the startup directory of my Terminal on OS X?

I want my terminal to always start at a certain directory instead of home. How can I do this?
3
votes
2answers
2k views

How can I alias a command for sudo?

I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this: alias rm=trash This works fine as a normal user, and it works fine when I use sudo ...
0
votes
1answer
955 views

Why does terminal prompt text becomes black when connecting to Ubuntu with Nomachine NX client?

I'm using Nomachine NX client for Windows to remotely connect to my Ubuntu. Every now and then I experience a strange phenomena: the text in the prompt of all open terminal windows becomes black, so ...
13
votes
7answers
22k views

How can I list only non-empty files using ls?

How can I list (using ls) all files that are not empty (size > 0) using linux?
1
vote
2answers
53 views

Quantifying responsiveness in solaris machine

I am one of the n users of a shared unix machine. For reasons unknown, the machine is not "responsive" enough. For example, it is slow on interactive commands, it takes few noticeable moments for any ...
1
vote
2answers
1k views

meaning of ftp -s in shell scripting

can some me tell me what does s means in ftp -s (shell scripting)?
0
votes
2answers
2k views

Is it possible to open a second shell session that will remember the user, machine, and directory I am in?

I'm ssh'ed into a machine and logged in as a different user. Is it possible to open a few new windows that will still be ssh'ed into that same machine, still logged in as that user?
4
votes
2answers
3k views

Bash: Find folders with less than x files

How would I go about finding all the folders in a directory than contain less than x number of .flac files?
5
votes
1answer
2k views

Can I make a shell context action run as administrator?

I like to add a shell context menu for registering .dll files using the command %windir%Microsoft/Framework/v2.0.50727/regasm.exe "%1" /codebase which used to work fine in XP. However in Windows ...
8
votes
3answers
160 views

Windows 7 coming from Linux/Unix?

I've got a Windows 7 box going for my job, and most high-level computing experience is coming from shell environments in Linux. I'm completely lost in the Windows shell, and when I try to use a GUI ...
0
votes
2answers
1k views

Moving characters to the end of line (EOL) with SED

Any time the word “The” appears at the beginning of a line, I want to move it to the end of the line and capitalize the new first word in the line. For example, “The heaven” becomes “Heaven the”. I'm ...
8
votes
4answers
10k views

UNIX shell scripting: how to recursively move files up one directory?

I have a large number of small files, f, arranged in a directory structure like so: /A/B/C/f There are 11 directories at the level of A, each with about 100 directories at the level of B, each with ...
4
votes
3answers
897 views

Why is there a minus sign in “$0” on Mac?

I've been a GNU/Linux user for years, but I can't figure out how to get usable process info on Mac. I realized that $0 resolves to -bash in my login shell on Mac OS (Snow Leopard). This may break ...
3
votes
4answers
940 views

rm -rf: Unix thinks '-rf' is a file not an option

I run the following command in Terminal on my OS X Snow Leopard laptop: rm -rf /path/to/directory Normally, this deletes the directory and all contents/subdirectories. For some reason, though, it ...
1
vote
3answers
451 views

How do I stop my bash terminal from prepending parts of previous commands to my current line?

I'm using Ubuntu (10.04) with bash, and am running into an odd issue. After I use the up arrow to scroll back through my history of commands, and get back to one of the longer commands (i.e., one with ...
1
vote
2answers
1k views

Remote shell sessions logout on hibernate

I often found to close laptop to fast, with few remote ssh sessions opened. And after wakeup i found few dead-shells, witch has not been closed :/ How i can force clean exit of remote ssh-sessions on ...
3
votes
3answers
8k views

How can I exit a program in the OS X Terminal?

What is a quick way to exit a program in the OSX terminal?
2
votes
1answer
3k views

Install MatroskaProp on Windows 7 x64

To see more information in Windows Explorer property pages and menus about Matroska Video (.mkv) files, similar to what one can see when selecting native Windows media (.avi, .asf, .wmv or even just ...
20
votes
5answers
10k views

Bash/ZSH: Undoing 'disown'

Is there a way to 'reattach' a process to the shells job table after it it has been 'disowned'? Edit: $SEARCHENGINE totally fails me. Doesn't look too good.
2
votes
2answers
196 views

How to take backup of a shell?

I was working on a shell and got some weird exceptions in my program. Just as a reference, I want to save all that is there on my shell to a text file. I do not just want the command history but also ...