Bash is a free shell for Unix-like operating systems, from the GNU Project

learn more… | top users | synonyms

2
votes
3answers
880 views

How to interpret the number after permission in ls -l?

I am wondering what the number 1234 means in this example: rw-rw-rw- 1234 blabla blabla 3243253235 14:40 myfile.zip
0
votes
2answers
319 views

launchctl - use rvm instead of system Ruby in executed scripts?

I have a launchctl job I define as such: <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>-c</string> ...
0
votes
1answer
256 views

Opening and passing arguments to an application using a shell script on a Mac

I am trying to write a shell script on a Mac which opens RIATest and passes it parameters. My code is: #!/bin/bash echo THIS TEST!!! open -a '/Applications/RIATest 4/RIATest.app' --args /b /r /e 5 ...
0
votes
1answer
659 views

VIM zsh, bash and colors in command line on Ubuntu

I have problem with VIM command line when calling system commands. e.g. !ls, all command output colors aren't parsed by VIM. My system is Ubuntu 12.04 LTS with VIM 7.3.429 from Ubuntu repositories. ...
0
votes
3answers
510 views

Customizing BASH output colors?

How do I customize bash colors for command output? For example; I run ls and want directories and files to be a different color. How do I accomplish this? I see that distro's are doing this but I ...
0
votes
0answers
195 views

Terminal emulation has stopped working. Garbage escape chars

To enable me to do some remote administration of our servers I started using a terminal emulation program called TouchTerm Pro on my iPhone. While not the smoothest experience, it has allowed me to ...
0
votes
2answers
94 views

Showing a stack of ssh connections in terminal

I had this idea for long time and tried several ways to implement, with no luck. Tried to google many times and always finding not quite what is needed. How to do: $ ssh hostA ...
0
votes
2answers
448 views

Run two watch commands simultaneously

I want to run two executables in the foreground by typing one line of code or running a shell script. These executables watch a directory and recompile some code while outputting their status to ...
0
votes
1answer
74 views

Is there anything like emacs tramp for shell (bash/zsh)?

Say, we have a server where we use "userx" to deploy stuff and do some maintenance task. This user is being used by multiple team members. So, if I can not really modify the .bashrc or .zshrc the way ...
0
votes
2answers
213 views

/opt/splunk/bin/splunk: No such file or directory

When I try start splunk without sudo (or even logged in as root), I get a "no such file or directory" error. The file's definitely there though, it's not even a symlink. It works with sudo, but then ...
0
votes
1answer
374 views

Execute background program in bash without job control

I often execute GUI programs, such as firefox and evince from shell. If I type "firefox &", firefox is considered as a bash job, so "fg" will bring it to foreground and "hang" the shell. This ...
1
vote
1answer
144 views

Formatting pwd/ls for use with scp

I have two terminal windows with bash. One is local on the client computer, another one has an SSH-session on the server. On the server, I am in a directory and seeing a file I would like to copy to ...
0
votes
1answer
375 views

Mouse right-click menu in RXVT

I moved from gnome-terminal to urxvt. I am used to having a right-click menu in gnome-terminal. Do such menus exist in urxvt?
1
vote
2answers
542 views

Match a line until a # ,but without the #, when parsing a file with a regex

I want to parse my sources.list to extract the list of repositories. I have: ## Some comment deb http://some.vendor.com/ubuntu precise stable deb-src http://some.vendor.com/ubuntu precise stable deb ...
-1
votes
2answers
357 views

How to “cd” into system files

I have files saved under Macintosh HD/Library/... that I need to manipulate using bash. How can I access those files in the shell?
2
votes
1answer
202 views

Porting GNOME keyboard shortcuts to URXVT

I recently switched from gnome terminal to urxvt (and installed tabbed extensions). I am also a heavy emacs user which uses a lot of key combinations similar to urxvt (tab related stuff) like ...
0
votes
1answer
356 views

IP Address dotted decimal to /8 or /16 notation using bash,sed or awk?

