Bash is a free shell for Unix-like operating systems, from the GNU Project
0
votes
0answers
4 views
Is there a way to let the user create a cron entry without opening nano
Is there a way to create a cron entry with bash where the user only have to enter the command to execute and the script does the rest.
Create cron file if it isn't already created
Set the execution ...
0
votes
0answers
7 views
How to disable alternate buffer in GNU screen itself but not for vim, less inside it?
What I would like to accomplish is mouse wheel scrolling behavior that I'm used to in a regular ssh session. In bash prompt mouse wheel should scroll my terminal output, and inside less/vim - the ...
2
votes
3answers
46 views
Have a file named ~ (tilde) in my home-directory (Linux)
I just noticed that I have a file called ~ in my ~-directory.
$ ls -la ~
...
-rw-r----- 1 x1 x1 733962240 Mar 1 17:55 ~
...
Any idea how I can mv or rm it?
0
votes
2answers
7 views
pipe command's output to dialog and allow to scroll up
I want to run an arbitrary command, for example
find / -name "a*"
I want to pipe its output to to dialog. --tailbox and --progressbox handle this well, except that if the output becomes too much, ...
-1
votes
0answers
33 views
Is it worthwhile to learn unix command in depth? [closed]
I am a Ruby on Rails developer so I am familiar with ruby codes.
I know basic linux commands.
However, I never used sed or awk or other advanced commands.
When I need to process some texts, I use ...
2
votes
1answer
19 views
Creating a .bashrc function with encapsulated commands
I'm trying to create a function in .bashrc to shortcut my MAMP commands. I want to do something like this:
mamp config
Opens up MAMP's httpd.conf file for editing.
mamp restart
Restarts the ...
0
votes
0answers
33 views
Is it possible to use a shell script in the sendto folder?
I would like to use a bash shell script from the SendTo folder. When I put a shortcut to a batch or exe into theSendTo folder it shows up in the shell Send To context submenu, but when the shortcut ...
2
votes
3answers
28 views
How can I make `find` find files in reverse chronological order?
I want to find files in subdirectories sorted by timestamp (of creation), with most recent first.
I have looked at the man page but it seems to only seems to let you filter by timestamp rather than ...
1
vote
2answers
16 views
terminal.app: how to read the terminal window title
I have seen many questions about how to set the tab (or window) name, but how to get it?
I have setup terminal to open 8 tabs, each tab having its own name (dev1, dev2, ... dev8)
Is there any way for ...
0
votes
3answers
31 views
Possible to use more than one core with sed and bash?
I am looking to use more than one core when replacing values with sed in bash, is this possible?
0
votes
0answers
22 views
How to pipe regex with ffmpeg and perl?
So I am trying to get the current frame of the conversion with this bash command:
ffmpeg -i fd.mp4 fd.avi < /dev/null 2>&1 | perl -015 -e 'print <STDIN>=~/frame=(\ {3})(\d+)/' | sed ...
0
votes
0answers
32 views
Executing tcpdump remotely while storing packet capture locally
I have run into stumbling block while attempting to create a bash script that will write packet capture files from tcpdump onto a remote server, while displaying the output of the tcpdump command so ...
0
votes
0answers
17 views
Executing tcpdump remotely while storing packet capture locally [duplicate]
I have run into stumbling block while attempting to create a bash script that will write packet capture files from tcpdump onto a remote server, while displaying the output of the tcpdump command so ...
0
votes
1answer
29 views
Remember bash directory stack across sessions?
Bash will remember command history across sessions, but not the directory stack created with pushd. Is there any way to remember the directory stack as well?
SOLUTION: I wrote a solution based on ...
0
votes
1answer
26 views
One hour too much in date formatting using date(1)
If I execute the following commands in the terminal
start=$(date +%s)
# wait a few seconds …
end=$(date +%s)
time=$(dc <<< "$end $start -p")
echo "$time"
echo "$(date -jr $time +%H:%M:%S)"
...
0
votes
1answer
33 views
Select vimenter autocmd's to run based on args
I'm trying to reduce the number of things I need to do when I open VIM. I have the three following scenarios that I'd like to account for:
1. Open vim with a directory specified
vim .
For this ...
0
votes
3answers
31 views
execute a command in all subdirectories bash
I have a directory structure composed by:
iTunes/Music/${author}/${album}/${song.mp3}
I implemented a script to strip my mp3 bitrate to 128 kbps using lame (which works on a single file at time).
...
-1
votes
1answer
35 views
Bash script to remove and rename files based on size and naming
I have directories with multiple conflicting files, and am looking for a way to sort, name and delete duplicates based on a distinct pattern based on the file's name and size. Though my knowledge of ...
3
votes
3answers
38 views
Need to sed awk or grep output to extract strings
I have output which looks like this:
"vancouver/news/vancouver-voices": {
"status": 0,
"time": 0,
"timestamp": 1371298701
},
"vancouver/news/vancouvers-march-second-annual-success": {
...
0
votes
1answer
24 views
does this scriptline need escaping
Very simple question, I need to know if the "query" parameter from Alfred still works
My guess is, it wil not.
If so, how do you properly escape?
mysql -u [root] -p[foo] -e "create database ...
2
votes
2answers
40 views
How can I use a bash like shell on windows
I use Linux and a Mac.
I'll be teaching some command line stuff soon.
What can I install on Windows to give me a terminal window most similar to a basic mac/linux bash shell.
Would like to be able to ...
0
votes
1answer
18 views
Substitute for zip command or way to zip files
I want to zip files using the zip command, but my terminal says
-bash: zip: command not found
Is there a way to get the zip command, or maybe use another command instead?
0
votes
0answers
24 views
My terminal doesn't render characters occasionally
Occasionally while executing commands such as 'ls' the cursor in my terminal won't go to the next line
e.g. after typing ls
The cursor moves in front of the text back to its default position, but ...
0
votes
3answers
44 views
Raw multiline string in bash?
Is there a way to get an uninterpreted string in bash - it could include single and ouble quotes and Bang ! etc. ?
I want to do something like
#!/bin/bash
echo -e "Line One\nLine Two\nLine three" | ...
1
vote
2answers
19 views
`jobs` command doesn't show any background processes
When I was in the office using my desktop, I started a script run.sh in background 4 times.
run.sh parameter1 &
run.sh parameter2 &
run.sh parameter3 &
run.sh parameter4 &
Then I ...
3
votes
3answers
33 views
Exclude subfolders with specific files in recursive rm -rf /folder/*
I wonder if it is possible to specify some elegant condition (parameter maybe?) in rm -rf /folder/* not to delete its subfolders, which contain files with name "dontshoot.txt".
I wasn't able to ...
0
votes
2answers
30 views
Start java process with different names?
I have 2 eclipse and 2 servers running
If i make a ps -C java i see something like:
2460 pts/1 00:03:08 java
2908 pts/3 00:00:05 java
3045 pts/4 00:00:17 java
3284 pts/3 00:01:40 java
...
0
votes
0answers
7 views
easy_install using older module for dependency check
How do I get easy_install to see a newer version of a module which is required to install another module?
I'm trying to install MISO locally using:
easy_install --user -U misopy
It gives me an ...
0
votes
1answer
16 views
Bash OAuth 2.0 JWT script for Server to google Server Applications
I am trying to make a jwt script that gives me tokens based on https://developers.google.com/accounts/docs/OAuth2ServiceAccount
This is what I have so far, but the token server replies that the ...
0
votes
1answer
5 views
rsync in a bash script appears to work, but the files aren't updated on destination server
I've got a server where I do my web development and testing, and I have a bunch of frontend servers that sit behind a load balancer. I wrote a simple bash script to rsync a directory on my dev server ...
0
votes
1answer
19 views
How to source a file only for a defined sudo user in Linux?
I want to source a file in .bashrc only for my user id when I sudo to the functional id. it should not be sourced when other user sudo in.
1
vote
3answers
35 views
sed quotes and backslashes on cygwin
I am trying to extract a substring from a string with sed on cygwin.
#!/bin/bash
var1="foo\ bar"
var2="baz"
var3="$var1 $var2"
# extract "foo\ bar" from "foo\ bar baz"
var4=`echo $var3 | sed ...
0
votes
1answer
15 views
Error in Terminal when I open it
Last login: Wed Jun 12 15:15:00 on ttys000
-bash: Downloading: command not found
-bash: Upgrading: command not found
-bash: RVM: command not found
-bash: RVM: command not found
-bash: Upgrade: command ...
0
votes
4answers
72 views
Cannot cat file which has space in name in linux
I believe there's a simple fix but cannot debug it out.
I have file called "file name with space"
How do I cat this file from Linux bash ?
0
votes
2answers
41 views
How do I parse a line thorugh a file in bash
I am very new to shell scripting I had a small query regarding the file parsing.
So, here's what I am trying to do:
I run an svn merge command, and genaratea conflict file
my conflict file is ...
2
votes
1answer
21 views
How to benchmark bashrc / zshrc and prompt rendering time?
As im currently experimenting with new stuff in my prompt i need a way to tell what the performance impact is.
How can i monitor how long it takes to render my prompt and the time it takes to source ...
0
votes
1answer
16 views
Ways of recovering a missing .bash_history due to a 100% full disk?
Two Putty sessions were opened to a Debian 6 Linux. Log-files led to a full disk. The bash history of the entire shell sessions is missing, and even beyond that (This may be due to a blocked ...
0
votes
1answer
18 views
Unix Terminal: How to disable Trackpad
Is there a terminal command in Mac OS X to disable/enable the mouse? I know that I can disable the trackpad of my MBP when an external mouse is connected. But is this also possible without a ...
0
votes
0answers
18 views
Adding Git repo and branch to Tmux status line
I have found a Tmux configuration file that shows how to add the Git branch to the Tmux status line, however It just shows [[ branch ]] no matter if I am in a Git repo or not. I am not sure if this ...
0
votes
1answer
28 views
Bash readline deleting till the previous slash
In bash emacs mode, is there anyway to delete till the previous slash character?
For example if i entered the command cp /usr/local/bin/reallylongincorrectfolder ...
0
votes
1answer
24 views
Pipe bash commands
I'm trying to download a tar.gz package with wget, decompress it and rename the decompressed directory all in one (piped) command.
My attemps were:
wget -O- $URL | tar fvxz - -C $DEST
wget -O- $URL ...
0
votes
1answer
58 views
arch linux update - Binaries move to /usr/bin requiring update intervention
I just botched the latest update for arch linux. Here's what I did:
pacman -Syu --ignore filesystem,bash
reboot
So I logged out before running:
pacman -S bash
pacman -Su
Now I see this:
sh: ...
0
votes
1answer
34 views
Bash terminal lacking functionality when running as non-root
I'm running a command-line Debian system, accessed via SSH through PuTTY, and am experiencing differing terminal functionality between root and other users.
When logging in as root, the terminal ...
3
votes
3answers
55 views
Spawning multiple parallel wgets and storing results in a bash array to be pretty printed when all wgets are done
I have a long list of urls on my own website listed in a carriage return seperated text file. So for instance:
http:/www.mysite.com/url1.html
http:/www.mysite.com/url2.html
...
1
vote
1answer
28 views
Bash and Ubuntu Commands
I have a problem with bash currently. I have Ubuntu 10.04 installed on a server I ssh into to do Rails development and something happened and now I am unable to use RVM as it is installed. The error I ...
0
votes
1answer
32 views
Using Mac OS X terminal to copy a selection of folders to a new location, with merge behavior
I have a folder 'foo' that contains a lot of sub folders, e.g.
foo
|---20101
|---20102
|---20103
|---20111
|---20112
|---20113
There are way more than this, but hopefully it explains the ...
-1
votes
0answers
16 views
subprocess.call() OSError:[error 2] no such file ore directory when running shell file from python [closed]
sudo bash snapshot.sh works just fine from terminal but when i wrote it in python
im using subprocess.call(["sudo bash snapshot.sh"]) it give me this error.
snapshot.sh contain one line that is ...
1
vote
2answers
41 views
How to merge ls commands colors with the output of find or du?
I have a simple alias to list the size of files&folders in cwd.
( including dotfiles in this case , ignoring zero sizes )
du -sh .[!.]* * | sort -hr | grep -v '^0'
which can be achieved ...
1
vote
1answer
23 views
Open multiple tabs in iTerm2 with a specific directories
I would like to know if this is possible.
I want to set up some script or command that will open 5 tabs and each tab that will open will have their own directory specified
All in the same window
...
-1
votes
1answer
27 views
Set the title for bash Terminal on mac OS X to current working directory [closed]
I know they have been asking a lot of this question and I got it worked perfectly, but one thing I don't understand is why this is different.
#This will show the full path (/usr/bin)
...
