Posts tagged shell
I've been learning some Linux and I finally feel like I can find my way around the command line. But now I hear people say there are other, "non-POSIX" kinds of shell, with different semantics. Wha...
How to pretty print XML in a shell? I have command-line tool which outputs XML in a single line, totally unreadable. I would like something to pipe this into, to turn it into human readable XML wi...
How to apply a logical not to a shell command, e.g. in a Bash script? So if the command exited with 0 (success) I would like it to be changed to a non-zero value, and if it exited with a non-zero ...
How to get the number of lines in a file? I.e. for a file like this: Line one Line 2 Final line I would like to do something like this: $ count-lines /path/to/the/file/above 3
How can I search for files on my system? Ideally, I would like to search by various criteria, like date, name, extension, etc.
This blog post describes a privilege escalation, exploiting tar's --checkpoint-action option. The privilege escalation is used to solve a TryHackMe challenge. The root user calls tar via cron whi...
When running sed through fish, I often encounter a problem with regexes. Many commonly used regex control characters like []{}().+ need to be escaped, even if I type the regex in a single quoted st...
That's my Bash script: #!bin/sh cd qpixel sudo systemctl enable mysql mysql -u root -p rails s When it executes the line mysql -u root -p it will ask for password. To do so, I have tried...
Using BASH, how can I redirect stdout and stderr each, to two separate files, simultaneously? That's a mouthful, let me clarify a little: I have a hypothetical script that may/will generate outpu...
I have a shell script with a syntax compatible to both bash and zsh, except for a section that has zsh specific syntax that throws syntax errors if sourced from bash. Is there an easy way to escap...
I find port forwarding and port triggering as advanced sub-topics of the topic of network protocols which include the "port" concept such as TCP and UDP. I am wondering if shells in general and Ba...
While this is about grub loader, this is likely to be a question of OS related. If it doesn't belong to this site than I will remove it. I had installed Bliss in sda2. Device Boot Start...