Questions tagged [shell]

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

Filter by
Sorted by
Tagged with
20 votes
9 answers
15k 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 ...
Michael Wehner's user avatar
0 votes
2 answers
218 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 ...
Xhacker Liu's user avatar
6 votes
5 answers
14k 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?
user avatar
0 votes
1 answer
142 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
user avatar
0 votes
2 answers
1k 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 ...
Foolish's user avatar
  • 1,939
46 votes
3 answers
17k 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 it. ...
Belmin Fernandez's user avatar
1 vote
1 answer
3k 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 http://lab.test.com/test/test/down.php?c=redsoul&bbs_no=236513&...
user45326's user avatar
  • 2,023
4 votes
1 answer
1k 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 ...
jtzero's user avatar
  • 175
8 votes
4 answers
4k 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 ...
Wuffers's user avatar
  • 19.3k
3 votes
2 answers
9k 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?
Jichao's user avatar
  • 7,480
25 votes
4 answers
25k 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 ...
Mak Kolybabi's user avatar
2 votes
2 answers
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 ...
user avatar
5 votes
2 answers
2k 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 ...
ohho's user avatar
  • 3,034
5 votes
4 answers
1k 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 ...
Gordon's user avatar
  • 417
1 vote
2 answers
2k 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 having ...
Pez Cuckow's user avatar
2 votes
2 answers
3k 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 -...
Mâtt Frëëman's user avatar
4 votes
1 answer
2k 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 ...
mykhal's user avatar
  • 312
2 votes
2 answers
7k 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?
Jichao's user avatar
  • 7,480
2 votes
3 answers
942 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 ...
taw's user avatar
  • 1,947
43 votes
4 answers
33k 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 the ...
coneybeare's user avatar
1 vote
1 answer
2k 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 ...
Clint Pachl's user avatar
  • 3,050
3 votes
3 answers
2k 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 ...
Joshua K's user avatar
  • 845
1 vote
3 answers
614 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
user avatar
8 votes
1 answer
3k 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 ...
Ethan Leroy's user avatar
7 votes
6 answers
15k 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 ...
Bio_X2Y's user avatar
  • 103
1 vote
3 answers
153 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.
Ram Rachum's user avatar
  • 5,220
3 votes
1 answer
676 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 ...
Mad Scientist's user avatar
17 votes
4 answers
53k 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?
Sheehan Alam's user avatar
5 votes
2 answers
6k 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 -i ...
Ryan C. Thompson's user avatar
0 votes
1 answer
1k 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 ...
David B's user avatar
  • 2,534
48 votes
7 answers
93k 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?
David B's user avatar
  • 2,534
1 vote
2 answers
69 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 ...
Arun Saha's user avatar
  • 151
1 vote
2 answers
3k views

meaning of ftp -s in shell scripting

can some me tell me what does s means in ftp -s (shell scripting)?
user avatar
0 votes
2 answers
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?
Igorio's user avatar
  • 748
7 votes
2 answers
5k 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?
Leda's user avatar
  • 431
5 votes
1 answer
3k 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 7 ...
Sam Holder's user avatar
  • 1,011
8 votes
3 answers
201 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 ...
pablo.meier's user avatar
0 votes
2 answers
4k 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 ...
에이바's user avatar
  • 1,316
9 votes
4 answers
13k 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 ...
jl6's user avatar
  • 1,175
7 votes
3 answers
3k 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 ...
user123444555621's user avatar
3 votes
4 answers
1k 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 ...
Danny Goodman's user avatar
1 vote
3 answers
633 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 ...
Andrew Larned's user avatar
1 vote
2 answers
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 ...
canni's user avatar
  • 205
7 votes
3 answers
32k 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?
Sheehan Alam's user avatar
3 votes
1 answer
4k 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 ...
Neophytos's user avatar
36 votes
5 answers
25k 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.
nisc's user avatar
  • 1,112
2 votes
2 answers
255 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 ...
Lazer's user avatar
  • 17.7k
3 votes
8 answers
2k views

Why does "ls -a" hide some existing directory from the root user?

Today I found something really interesting (at least to me) on one of our test servers: I can change into an existing directory from my actual working directory using a relative path, but that very ...
Zsolt Botykai's user avatar
1 vote
1 answer
2k views

Shell context menu option does not work when many items are selected

I added an option to register a dll silently using the right click context menu by adding the following registry key: [HKEY_CLASSES_ROOT\dllfile\shell\Register\command] @="c:\\windows\\system32\\...
Sam Holder's user avatar
  • 1,011
1 vote
2 answers
1k views

Removing linked soft link in Unix

currently i am wanted to clean up my proj area but the problem with rm i am facing is some copy remain in disk with linked i am meaning soft link A linked to B B linked to C C which is on ...
Black Diamond's user avatar

1
73 74
75
76 77
82