Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bash]

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

0
votes
0answers
8 views

Is there any way to define common alias both on windows and on linux(windows bash or cygwin)?

I am using "Window Command shell" and "Bash shell" in windows system. What is really annoying me on this, I have to define alias for each shell (doskey & alias), even I am using same command &...
1
vote
0answers
31 views

Running a process in the background

I have 2 questions about starting the processes in the background: Why does starting a process in the background like so: ./my_program & (my_program have exe permission set of course) doesn't ...
2
votes
1answer
19 views

“__bp_preexec_invoke_exec: No such file or directory” when using $_

I am trying to create a new directory and simultaneously switch to it in one line command on Bash using mkdir repo && cd $_. This has worked well for me previously on all Linux distros but now ...
0
votes
1answer
22 views

Average of multiple numbers - Shell script

I have created a script which views a logfile and greps for a specific amount of milliseconds / seconds. I have created something which views the minimum and maximum value however I need to find the ...
0
votes
1answer
27 views

Bash script, get number of physical cores as number and iterate

I wrote a script that shows a number of physical cores of the machine. However, I would like the result to be a number, not a string. Here's the script: phycores=echo $sudoPW | cat /proc/cpuinfo | ...
0
votes
1answer
44 views

“no such file or directory” when converting videos to new folder structure

I am trying to copy a large archive of videos (sitting in subfolders) to a parallel folder structure while converting the videos from mov to mp4 (plus some other tweaks). This is the command: for f ...
1
vote
2answers
103 views

Start process in background at keybind (append `& disown` on Ctrl+Enter)

Let's say I want to open Chrome, Sublime Idea, etc. from the command line while maintaining the control of the terminal. Is there a way to append & disown to the command in Bash when you press ...
0
votes
0answers
21 views

Why does symlink to VLC break but but .bash_profile alias works?

problem I can execute VLC from the command line using a .bash_profile alias but not using a sym link. 📝 VLC is located at /Applications/VLC.app/Contents/MacOS/VLC on my machine sym link I tried ...
0
votes
0answers
32 views

-iname parameter in find doesn't works correctly in Cygwin

I have a Cygwin 2.893 x64 installation in a Windows Server 2016. If a run this command: find "$(pwd)" -type f -iname *.jpg the output show only the files with jpg extension (case SENSITIVE) when i ...
-1
votes
2answers
24 views

Bash Command Substitution doesn't work

This is the script: #!/bin/bash thedate=$(date) var='Current date is $thedate' echo $var The output is Current date is $thedate and I'd like to make it show the date,what did I do wrong? ...
0
votes
0answers
20 views

use $file variable as input to bash script

If I try to use a for loop on the above script (which I called exon.sh) to define $file I get empty output. If I use echo I can see each .xtx is read into $file. for file in path/to/*.txt ; do ...
1
vote
2answers
41 views

Changing directory in script doesn't change directory — why?

I've seen this answer since searching for this, but initially I wrote this script: for i in `seq 1 $1`; do cd ../; done; It doesn't change directory. Why is this, running as ./updir.sh 5
16
votes
6answers
3k views

How to compare parts of files by hash?

I have one successfully downloaded file and another failed download (only the first 100 MB of a large file) which I suspect is the same file. To verify this, I'd like to check their hashes, but ...
0
votes
0answers
7 views

.inputrc bindings sporadically not working

I have the following entries in my ~/.inputrc file: "\e[A": history-search-backward "\e[B": history-search-forward Normally, this works fine. For example, if I type 'ss' then press up or down, I can ...
5
votes
1answer
52 views

Why does du -b show a different result than stat?

I've recently ran into this problem: find /tmp/tmp33hn25wv -type f -exec stat --format='%s' {} + | awk '{s+=$1} END {print s}' 10420224 du -bs /tmp/tmp33hn25wv 12198004 /tmp/tmp33hn25wv Results ...

15 30 50 per page