Bash is the shell from the GNU project. It is the standard shell on many Linux distributions and often available on other *NIXes.
0
votes
1answer
10 views
replacement inside parallel command string
I want to download multiple files and save them to the md5 sum of its name:
cat list | parallel -j4 "md5=$(wget -O - {} | tee tmpfile_{#} | md5sum | cut -d ' ' -f 1); mv tmpfile_{#} $md5"
but the ...
0
votes
1answer
25 views
Multiple option arguments using getopts (bash)
Stuck here and need some help. Thank you in advance. ~Chris
I am trying to process command line arguments using getopts in bash. One of the requirements is for the processing of an arbitrary number ...
4
votes
2answers
56 views
How to cycle through reverse-i-search in BASH?
In the terminal, I can type CRTL+R to search for a matching command previously typed in BASH. E.g., if I type CTRL+R then grep is lists my last grep command, and I can hit enter to use it. This only ...
2
votes
2answers
36 views
How to adjust column width in Linux command output
When I used this command on Red Hat Linux
/usr/sbin/ss -i
I get the following output below:
State Recv-Q Send-Q Local Address:Port ...
2
votes
2answers
47 views
List all my variables
I'm just learning the basics, including how to declare and mess around with variables. Is there a simple way to display a list of all the variables I've named? (Everything I've found by searching only ...
3
votes
3answers
52 views
CD into directory from HISTORY in a bash script or alias e.g. $(!!)
I often want to change into the directory of a file on my file system, but I'm not sure where the file is.
I search for it like so:
find | grep myfile.txt
Lets say for the sake of simplicity, ...
4
votes
2answers
63 views
What does which's --tty-only option do?
I just realized that my sysadmin has created a global alias for which:
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
The which manpage just says:
Stop ...
1
vote
4answers
59 views
Problem understanding 'hash' command in a .sh file
So I wanted to install etherpad lite on a linux machine.
If I try to run it, I will get the Error "Please install node.js ( http://nodejs.org )"
the command 'which node' gives me the correct path to ...
2
votes
0answers
46 views
.bashrc alias not working [closed]
I have set up a few aliases in my .bashrc file, like the following:
alias ras='rails server'
alias res='redis-server'
alias rc='rails console'
alias be='bundle exec'
# git alias's are as follows
...
4
votes
2answers
51 views
Combining multiple process substitution
Suppose you tried something like this:
$ paste ../data/file-{A,B,C}.dat
and realize that you want to sort each file (numerically, let's suppose) before pasting. Then, using process substitution, ...
2
votes
1answer
23 views
how to record command which execute a programme suid
My question: Is there a way to record all commands who execute a suid programme?
Like what .bash_history do, but only the setuid programmes.
1
vote
3answers
57 views
In bash, how can I erase an alias without logout? [duplicate]
I had an alias in my .bashrc and I really don't want it anymore. I erased the alias, but my bash already has this alias loaded.
Can I erase this alias from this bash without logging out?
2
votes
2answers
27 views
Automated partition selection in bash script
I'm trying to write a bash script to run from Linux on a CD or flashdrive that can mount Windows and change stuff, but I don't know how to go about detecting which partition/drive is Windows.
My best ...
1
vote
0answers
30 views
Create adhoc network when disconnected from network
I am using ArchLinux and want to create an AdHoc network automatically when the connection to the home network drops (or the home network can't be connected to on startup). How can I achieve this?
I ...
2
votes
2answers
65 views
Why won't the for loop execute on directory
In the following script, the first for loop executes as expected, but not the second. I do not get any error, it seems that the script just hangs.
HOME=/root/mydir
DIR=$HOME/var
DIRWORK=$HOME/Local
...