Questions tagged [bash]
Bash is a free shell for Unix-like operating systems from the GNU Project.
990
questions
19
votes
4
answers
19k
views
Who deals with the star * in echo *
Who deals (interprets) the * in
echo *
Does the echo see the star or the shell take care about it and return a list of filename ..
What about
cp temp temp*
18
votes
5
answers
46k
views
No such file or directory after typing $PATH in terminal
when I write in terminal
echo $PATH
my output is
:/home/bo/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/sbin:/bin
but when I write just :
$PATH
this output I do not understand right, ...
18
votes
1
answer
6k
views
Dash (-) in front of bash
If I examine my bash shell in an OS X (10.6.4) terminal, such as by typing echo $0, there is a dash in front of my shell, like this: -bash. What does this dash mean?
18
votes
5
answers
16k
views
find files with ACLs set
How can I find all files with some extended ACLs set, i.e. those with a little + at the end of the permission flags shown by ls -l.
I could not find a corresponding flag for find. My naive approach ...
18
votes
4
answers
17k
views
Spawn New Cygwin Window from Within Cygwin
I can't figure out how to launch a new Cygwin session from within Cygwin, similar to launching a new terminal from within bash with:
gnome-terminal
It's probably easy but I am missing something. ...
18
votes
2
answers
25k
views
Mounting network drive in Windows 10 bash?
In my windows 10 command prompt, when I need to set the drive to some network shared drive I just use
net use V: //192.168.xxx.xxx/folder
I added Bash on Ubuntu on Windows in my Windows 10, and I'd ...
18
votes
1
answer
46k
views
How to permanently add current directory to PATH in Linux? [duplicate]
Possible Duplicate:
Add folder to PATH
I want to a add a directory to my bash to search in, and I am using the $PATH=.... it works however when I open a new command window it is not there.
How ...
17
votes
3
answers
33k
views
bash commands that don't fit on one page - make output scrollable
Probably been answered somewhere, but its difficult to frame the search phrase.
I am running a bash terminal window and some commands are too big to fit on the page (e.g. ps -A)
I vaguely recall a ...
17
votes
8
answers
9k
views
Windows 10 linux bash shell ctrl+space doesn't set mark in Emacs
In Windows 10 I installed Subsystem for Linux Bash. But I have a problem with shortcut in Emacs Ctrl+space doesn't set mark point.
What i tried and didn't help:
I tried to uncheck "enable Ctrl key ...
17
votes
2
answers
45k
views
How to change the resolution of the Bash for a Debian VM?
I'm trying to learn how to use Linux with a Debian 7 VM that has no GUI.
The 640x400 window I'm working in feels a little constricting and would like to make it bigger, say 1024x768.
How can I do this?...
17
votes
2
answers
3k
views
Is there a way of using ctrl-r after typing part of command in bash?
In bash the Ctrl+r command is very useful, I type Ctrl+r whatever and it searchs my history for commands containing the word whatever. But if I type whatever and realize that I would like search that ...
17
votes
2
answers
7k
views
Is it possible to run a bash script in a sort of sandbox?
Our product has a need to execute an unknown bash script on a delicate server in order to achieve a certain goal. This bash script is user-supplied. We are interested in ensuring that only specific ...
17
votes
1
answer
7k
views
Redirect stdout/stderr of a background job from console to a log file?
I just run a job (assume foo.sh).
./foo.sh
[Press Ctrl-Z to stop]
bg # enter background
And it generate output to stdout and stderr.
Is there any method to redirect to stdout and stderr to other ...
17
votes
4
answers
46k
views
Using Wget to Recursively Crawl a Site and Download Images
How do you instruct wget to recursively crawl a website and only download certain types of images?
I tried using this to crawl a site and only download Jpeg images:
wget --no-parent --wait=10 --...
17
votes
4
answers
28k
views
Where is the Windows bash directory in Windows?
I've installed the Windows 10 Anniversary Update on my computer.
I would like to know where the /root directory in Bash prompt is within Windows?
I would like to be able to write files in Bash that ...
17
votes
2
answers
38k
views
Bash, how to globally fix ^H and ^? backspace problems
I'd like to fix this frequent problem where the shell on a remote server thinks my terminal's backspace key is ^? and sometimes it thinks it is ^H, and happens to be incorrect and outputs the wrong ...
17
votes
5
answers
21k
views
Windows 10 WSL (bash) and mintty
I just installed the new Linux subsystem in Windows 10. It's really nice to have access to the Ubuntu repositories, but I absolutely HATE the default terminal program. Cygwin comes with MinTTY which ...
16
votes
5
answers
21k
views
Open Google Chrome Specific Profile From Command Line Mac
I have been trying to open Google Chrome from command line but with no luck! I have tried How do I start Chrome using a specified "user profile"?
My goal is to open Google Chrome with a ...
16
votes
7
answers
31k
views
Running a bash background process on Windows 10 without an open terminal
I usually use the linux subsystem when I'm programming anything on Windows 10 so all my paths are relative to ~. I have a python script that runs forever in the background until I kill the process. ...
16
votes
4
answers
64k
views
How to sign into "root" account by default on Windows Subsystem for Linux Bash terminal
Windows 10's Anniversary Update just came out and I immediately installed the Windows Subsystem for Linux to see how it fares. I found only one major shortcoming so far: there was no obvious way to ...
16
votes
8
answers
27k
views
Setting ID3 title tag to be equal to MP3 file name
Has anyone got a bash script that will go through a media library and set the id3 title tag of each MP3 file to be equal to the file's name?
I'm open to other automated methods too. It can be a GUI ...
16
votes
1
answer
70k
views
How do I list all installed packages from the command line in bash / osX
What is the -bash command to list all the packages installed locally on my machine?
I am using osX.
I tried the following so far:
dpkg -l - doesn't work.
apt --installed list - doesn't work.
...
16
votes
2
answers
7k
views
What bash < < syntax mean?
Ruby Version Manager (RVM) installed like so:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
I understand what first < mean (feeds bash ...
15
votes
10
answers
24k
views
Linux: rename file but keep extension?
In Windows/DOS, I can say rename myfile.* yourfile.* to change the name but keep the extension. How is that accomplished on Linux?
The man page only suggests how to change the extension, but that's ...
15
votes
1
answer
6k
views
screen - move cursor to beginning of line
In bash I can usually move the cursor to the beginning of the line using CTRL+a.
In screen, CTRL+a is being used for the special screen-commands.
How can I a) use another key-combination for the ...
15
votes
6
answers
45k
views
Mounting a remote filesystem on Windows 10 using Bash
Now, that windows 10 is out I started wondering about something. Unix based systems have the possibility to mount remote filesystems using ssh. In a recent article I've read that Windows 10 Has ...
15
votes
3
answers
6k
views
Is there a shell which supports fuzzy completion as in Sublime Text?
I'm using bash and I was wondering if there is any plugin in bash or other shell which allows me to do this
cat tfnislong.txt + [tab] completes to cat ThisFileNameIsSoLong.txt just like tab completion ...
15
votes
3
answers
17k
views
Stop a Mac from sleeping while a bash script is running, then allow it to sleep as normal once complete
I've got my Mac to wake up during the night and run an rsync to back it up. This is configured through Energy Saver > Schedule.
However it seems that it's going back to sleep before it can get ...
14
votes
6
answers
17k
views
Custom vim highlighting
I am editing some xml right now and I have been leaving myself some comments of things to come back to. Like this
<!-- Question: bla bla -->
I am editing with vim right now and I would like ...
14
votes
3
answers
14k
views
When cloning on with git bash on Windows, getting Fatal: UriFormatException encountered
I am using git bash
$ git --version
git version 2.9.3.windows.1
on Windows 7. When I clone a repo, I see:
$ git clone https://[email protected]:5555/scm/repofolder/repo.git
Cloning ...
14
votes
2
answers
21k
views
Can't ping in Bash on Windows
When I try to run:
ping www.google.com
I get the following error:
ping: icmp open socket: Permission denied
Running with sudo doesn't make a difference.
14
votes
2
answers
7k
views
How does Mac OS X set the value of $PATH?
I have a basic understanding on how the $PATH can be set, but is there a documentation that fully describes where Mac OS gets all the paths that get appended to $PATH? I'm aware of things like /etc/...
14
votes
2
answers
69k
views
How do I see all previous output from a completed terminal command?
I've executed a command in gnome terminal that printed more output to the terminal than I expected. I'd like to read the entire output, but the terminal scroll stops before reaching the beginning.
I ...
14
votes
14
answers
68k
views
Scripting: what is the easiest to extract a value in a tag of a XML file?
I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example:
<?xml version="1.0" encoding="UTF-8"?><project
xmlns="http://maven.apache....
14
votes
2
answers
14k
views
How can I make a Windows shortcut that launches Bash and runs commands?
I've created a windows shortcut with a target that looks like
"C:\Windows\System32\bash.exe" php /c/script.php
(I know I could just use my windows verison of php cli to run this, but out of ...
14
votes
5
answers
19k
views
Must I sftp to an intermediate server?
I can't sftp directly into a particular host. To move a file from my home machine to the host, I must sftp a file to an intermediate host; ssh into the intermediate host; and sftp the file to the ...
14
votes
4
answers
15k
views
How do I fix my prompt in emacs shell-mode?
I'm doing some programming on a colleague's machine. He has a version of emacs (23.1.1) I haven't used before. My problem is that when I go to shell-mode, my bash prompt looks like this:
^[]0;jay@...
14
votes
4
answers
20k
views
What does `>>` mean in terminal command?
I came across a command just now given below -
$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile
From what i can guess, it is probably used for committing the changes in .bash_profile but ...
14
votes
1
answer
33k
views
ssh + sudo + su into login shell
I have several machines I ssh into regularly only for the purpose of using sudo su to spend the rest of my session logged in as some special-purpose user. The general workflow is:
mymachine:~ me$ ssh ...
14
votes
3
answers
27k
views
Linux: View and kill disowned process
I have started a program in Linux using & and disown.
I wish to see if it is still running and possibly to kill it.
I started the process with commands like these:
(env)bash-4.2$ python manage....
13
votes
3
answers
4k
views
Is it possible to check whether -e is set within a bash script?
If a shell function needs a specific setting of -e/+e in order to work, is it possible to set that setting locally and then restore it to its previous setting before exiting the function?
myfunction()...
13
votes
2
answers
10k
views
how to export variables back to the parent process
I'm try to export variables back to the parent process.
$ export VAR=FALSE
$ echo $VAR
FALSE
$ ./myprogram # this will set VAR=TRUE
$ echo $VAR
TRUE <========== I want to print `TRUE` here
13
votes
3
answers
41k
views
How to delete all hidden .swp files from terminal
How can I delete all .swp files? I tried rm *.swp but I got rm: *.swp: No such file or directory
rwxr-xr-x 16 teacher staff 544 Jan 17 13:19 .
drwxr-xr-x 19 teacher staff 646 Jan 16 12:48 .....
13
votes
3
answers
38k
views
Connect to WiFi network using Mac Terminal
Every time I try to find out how to do this, I find out how to do it on a linux, and it doesn't transfer. How do I connect to a WiFi network using Mac Terminal Bash?
13
votes
2
answers
22k
views
Throttle CPU based on Temperature? - Ubuntu
I was running some programs on my Ubuntu machine that use max CPU power for extended periods of time. This causes the computer to overheat.
Could someone suggest a good program that will throttle ...
13
votes
3
answers
2k
views
What does . .bashrc actually do?
When I enter a eg. a new alias into my .bashrc file I can't use it in that terminal window immediately and until recently I thought I had to restart the terminal to reload the .bashrc file. Then I ...
13
votes
2
answers
2k
views
Making bash TAB completion more like cmd.exe [duplicate]
I wondered if theres a way to do rotational style completion in bash similar to the behavoir on cmd.exe, I've found it speeds me up in regard to entering commands
13
votes
4
answers
3k
views
Bash shell tab completion, don't expand the ~
I use the Tab key a lot when I use the shell (bash).
But I'm getting annoyed that ~ always gets expanded to /home/"user". I don't think it's always been like this; is there any way to stop this ...
13
votes
8
answers
5k
views
Save me from gibberish terminal
While logged in to a remote ssh session, sometimes I do cat to the wrong file (a binary or a diretory) and the display converts to gibberish. The only way out is to close the terminal and open a new ...
13
votes
3
answers
11k
views
Is it possible to put foreground process into background without suspending (control +z)?
I am running an application which receives TCP and UDP packets and therefore cannot be suspended. I intially ran 3 processes of the same application, with different arguments, in background mode using ...