I have an input file that contains a list of ip addresses and the ip_counts(some parameter that I use internally.)The file looks somewhat like this. 202.124.127.26 2135869 202.124.127.25 2111217 ...
0
votes
2answers
170 views

Bash - read as a fallback to $@

I have a working bash script (working on OSX) that takes files and directories as input and does something like for inputFile in $@ do [someStuff] done but I want to provide a “fallback”, meaning, ...
2
votes
7answers
7k views

How to find the index of a word in a string in bash?

In bash script, I have a string which contains several words separated by one or more than one spaces. ie: Name Age Sex ID Address If I want to find any of the word, for instance I want ...
0
votes
3answers
194 views

Bash - Test for multiple users

I am trying to test if current user one of two allowed users to start a process, but I can't seem to get the multi-condition to work correctly: test ($(whoami) != 'mpurcell' || $(whoami) != 'root')) ...
0
votes
2answers
170 views

PHP crazy behavior on mount

I have a mount to my windows machine on a linux machine. When I try to run any php scripts there it says it's not found, however, when i copy the files to the local storage it runs with no problem. I ...
0
votes
2answers
208 views

urxvt - tab expand environment variables

I am new to urxvt (moved from gnome-terminal -> Ubuntu 12.04 refugee). I am used to having environment variables expand in gnome-terminal by default Suppose that I have an environment variable ...
2
votes
1answer
101 views

Screen - switch tabs in subscreen

