Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
6
answers
60
views
Check if multiple files exist on a remote server
I am writing a script that locates a special type of file on my system and i want to check if those files are also present on a remote machine. So to test a single file I use: ssh -T user@host [[ -f /path/to/data/1/2/3/data.type ]] && echo "File exists" || echo "File does not exist"; But since I hav...
I am writing a script that locates a special type of file on my system and i want to check if those files are also present on a remote machine.
So to test a single file I use:
ssh -T user@host [[ -f /path/to/data/1/2/3/data.type ]] && echo "File exists" || echo "File does not exist";
But since I have to check blocks of 10 to 15 files, that i would like to check in one go, since I do not want to open a new ssh-connection for every file.
My idea was to do something like:
results=$(ssh "user@host" '
for file in "${@}"; do
if [ -e "$file" ]; then
echo "$file: exists"
else
echo "$file: does not exist"
fi
done
' "${files_list[@]}")
Where the file list contains multiple file path. But this does not work, as a result, I would like to have the "echo" string for every file that was in the files_list.
Nunkuat
(123 rep)
Aug 6, 2025, 12:31 PM
• Last activity: Aug 6, 2025, 03:31 PM
3
votes
1
answers
196
views
Why SIGTSTP (^Z/Ctrl-Z/suspend) doesn't work when process blocked redirecting write into a FIFO/pipe not open for reading yet? And what to do then?
Sometimes, a command is stalled attempting to write to a FIFO/pipe that no other process is currently reading from, but typing Ctrl - Z to put the process to the background by sending it the SIGTSTP signal (i.e. the *suspend* non-printing control character `^Z`) does work. Example: $ mkfifo p $ ll p...
Sometimes, a command is stalled attempting to write to a FIFO/pipe that no other process is currently reading from, but typing Ctrl-Z to put the process to the background by sending it the SIGTSTP signal (i.e. the *suspend* non-printing control character
^Z
) does work.
Example:
$ mkfifo p
$ ll p
prw-rw-r-- 1 me me 0 Jul 30 16:27 p|
$ echo "Go!" >p # Here &
has been forgotten after the >p
redirection
(stalled)
[Ctrl-Z]
^Z # Pressing Ctrl-Z just prints "^Z" on the terminal, nothing else happens
[Ctrl-D] # Attempting to send the EOF character
(nothing) # Doesn't print "^D" and does nothing
and this is the behavior even though SIGTSTP (or susp
) is reported to be attached to ^Z
:
$ stty -a
speed 38400 baud; rows 24; columns 91; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ;
swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc
-ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
-flusho -extproc
How comes that in this case the terminal does not catch and transmit to the process the SIGTSTP signal generated by the Ctrl-Z? Is it because redirecting with >
to a FIFO/pipe puts the terminal in raw mode (cf. The TTY demystified )? But if so, why does "^Z" get printed on the screen, and why Ctrl-D (EOF) doesn't print anything and yet doesn't have any effect either?
Incidentally, is there an alternative way to send the stalled process to the background in such cases (instead of just terminate the process with Ctrl-C (i.e. ^C
/ SIGINT)?
The Quark
(402 rep)
Aug 5, 2025, 08:47 AM
• Last activity: Aug 5, 2025, 12:02 PM
3
votes
6
answers
457
views
Awk prints only first word on the field column
Please see my linux bash script below. I can't achieve my target output with my current code. It keeps reading the whole column 4. input_file.txt: REV NUM |SVN PATH | FILE NAME |DOWNLOAD OPTIONS 1336 |svn/Repo/PROD | test2.txt |PROGRAM APPLICATION_SHORT_NAME="SQLGL" | 1334 |svn/Repo/PROD | test.txt...
Please see my linux bash script below. I can't achieve my target output with my current code. It keeps reading the whole column 4.
input_file.txt:
REV NUM |SVN PATH | FILE NAME |DOWNLOAD OPTIONS
1336 |svn/Repo/PROD | test2.txt |PROGRAM APPLICATION_SHORT_NAME="SQLGL" |
1334 |svn/Repo/PROD | test.txt |REQUEST_GROUP REQUEST_GROUP_NAME="Program Request Group" APPLICATION_SHORT_NAME="SQLGL" |
my code:
# /bin/bash
REV_NUM=($(awk -F "|" 'NR>1 {print $1}' input_file.txt))
COMPONENT=($(awk -F "|" 'NR>1 {print $3}' input_file.txt))
DL_OPS="$(awk -F "|" 'NR>1 {print $4}' input_file.txt)"
#LOOP
REV_NUM_COUNT=${#REV_NUM[*]}
for (( x=0 ; x<$REV_NUM_COUNT ; x++ ))
do
echo "${COMPONENT[x]} ${DL_OPS[x]}"
done
actual output:
Exporting Component from SVN . . .
test2.txt PROGRAM APPLICATION_SHORT_NAME="SQLGL"
REQUEST_GROUP REQUEST_GROUP_NAME="Program Request Group" APPLICATION_SHORT_NAME="SQLGL"
test.txt
target output:
Exporting Component from SVN . . .
test2.txt PROGRAM APPLICATION_SHORT_NAME="SQLGL"
test.txt REQUEST_GROUP REQUEST_GROUP_NAME="Program Request Group" APPLICATION_SHORT_NAME="SQLGL"
Thank you so much
user765641
(33 rep)
Aug 4, 2025, 02:53 AM
• Last activity: Aug 4, 2025, 07:20 PM
2
votes
2
answers
13759
views
Sorting files using a bash script
I want to write a bash script that would read a file with 2 columns f 2 g 1 s 4 d 5 f 2 g 5 d 9 g 10 h 1 s 5 d 29 My script would actually sort this file based on the first column (alphabet) and produce a file called `alpha_sorted.txt` and then I want it to do the same thing for the numbers and name...
I want to write a bash script that would read a file with 2 columns
f 2
g 1
s 4
d 5
f 2
g 5
d 9
g 10
h 1
s 5
d 29
My script would actually sort this file based on the first column (alphabet) and produce a file called
alpha_sorted.txt
and then I want it to do the same thing for the numbers and name it numbers_sorted.txt
.
The script is meant to be for introductory level so complicating the methods is not advised.
### Update
Using john1024's answer, I have the following problem:
Hasan@HasanChr /cygdrive/c/users/Hasan/Desktop/Bash
$ chmod +x script.sh
Hasan@HasanChr /cygdrive/c/users/Hasan/Desktop/Bash
$ ./script.sh
cat: alpha_sorted.txt: No such file or directory
Here is a screenshot of script.sh

JavaFreak
(93 rep)
Jun 12, 2016, 01:15 AM
• Last activity: Aug 4, 2025, 01:30 PM
1
votes
1
answers
114
views
Shell script with getopt for short and long options -handling option with and without argument
Wanted to run a script -- with option `./myscript.sh -a -g test` -- without option `./myscript.sh -a -g` The script looks like in below snippet, but don't see below script working correctly. The `getopt` for options specified with `::` (like g:: or gamma::) upon parsing g or gamma the passed argumen...
Wanted to run a script
-- with option
./myscript.sh -a -g test
-- without option
./myscript.sh -a -g
The script looks like in below snippet, but don't see below script working correctly.
The getopt
for options specified with ::
(like g:: or gamma::) upon parsing g or gamma the passed argument is moved to end every time includes empty argument user option: --gamma '' -a -- 'test'
.
Refer the output of the script
$ sh optionwithandwithoutarg.sh --gamma test -a
user option: --gamma '' -a -- 'test'
arg info :- --gamma
arg info :- -a
arg info :- --
Alpha flag: true
Beta value: ''
Gamma value: 'default_gamma'
Remaining arguments: 'test'
## Script code used
#!/bin/bash
OPTIONS=$(getopt -o a,g::,b: --long alpha,gamma::,beta: --name "$0" -- "$@")
if [ $? -ne 0 ]; then
echo "Error: Invalid options provided."
exit 1
fi
echo "user option: $OPTIONS"
eval set -- "$OPTIONS"
# Initialize variables
ALPHA_FLAG="false"
BETA_VALUE=""
GAMMA_VALUE=""
while true; do
echo "arg info :- $1"
case "$1" in
-a | --alpha)
ALPHA_FLAG="true"
shift
;;
-b | --beta)
BETA_VALUE="$2"
shift 2
;;
-g | --gamma)
if [[ "$2" != "--" && -n "$2" ]]; then
GAMMA_VALUE="$2"
shift 2
else
GAMMA_VALUE="default_gamma" # Assign a default if no argument given
shift 2
fi
;;
--)
shift
break
;;
*)
echo "Not supported option"
exit 1
;;
esac
done
echo "Alpha flag: $ALPHA_FLAG"
echo "Beta value: '$BETA_VALUE'"
echo "Gamma value: '$GAMMA_VALUE'"
echo "Remaining arguments: '$*'"
How to handle the options with and without argument with getopt
Tim
(113 rep)
Aug 2, 2025, 02:26 PM
• Last activity: Aug 4, 2025, 10:38 AM
-5
votes
2
answers
103
views
Why is arch linux bash better than Ubuntu bash?
Both of them use bash, but the one used on arch linux has way better auto-completion. But why is that? Both of them claim to use normal Bash, so how can that be true? ---- I forgot to clarify that what I meant by Arch linux was it's installation ISO. I have never tried out the actual Arch linux. Als...
Both of them use bash, but the one used on arch linux has way better auto-completion. But why is that? Both of them claim to use normal Bash, so how can that be true?
----
I forgot to clarify that what I meant by Arch linux was it's installation ISO. I have never tried out the actual Arch linux. Also, I have tried ZSH and the auto-completion on ZSH seems similar to the arch bash's. Is it because of an additional package?
---
The differences between Arch's Bash and Ubuntu's Bash is noticeable enough to understand what I'm talking about.
Here is a little example:
cat ./
(The command is not entered)
- **Arch's Bash**: When I press TAB, all possible options are shown in a nice and very organized way, and when I press the down and up arrow keys, it allows me to select from those options.
- **Ubuntu's Bash**: When I press TAB, all possible options are shown, sometimes in a nice and fairly organized way, but arrow keys just scroll between history of commands, not options. Not convenient.
This is one way Arch's Bash is better than Ubuntu's Bash. This is assuming there are not too many options and around 16 options to choose from.
Arch's ISO is the version released on July 2025.
Sul4ur
(9 rep)
Aug 2, 2025, 03:16 PM
• Last activity: Aug 4, 2025, 06:41 AM
1
votes
2
answers
1850
views
Filter out command line options before passing to a program
I am running `cmake` and it is passing a flag to my linker that is unrecognized (`-rdynamic`), and it's causing an error. I cannot figure out where it is getting this flag from, so I want to just filter it out. I can specify `-DCMAKE_LINKER= `, so what I would like to do is set ` ` to a program that...
I am running
cmake
and it is passing a flag to my linker that is unrecognized (-rdynamic
), and it's causing an error.
I cannot figure out where it is getting this flag from, so I want to just filter it out.
I can specify -DCMAKE_LINKER=
, so what I would like to do is set `` to a program that reads its command line arguments, filters out the bad one, and then passes the result back to the actual linker.
I have been using awk '{gsub("-rdynamic", "");print}'
, but I don't know to make the input stdin and the output ld.
RJTK
(123 rep)
Oct 5, 2018, 03:48 PM
• Last activity: Aug 3, 2025, 12:34 AM
13
votes
4
answers
3949
views
Temporarily unset bash option -x
I like to use `set -x` in scripts to show what's going on, especially if the script is going to run in a CI/CD pipeline and I might need to debug some failure post-hoc. One annoyance with doing this is that if I want to echo some text to the user (e.g., a status message or `"I'm starting to do $X"`)...
I like to use
set -x
in scripts to show what's going on, especially if the script is going to run in a CI/CD pipeline and I might need to debug some failure post-hoc.
One annoyance with doing this is that if I want to echo some text to the user (e.g., a status message or "I'm starting to do $X"
) then that message gets output twice - once for the echo
command itself being echoed, and then once as the output of that echo
command.
What's a good way to make this nicer? One solution is this:
set -x
... bunch of normal commands that get echoed
(
# Temporarily don't echo, so we don't double-echo
set +x
echo "Here is my status message"
)
... rest of commands get echoed again
But the two problems with that are
1. That's a lot of machinery to write every time I want to tell the user something, and it's "non-obvious" enough that it probably requires the comment every time
2. It echoes the set +x
too, which is undesirable.
Is there another option that works well?
Something like Make's feature of prepending an @
to suppress echoing would be great, but I've not been able to find such a feature in Bash.
Ken Williams
(235 rep)
Nov 16, 2022, 05:27 PM
• Last activity: Aug 1, 2025, 04:27 PM
38
votes
11
answers
40063
views
Check if script is started by cron, rather than invoked manually
Is there any variable that cron sets when it runs a program ? If the script is run by cron, I would like to skip some parts; otherwise invoke those parts. How can I know if the Bash script is started by cron ?
Is there any variable that cron sets when it runs a program ? If the script is run by cron, I would like to skip some parts; otherwise invoke those parts.
How can I know if the Bash script is started by cron ?
daisy
(55777 rep)
Aug 31, 2012, 09:07 AM
• Last activity: Aug 1, 2025, 12:17 PM
0
votes
1
answers
2602
views
Problem redirecting output to log file and console in bash script
I have a shell script which sucessfully redirects all output to a log file and stdout (console) at the same time. However, when it exits it seems to wait for some user input from the keyboard (experimentally, any key seems to work)... So, I run the script, see the output, it exits and I have to hit...
I have a shell script which sucessfully redirects all output to a log file and stdout (console) at the same time. However, when it exits it seems to wait for some user input from the keyboard (experimentally, any key seems to work)... So, I run the script, see the output, it exits and I have to hit e.g. the spacebar before the terminal prompt re-appears. Typing
echo $?
then gives the correct exit code.
The basics of the script are:
#!/bin/bash
LOG="./test.log"
rm -f $LOG
exec > >(tee $LOG) 2>&1
if [[ "$1" = "T" ]]; then
echo "twas true..."
exit 0
else
echo "twas false..."
exit 100
fi
Any help appreciated... not only do I not want to hit the spacebar but I would like to understand what is going on?
***Amendment***: it appears that I have to hit **enter** to get the terminal prompt back. From my limited experience using the *ps* command it would seem that my script has terminated and the *bash* shell is in the interruptible sleep state **S**. It would appear that maybe the terminal prompt output has been consumed or incorrectly redirected? I cannot see why...
Koorb Notsyor
(15 rep)
Sep 12, 2020, 04:56 PM
• Last activity: Jul 31, 2025, 04:03 PM
0
votes
2
answers
2597
views
Prevent ``/etc/profile.d`` from being sourced on login
I just noticed my environment is behaving erratically because at some point this alias got introduced in ``/etc/profile.d/vim.sh``: $ command -v vim alias vim='__vi_internal_vim_alias' Looking through the files in ``/etc/profile.d``, they’re of no use to me as everything I need is already taken care...
I just noticed my environment is behaving erratically because at
some point this alias got introduced in
`
/etc/profile.d/vim.sh
`:
$ command -v vim
alias vim='__vi_internal_vim_alias'
Looking through the files in `/etc/profile.d
`, they’re of no
use to me as everything I need is already taken care of in my
`.bashrc
`. As a consequence, Bash starts out in an
unnecessarily polluted state after login. I’d like Bash to
completely ignore the directory and just execute `.bashrc
`.
However, as the manpage states it will blindly source everything
in that path before it continues with user controlled rc files.
This is a corporate environment so I have no control over the OS
just my user account.
There’s an option `--noprofile
` but I can’t seem to get it
added to passwd:
$ chsh
Changing shell for philipp.
New shell [/bin/bash]
> /bin/bash --noprofile
chsh: "/bin/bash --noprofile" does not exist
Through SSH I could add `bash --noprofile
` manually but that
becomes tedious as I have dozens if not hundreds of SSH
connections over the course of a regular workday.
It would be ok if I could just make Bash forget those settings at
the top of `.bashrc
` and then continue with a clean environment.
What I would prefer to avoid is having to play whack-a-mole with
whatever definitions `/etc/profile.d
` might possibly add on all
the systems I’m using.
phg
(1915 rep)
Dec 29, 2020, 09:06 AM
• Last activity: Jul 31, 2025, 12:06 AM
3
votes
2
answers
8271
views
How to export proxy in Redhat Linux 7 using the current login credentials?
I need to export proxy on RHEL 7 with the current logged user credentials. I am able to achieve this by adding manually in **.bashrc or .bash_profile.**: export http_proxy=http://username:password@proxy.example.com:6080 export https_proxy=http://username:password@proxy.example.com:6080 The above met...
I need to export proxy on RHEL 7 with the current logged user credentials.
I am able to achieve this by adding manually in **.bashrc or .bash_profile.**:
export http_proxy=http://username:password@proxy.example.com:6080
export https_proxy=http://username:password@proxy.example.com:6080
The above method works fine. But I don't want this method, since we are hard-coding the username and password and also it's not secure.
Is it possible to use the existing **/etc/shadow** file as password for exporting the proxy?
M S
(291 rep)
Apr 22, 2018, 10:23 AM
• Last activity: Jul 30, 2025, 09:07 AM
2
votes
2
answers
389
views
How to test whether a secondary inet address exists on an eth interface?
RHEL9 Sometimes server 1 has the secondary address 10.143.170.80/24, and sometimes server 2 has that secondary address. My script needs to test which server has that secondary address. However, `ip address show dev ${VirtDev} secondary` always returns 0, whether or not the secondary address exists o...
RHEL9
Sometimes server 1 has the secondary address 10.143.170.80/24, and sometimes server 2 has that secondary address. My script needs to test which server has that secondary address.
However,
ip address show dev ${VirtDev} secondary
always returns 0, whether or not the secondary address exists or not.
Server 1:
ip address show dev $VirtDev secondary
echo $?
0
Server 2:
ip address show dev $VirtDev secondary
2: ens33: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:8e:73:35 brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 10.143.170.80/24 scope global secondary ens33:0
valid_lft forever preferred_lft forever
echo $?
0
This works, but seems janky:
Exists=$(ip address show dev $VirtDev secondary)
[ -n "$Exists" ] && echo exists || echo not exists
Is there a better way?
EDIT: when parsing json...
ip -j -4 a ls to 10.143.170.80 | jq -e .[].addr_info
[
{},
{
"family": "inet",
"local": "10.143.170.80",
"prefixlen": 24,
"scope": "global",
"secondary": true,
"label": "ens33:0",
"valid_life_time": 4294967295,
"preferred_life_time": 4294967295
}
]
ip -j -4 a ls to 10.143.170.80 | jq -e .[].addr_info.local
jq: error (at :1): Cannot index array with string "local"
RonJohn
(1421 rep)
Jul 29, 2025, 03:50 PM
• Last activity: Jul 30, 2025, 06:35 AM
2
votes
2
answers
3506
views
startProcess: posix_spawnp: does not exist (No such file or directory)
I have an interesting case where I'm getting the below error when running a bash program but only when it's run via a systemd unit (running within Nixos). `telegram: startProcess: posix_spawnp: does not exist (No such file or directory)` If I run this program from the command line locally it works w...
I have an interesting case where I'm getting the below error when running a bash program but only when it's run via a systemd unit (running within Nixos).
telegram: startProcess: posix_spawnp: does not exist (No such file or directory)
If I run this program from the command line locally it works with no issue... What might be the cause of this error? It seems like posix_spawnp is actually a syscall which confuses me (why does the error seem to indicate it's an executable?)
The actual script is located here: https://github.com/fabianonline/telegram.sh/blob/master/telegram
Chris Stryczynski
(6593 rep)
Sep 25, 2022, 01:17 PM
• Last activity: Jul 29, 2025, 11:02 PM
-2
votes
2
answers
50
views
HISTTIMEFORMAT not working as desired in RHEL 8 bash 4.4.20
so trying to capture history with date and readable timestamps AND the command should appear on same line. following is failing: Bash ver is: GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-gnu) OS: RHEL 8.x in .bashrc.... setopt EXTENDED_HISTORY export HISTTIMEFORMAT='%F %I:%M:%S %T' #expo...
so trying to capture history with date and readable timestamps AND the command should appear on same line. following is failing:
Bash ver is: GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-gnu) OS: RHEL 8.x
in .bashrc....
setopt EXTENDED_HISTORY
export HISTTIMEFORMAT='%F %I:%M:%S %T'
#export HISTTIMEFORMAT="%F %T "
export HISTSIZE=1000
export HISTFILE=$HOME/.bash_history-$USER
export HISTFILESIZE=1000
export PROMPT_COMMAND='history -a'
env variables:
$ env|grep HIST
HISTCONTROL=ignoredups
HISTTIMEFORMAT=%F %I:%M:%S %T
HISTFILE=/home/user1/.bash_history-user1
HISTSIZE=1000
HISTFILESIZE=1000
the records appear as:
#1753745611
cd
#1753745616
ls -ltra|tail
#1753745626
cat .profile
#1753745633
cat .kshrc
**expected:**
Mon Jul 28 23:33:31 GMT 2025 cd
Mon Jul 28 23:33:36 GMT 2025 ls -ltra|tail
Mon Jul 28 23:33:46 GMT 2025 cat .profile
Mon Jul 28 23:33:53 GMT 2025 cat .kshrc
two problems with this.
1. Timestamp appears in UNIX EPOCH format.
2. Timestamp and command appears on separate lines. They should be together.
Also behaves the same way when using KSH. How can this be fixed? preferably using HISTTIMEFORMAT
Thank you.
Rajeev
(256 rep)
Jul 29, 2025, 03:33 PM
• Last activity: Jul 29, 2025, 10:01 PM
9
votes
3
answers
25747
views
How to unset range of array in Bash
I'm trying to delete range of array element but it's fail.. My array root@ubuntu:~/work# echo ${a[@]} cocacola.com airtel.com pepsi.com Print 0-1 array looks ok root@ubuntu:~/work# echo ${a[@]::2} cocacola.com airtel.com Now I'm trying to delete only these element using : root@ubuntu:~/work# unset a...
I'm trying to delete range of array element but it's fail..
My array
root@ubuntu:~/work# echo ${a[@]}
cocacola.com airtel.com pepsi.com
Print 0-1 array looks ok
root@ubuntu:~/work# echo ${a[@]::2}
cocacola.com airtel.com
Now I'm trying to delete only these element using :
root@ubuntu:~/work# unset a[@]::2
root@ubuntu:~/work# echo ${a[@]}
It's delete whole array..
What I'm doing wrong ?
I found other way of deleting range of array but why above things is not working ?
for ((i=0; i<2; i++)); do unset a[$i]; done
EDIT
I had also tried but no luck
unset -v 'a[@]::2'
Rahul Patil
(25515 rep)
Apr 30, 2013, 04:02 PM
• Last activity: Jul 28, 2025, 04:59 PM
1
votes
0
answers
37
views
PROMPT_COMMAND usage in Bash on macOS
I'm trying to use Linux bash config on a mac. I don't use zsh only bash on my mac. I have problem with this variable: ```bash # After each command, append to the history file and reread it PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" ``` I'm not sure wha...
I'm trying to use Linux bash config on a mac. I don't use zsh only bash on my mac. I have problem with this variable:
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
I'm not sure what is the source of this code, but i use it on Linux to keep all history from different terminal tabs in sync.
But on mac I got empty history. I'm not sure if this something that was from the start after I added this to my .bashrc
or something that appeared just now. I didn't notice any problems before, but I use mac only for few weeks, and I may not use history at all. I have fzf
setup, but I may not use CTRL+R at all. And I'm not sure if I used up arrow. This is something that I don't pay much attention to, I do this automatically.
jcubic
(10310 rep)
Jul 28, 2025, 11:13 AM
• Last activity: Jul 28, 2025, 11:55 AM
0
votes
4
answers
5294
views
Effective ACL permissions changing permissions
From a bash shell script, I am creating a folder and storing the mysqldump there. I am sure that there is no command related to permissions in my script. To allow an other user to access these files, I have used ACL, but when he tried to access the file, he got permission denied issue, and issue is...
From a bash shell script, I am creating a folder and storing the mysqldump there. I am sure that there is no command related to permissions in my script. To allow an other user to access these files, I have used ACL, but when he tried to access the file, he got permission denied issue, and issue is with
effective
permissions of ACL.
The owner of the directory is ola
and new user who is trying to access the folder is uber
and folder is gettaxi
### Permissions of Parent directory
[/omega/olabooktmp]# getfacl .
# file: .
# owner: ola
# group: ola
user::rwx
user:uber:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:uber:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
### Permissions of Child directory
[/omega/olabooktemp]# getfacl gettaxi/
# file: gettaxi/
# owner: ola
# group: ola
user::rwx
user:uber:rwx #effective:---
group::r-x #effective:---
mask::---
other::---
default:user::rwx
default:user:uber:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
I see like for new directory gettaxi
mask permissions are mask::---
, so I think this is causing issue, but I am unable to understand completely and how to solve this issue.
Any suggestions greatly appreicated.
Thank you.
Raja G
(6177 rep)
Mar 17, 2020, 09:58 AM
• Last activity: Jul 28, 2025, 06:04 AM
51
votes
6
answers
55436
views
/dev/tcp listen instead of nc listen
With a netcat listener like: nc -l / > ~/.bashrc My question is: Is there a way to mimic the capabilities of `nc -l ` in my first line with /dev/tcp instead of `nc`? The machines I'm working on are extremely hardened lab/sandbox environment RHEL (no ssh, no nc, no LDAP, no yum, I can't install new s...
With a netcat listener like:
nc -l / > ~/.bashrc
My question is: Is there a way to mimic the capabilities of
nc -l
in my first line with /dev/tcp instead of nc
?
The machines I'm working on are extremely hardened lab/sandbox environment RHEL (no ssh, no nc, no LDAP, no yum, I can't install new software, and they are not connected to the internet)
h3rrmiller
(13506 rep)
Oct 4, 2012, 06:26 PM
• Last activity: Jul 27, 2025, 06:42 PM
26
votes
3
answers
62357
views
base64 -d decodes, but says invalid input
Does anybody know why this is happening and how to fix it? ``` me@box:~$ echo "eyJmb28iOiJiYXIiLCJiYXoiOiJiYXQifQ" | base64 -di {"foo":"bar","baz":"bat"}base64: invalid input ```
Does anybody know why this is happening and how to fix it?
me@box:~$ echo "eyJmb28iOiJiYXIiLCJiYXoiOiJiYXQifQ" | base64 -di
{"foo":"bar","baz":"bat"}base64: invalid input
shwoseph
(435 rep)
Jan 28, 2021, 05:45 PM
• Last activity: Jul 27, 2025, 02:01 PM
Showing page 1 of 20 total questions