Is it possible to easily format seconds as a human-readable time in bash?
I’m writing a script which shows the git log for a directory when I cd into it. Such a log can be overwhelming, containing hundreds of lines. So far I have been limiting that to a hard-coded 20 lines (... | head -n 20
), which is fine on the screen at work, but too much on the smaller MacBook screen at home.
I have been struggling to install VirtualBox Guest Additions in a Debian Virtual Machine (Debian 7, Debian 8 and Debian 9).
So I like to harden my bash scripts wherever I can (and when not able to delegate to a language like Python/Ruby) to ensure errors do not go uncaught.
How can I pick which kernel GRUB2 should load by default? I recently installed a the linux realtime kernel and now it loads by default. I’d like to load the regular one by default.
How can I set file to be executable only to other users but not readable/writable, the reason for this I’m executing something with my username but I don’t want to give out the password. I tried :
That is literal, {fd}
isn’t a placeholder. I have a script that does this, and does not source in anything, nor does it reference {fd} anywhere else. Is this valid bash?
I was recently given username/password access to a list of servers and want to propagate my SSH public key to these servers, so that I can login more easily.
How can I introduce a conditional OR into grep? Something like, grepping a file’s type for (JPEG OR JPG), and then sending only those files…
First some specs: my computer is an HP EliteBook 8460p. It comes with an integrated Chicony HP HD webcam.