I use this in my .screenrc: bindkey ^[q prev bindkey ^[w next to switch between windows with alt+w/q If I open screen in screen, I can switch like: ctrl+a+a + number, but I would like to id for ...
0
votes
2answers
215 views

Bash function get current command line

I often do something like this: tail -f logs/`ls -rt logs | tail -1`/debug.log I would like to have a macro for ls -rt <some_dir> | tail -1, but it needs to work in the context of the current ...
1
vote
1answer
312 views

Run a script on new email

What's the best option to trigger a script every time I receive a new email? I'm using pine on linux. I want to feed the email to my script and do some processing. I don't have root rights on the ...
0
votes
2answers
2k views

Can't access Terminal anymore, only shows a cursor

I run OS X. Following these directions (Installing MySQL on Mac OS X) I added a file to /usr and the contents were PATH=/usr/local/mysql/bin:$PATH Actually I was trying to get the mysql command ...
0
votes
1answer
747 views

OSX / Unix Terminal Color Template Change

I've been trying to decorate my Terminal on my MacOSX 10.7.3. As i surfed and found is to write following color codes into the file called .bash_profile: export CLICOLOR=1 export ...
0
votes
1answer
579 views

Run a bash script from docky

Using docky under ubuntu, I want to be able to run bash scripts. When I drag and drop a script from nautilus to docky, the script appears on docky. But clicking on the script icon opens the script ...
-1
votes
1answer
686 views

paste multiple lines string to CMD or Bash variables

I want to copy multiple lines (splitted by Enter key) from, for example, notepad and then paste it into new variable in CMD or Bash console and after that do some operations on it. Although it's ...
1
vote
3answers
657 views

Is there a bash wildcard for changing directories?

When using the Bash command line I can for example change to a directory using... cd /volumes However I would like to type... cd /vol* but that doesn't work. Is there a way to navigate ...
0
votes
2answers
245 views

defaults “command not found” when executed after declaration of variable

Why does the following code not work? #!/bin/sh PATH=$PWD/Info defaults read $PATH Everytime I execute it I get ./script: line 3: defaults: command not found Once I do it in one line it work ...
1
vote
2answers
1k views

Recursive Unrar with Deletion as it progresses

Basically, i have a set of directories that are constantly being filled with .rar's, and i need to be able to extract them in place with automatic deletion of the left over .(rar|rXX) files. How would ...
1
vote
3answers
2k views

Redirecting stdout to program argument

I run a Minecraft server on my Arch Linux laptop. The server software for Minecraft runs as an interactive program on a command line, so I start it in a detached screen session, allowing me to ...
0
votes
2answers
180 views

Is TLS secure enough to prevent eavesdropping carried out by an ISP?

I would like to "secure" my email, http servers and desktop client by connecting exclusively over TLS, be it email, in/out:80 or just regular "web surfing" traffic. Will that prevent ISP and ...
0
votes
1answer
1k views

How to delete directories older than one hour (cron job)

My application creates directories when user performs certain action. These directories are stored on my machine for exactly one hour and than are deleted. Now I would like to move the 'deleting ...
1
vote
2answers
763 views

How can delete all files except one from a directory?

I need to delete all files, except one (its name is defined), from a given directory. How can I do this from the terminal in OS X? Can I do this with one single command?
3
votes
1answer
1k views

Change volume from bash

I got this far (from .bashrc): alias i="amixer -c 0 -- sset Master playback +1dB" alias d="amixer -c 0 -- sset Master playback -1dB" alias v4="amixer -c 0 -- sset Master playback 40%" alias ...
2
votes
2answers
461 views

How to override default bash key-bindings?

I write this config file: # ~/.inputrc Control-d: "\C-udate +'%F %T'\C-m" I want to run date command when I type Ctrl-d. But I cannot override the default behavior(exit). Thanks for your help.
1
vote
0answers
55 views

Where shared folders are located on MAC OS X Lion?

On Snow Leopard there is a file named /var/db/samba/smb.shares where listed all shared folders. Does anyone know, where that file is located on MAC OS X Lion? Thanks
1
vote
1answer
62 views

mapping cntrl+p , cntrl +n in command prompt

I m looking for a way to map CNTRL+p and CNTRL+n in command prompt to previous and next command in history. I m aware of F3 and up/down key but I m habituated to CNTRL+p/n on linux.
0
votes
2answers
271 views

Search for exe file within a condition

I want to search for all .exe files greater than 200 kB or smaller than 120 kB in the current folder and its subfolders. Then I want to move them to another folder called "folder" and execute in this ...
4
votes
1answer
376 views

bash completion does not work for newly added user

I added a new user in my ubuntu system with sudo useradd -d /home/peeyush -m peeyush sudo passwd peeyush The above list of commands created a new user successfuly but the new user is unable to use ...
0
votes
1answer
214 views

How can I set a git config item as a function?

I'm trying to set up the gist gem, but I don't want to have my GitHub password stored as an environment variable or git config item. The README from the GitHub repo explains, You can also define ...
1
vote
3answers
352 views

bash script to remove select files

I have a series of files that are named according to field.%d.vtk and are generated when I run a C++ code. The codes does a series of computation inside a for-loop and dumps the output whenever i%N == ...
5
votes
2answers
2k views

How to close other windows in tmux?

I write some functions in .bashrc to make tmux easy to use: #!/bin/bash # .bashrc # vim tmux #----- -------------------- tabc() { tmux kill-window; } tabe() { tmux new-window; } tabf() ...
13
votes
4answers
36k views

How can I get the mount path of a USB device on OSX?

I have a backup script that backs up some data to a USB device. The problem I have is that OSX sometimes changes the expected mount path. For example if some file is locked under the expected mount ...
0
votes
2answers
176 views

Debian + Grails console: destroys local echo of ssh session after exit

I installed grails on a virtual vagrant box of Debian Squeeze 64. the debian box base image is available under http://dominique.broeglin.fr/2011/03/26/squeeze-64-vagrant-base-box.html the grails ...
2
votes
1answer
2k views

Send all error messages to a text file?

I'm trying to run the following command: $ psql -d template_postgis -f /usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql It produces a vast amount of error output, of which I can only ...
1
vote
1answer
399 views

tail -f updates slowly

I'm not sure why, but on my Macbook Pro running lion I get slow updates when I issue "tail -f" on a log file that is being written to. I used to use this command all the time at my last company but ...
1
vote
2answers
108 views

How can I avoid descending certain directories with 'find'?

Currently I have this find command which avoids descending particular directories: find . \! \( -name ".hg" -prune \) \! \( -name "localhost" -prune \) \! \( -name "logs" -prune \) -type f The ...