Bash is a free shell for Unix-like operating systems, from the GNU Project
0
votes
0answers
35 views
“You have a new mail” when there are now new emails [duplicate]
My bash says me "You have a new mail" every time I connect to my server. I am not sure why, but my mutt is set to read my /var/mail/user and I'm sure I don't have any unread message inside.
What is ...
0
votes
1answer
48 views
cygwin AtlGr+pipe key not working as a pipe but as a split vertical bar
In cygwin with Windows 7, when I type AltGr+backtick key, I expect a | pipe sign to be typed, but instead I get a pipe that is split in the middle ¦, which won't act as a pipe sign in cygwin.
How can ...
0
votes
1answer
27 views
sfdisk partition size in bytes
Kind of homework related so further reading is always appreciated!
Using sfdisk I have to specify the size of certain partitions in bytes.
For this I used
sfdisk -lub /dev/sdd
Which lists the ...
0
votes
1answer
36 views
Unable to run test.sh file through project.php inside /var/www/
test.sh's path is /var/www/proj/test.sh, and project.php is inside /var/www/ and my test.sh uses and creates some .txt files.
when i execute test.sh through terminal it works fine, but when I run ...
0
votes
1answer
24 views
Having Trouble Sending Arguments To Mintty/Cygwin
Simply put, I would like to have a shortcut on Windows which can open up a terminal window just like clicking the Cygwin shortcut normally does, but in a different location from the default.
The ...
-2
votes
2answers
40 views
How to run apache server if it not already running
I wonder if it is possible to check whether or not apache2 is running. If it is not running I want to execute it using shellscript
Currently I have added a function which I named run_apache which ...
2
votes
1answer
43 views
Suppress (or quiet) the output of bash: “Hit any key to close this window…”
Typically when I invoke an GUI application in vim, I get a command prompt that awaits for my response:
shell returned 1
Hit any key to close this window...
How can I not make this prompt to show ...
0
votes
1answer
43 views
gVim does not source .bashrc, .bash_profile, or .profile from non-interactive non-login shell
I have the following on my .vimrc
set shell=C:/cygwin/bin/bash
set shellcmdflag=-c
set shellxquote=\"
So the shell I am using is non-interactive and non-login.
I thought that non-login shells ...
0
votes
1answer
54 views
How close to death is my Linux hard drive [duplicate]
I want to test my hard disk that is on opensuse 12.2 -
update see some results below
I have installed S.M.A.R.T.
How would you start the tests?
note: can I run a single test that runs all the ...
1
vote
2answers
76 views
bash - Sending simulated keystrokes
I've recently been trying to write a script that can be used to automate my c++ program in bash. If you know AutoIt, I can simply show you an example of what I am trying to do:
send("1{enter}")
or
...
3
votes
3answers
402 views
On Linux, how can I find all files that contain a string and delete them?
I want to delete all files that contain the string foo. How can I do this using bash in Linux?
-1
votes
0answers
41 views
android samsung galaxy s 2 root terminal [closed]
Hi can anybody help me Im trying to open a text file from with in a terminal window but not so it opens in the terminal but more like ive just clicked on it so my question is?
How do i open a text ...
0
votes
2answers
56 views
Script to auto execute creation of ssh tunnel
I'm a CS student, and still learning a lot of these things, and so please bear with me if I don't have a full grasp on what I'm trying here.
I'm on a Mac, connecting to a linux machine. I can set up ...
1
vote
1answer
21 views
TMUX: Configure length of titles
I have tmux configured to show my current working directory for each window (it gets this from bash)
The problem is, sometimes the directory names get too long and it takes up a lot of space.
In ...
0
votes
0answers
19 views
Loop through folder with higher space usage in shell? [duplicate]
I would like to create an script where give me a report of which folders have the higher usage space and keep doing that until there's no folder anymore.
Today I do this manually, with:
sudo du -h ...
0
votes
1answer
83 views
how do I preserve export PATH?
How can I make ssh admin@nas command work if command is in /opt/bin?
On my QNAP NAS File /root/.ssh/rc:
echo "old path is $PATH"
export PATH=/opt/bin:/opt/sbin:$PATH
echo "new path is $PATH"
on my ...
1
vote
2answers
44 views
Newlines while saving variable to file - bash
I have mulitiple ip adresses in a variable.
ActiveIPs= 192.168.0.1 192.168.0.2 192.168.0.3
I want to save them to a file like this
192.168.0.1
192.168.0.2
192.168.0.3
how do i do this?
0
votes
1answer
31 views
How to make an alias and work in sh for all users (not in bash)?
My question maybe is silly, but how can I make an alias so as to work
in sh for all users?
I know that I can put an alias, let say this one:
alias ls='ls -l'
in /etc/bash.bashrc so as to work in ...
0
votes
0answers
8 views
Bash history lost [duplicate]
My bash history in cygwin is lost between two consecutive shells.
Here are the outputs of some commands that might help to understand the issue:
set -o | grep history
history on
$ grep -i ...
-2
votes
0answers
48 views
Error when using Chef on OS X: “bash: chef-solo: command not found” [closed]
I have chef installed on my local machine: Mac OS X 10.8.3
I also have chef installed on a remote server: Ubuntu 12.10 x64 Server
On the local machine, when I try to execute a command using ssh ...
1
vote
1answer
32 views
How to print a bash history command and append it to a file?
You can print a command with:
!2500:p
But how do I append that command to a file? I thought:
!2500:p >> .bashrc
But that just prints everything including the ">> .bashrc" to stdout.
0
votes
4answers
62 views
No bashrc file in my home directory
Here is what I noted down from my lecture:
Find file .bashrc in your home directory
do vi .bashrc
When you put an application folder somewhere, make sure that its address is in the
path variable.
...
2
votes
2answers
117 views
How to persist bash history?
I don't know if this is expected, but my history is not saved across sessions. This is to say, if I close the window, then when I open it again, the history is empty. How can I persist it across ...
0
votes
2answers
85 views
Why does my ssh session terminate immediately?
I have a debian machine, where I have difficulties to log into via ssh. Executing commands on the server over ssh is no problem -- just I get no prompt, but the connection is terminated again:
> ...
2
votes
2answers
44 views
How do I investigate commands being run when changing directories?
I see “awk”, “find”, “sed”, and “which” momentarily appear in my Terminal window's title when changing directories. (And not all of these always appear and there could be some I'm missing; I imagine ...
2
votes
1answer
67 views
Difference between / and // directories in bash OSX
I was working in the bash terminal on my system (OSX 10.8.3 / bash version 3.2.48(1)-release (x86_64-apple-darwin12)) and I accidentally typed "cd //" instead of "cd /" to get back to the root ...
2
votes
1answer
43 views
copied chroot jail directory cant be chrooted
I am developing a package so when users login through ssh they are forwarded to a chroot jail.
The jail directory is created via makejail program on building process.
But when the jail package copy ...
0
votes
1answer
37 views
bash tab-completion list below prompt
Whenever I use tab-completion, the list of possibilities is displayed and the prompt is duplicated below (| indicates the final cursor position):
$ vim ~/.<TAB>
./ ../ .bashrc .vimrc
$ ...
0
votes
3answers
70 views
How do you install Bash or Bash utilities on Windows? [duplicate]
How can I install Bash for Windows so that I can use its utilities, such as grep, vim, and gcc with minimal amount of work in editing the environment variables to include them all. I'd like to do this ...
2
votes
1answer
59 views
Opening a Terminal for the current bash script, if it wasn't started in one
How can I get a script to re-launch itself in a Terminal window if it wasn't started in one?
Based on this question, I've tried, in a file called testterm marked executable:
#! /bin/sh
if [ -t 0 ]; ...
0
votes
1answer
33 views
Colorize ls-output by filetype [duplicate]
Every once in a while I have to list some files (~20-50) in Bash on Linux || Mac.
These files are from four different filetypes.
ls nand2tetris/myChips/
And16.hdl And16.cmp And16.tst ...
1
vote
0answers
31 views
Cron job not abiding by the nice command
I got a script that backs up minecraft worlds, when ran by command (nice -19 ./backup.sh) it doesn't lag what so ever, server load stays low. When I try to do nice -19 ./backup.sh in a cronjob, it ...
2
votes
3answers
197 views
How to use Cmd's tab autocomplete effectively?
I've used the Bash shell on Linux for years and I'm very fast with it. By frequently appealing for autocomplete by hitting the tab key, I'm able to write long commands in few keystrokes.
Recently at ...
0
votes
1answer
61 views
Linux: How to eval the contents of STDOUT?
Consider you have a file with some sort of terminal command. How might each line be executed? Can you pipe the output of more into an eval?
%> more ./foo.txt
Edit:
After some help/guidance ...
0
votes
1answer
20 views
Opening a Terminal window with the current directory set to a specific directory
I want to set up a keyboard shortcut in Shortcuts that opens a Terminal window already cd'd to the desktop. I've tried
Terminal ~/Desktop
Terminal cd ~/Desktop
But these don't work. Terminal ...
0
votes
2answers
50 views
Create from bash an image from a Windows / Linux partition
I want to make an image with existing Linux tools from the bash console. Can somebody tell me how to accomplish this task?
Let's assume /dev/sda including its master boot records need to be backed ...
3
votes
0answers
55 views
How can I get zsh to display international characters properly?
I just started using zsh, and love it. However, I've stumbled upon an annoyance when it comes to international characters:
➜ ~ touch åäö.txt
➜ ~ ls
...
0
votes
2answers
48 views
Deleting all word occurences with sed preserving linefeed
I'm trying to delete a word's all occurences in a text file with sed. I have this file f1:
alma a fa
alatt
nyari piros alma
and I'd like to delete all occurences of "alma". I use the ...
0
votes
1answer
32 views
Citrix-XenApp Error (SSL-Server 61) with FF on OpenSuse 12.2: how to bypass?
good day dear Superuser,
I am trying to utilize Citrix XenApp to remotely access my work
userid and applications from home. I can login and see my virtual
desktop/applications, but when I try to run ...
0
votes
1answer
35 views
cat command outputs the whole directory when used in a bash script
I have a scirpt like this:
#!/bash/bin
file=`cat /proc/net/arp`
echo $file
And when I run the script it outputs the whole folder where the script is like this:
IP address HW type Flags HW address ...
0
votes
0answers
39 views
Name of Rake task in ps output?
pid = `ps -ef | grep -v grep | grep rake | awk '{print $2}'`
This is a bunch of ruby code that executes piped linux commands. While I usually just use ps aux, just because, I noticed that the rake ...
1
vote
3answers
79 views
How to truncate the streaming output of a redirect?
I have a process that outputs a line for every progress update (sidenote: it does clear/replace the line, no pure newline break).
I want to save the latest line of that process to an output file or ...
1
vote
1answer
31 views
Load a page without loading a cached page
Here is the situation I have. I have a page that is generated using a bash script (basically echo and some other command >> a html file). I have a link to this page. If I "clear private data" or never ...
1
vote
0answers
31 views
Can't seem to connect to Win 7 share with smbclient 3.5.5 on Haiku
I did the registry mods mentioned here but cannot seem to connect. I say seem to, because there's no error message.
smbclient \\\\WIN7MACHINE\\ -U myusername
smbclient \\\\WIN7MACHINE\\ -U%
...
-1
votes
2answers
53 views
Replace all numbers following a specific string with another number using sed or awk
I have tried several things but got no luck. I have an input file that has a lot of fields like this one
weight=0.123456
mixed with other fields. I want to multiply all such weights by a factor, say ...
1
vote
1answer
71 views
grep with colored output returns several empty lines
I have strange issue with grep (2.12-2, debian testing).
In some situations when I do something like this:
grep -rni '."spacer">.' . grep return me several empty lines:
If I add --color=none ...
1
vote
1answer
46 views
What determines the process name in ps aux?
I'm trying to track down this script called ./launch.sh, that on my machine is currently in an infinite loop in which it calls a Java program, immediately crashes, then sleeps for 3 seconds.
ps aux ...
2
votes
1answer
43 views
Bash: find directory group owner
I am sure this is easy but i cant find it.
I am writing a bash script where i want to add a known user to a group.
The group name is determined by the directory, which is sent through as a variable ...
0
votes
1answer
69 views
Program to check/look up UTF-8/Unicode characters in string on command line?
I've just realized I have a file on my system; it lists normally:
$ ls -la TΕSТER.txt
-rw-r--r-- 1 user user 8 2013-04-11 18:07 TΕSТER.txt
$ cat TΕSТER.txt
testing
... yet, it crashes a piece of ...
1
vote
1answer
30 views
ESC and Caps Lock get swapped to original mapping after loading bashrc twice
I followed xmodmap way of swapping ESC and Caps lock in this link. It works well when I load .bashrc with . ~/.bashrc for the first time. However, if I edit different part of my .bashrc and reload it ...
