Most Popular
1500 questions
91
votes
6 answers
Is there a way to determine the optimal value for the bs parameter to dd?
On occasion I've seen comments online along the lines of "make sure you set 'bs=' because the default value will take too long," and my own extremely-unscientific experiences of, "well that seemed to take longer than that other time last week" seem…
user4443
91
votes
1 answer
Redirect both stderr and stdout to /dev/null with /bin/sh
I have tried all sorts of ways to redirect both stdout and stderr to /dev/null without any success. I have almost my entire life run bash which I've never had this issue with, but for once in BSD I'm stuck with /bin/sh.
What I've tried:
if ls…
Torxed
- 3,567
- 7
- 27
- 44
91
votes
7 answers
"trap ... INT TERM EXIT" really necessary?
Many examples for trap use trap ... INT TERM EXIT for cleanup tasks. But is it really necessary to list all the three sigspecs?
The manual says:
If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell.
which I believe applies whether…
musiphil
- 1,601
- 2
- 14
- 15
91
votes
12 answers
How to print all lines after a match up to the end of the file?
Input file1 is:
dog 123 4335
cat 13123 23424
deer 2131 213132
bear 2313 21313
I give the match the pattern from in other file ( like dog 123 4335 from file2).
I match the pattern of the line is dog 123 4335 and after printing
all lines without…
loganaayahee
- 1,109
- 1
- 7
- 6
91
votes
14 answers
How to unload kernel module 'nvidia-drm'?
I'm trying to install the most up-to-date NVIDIA driver in Debian Stretch. I've downloaded NVIDIA-Linux-x86_64-390.48.run from here, but when I try to do
sudo sh ./NVIDIA-Linux-x86_64-390.48.run
as suggested, an error message appears.
ERROR: An…
Rodrigo
- 1,732
- 2
- 16
- 29
91
votes
12 answers
How do I count all the files recursively through directories
I want to see how many files are in subdirectories to find out where all the inode usage is on the system. Kind of like I would do this for space usage
du -sh /*
which will give me the space used in the directories off of root, but in this case I…
xenoterracide
- 57,918
- 74
- 184
- 250
91
votes
5 answers
How to extract the Root CA and Subordinate CA from a certificate chain in Linux?
I have an end-entity/server certificate which have an intermediate and root certificate. When I cat on the end-entity certificate, I see only a single BEGIN and END tag. It is the only the end-entity certificate.
Is there any way I can view the…
Anirban Nag 'tintinmj'
- 1,115
- 1
- 10
- 10
91
votes
4 answers
How can I make environment variables "exported" in a shell script stick around?
I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script.
I have have a shell script set up like this:
#!/bin/sh
export EC2_HOME=/home/me/.ec2
echo $EC2_HOME
When I run the script I know…
cwd
- 44,479
- 71
- 146
- 167
91
votes
4 answers
How to recover a 'lost' screen session?
Somehow I managed to close a screen window without screen 'noticing' it, so the session is still flagged as attached. This prevents me from re-attaching to this session. What can I do?
me@iupr-serv8:~$ screen -r
There are several suitable screens…
Framester
- 1,633
- 4
- 18
- 17
91
votes
1 answer
Why does the following script delete itself?
If you create an executable file with the following contents, and run it, it will delete itself.
How does this work?
#!/bin/rm
user253751
- 2,211
- 2
- 16
- 17
91
votes
5 answers
apt-get fails: The method driver /usr/lib/apt/methods/https could not be found
I tried to update my OS Debian jessie using the terminal and i get an error :
“E: The method driver /usr/lib/apt/methods/https could not be found.” error?
My sources.list :
deb http://httpredir.debian.org/debian/ jessie main
deb-src…
GAD3R
- 63,407
- 31
- 131
- 192
91
votes
2 answers
How to tell journald to re-read its configuration?
My question is simple: how do I tell journald to re-read its configuration file without rebooting?
I've made some changes to /etc/systemd/journald.conf and I'd like to see if they are correct and everything works as I expect.
I do not want to…
lorenzog
- 1,413
- 1
- 10
- 11
91
votes
2 answers
Is there ever a good reason to run sudo su?
To launch a root shell on machines where the root account is disabled, you can run one of:
sudo -i : run an interactive login shell (reads /root/.bashrc and /root/.profile)
sudo -s : run a non-login interactive shell (reads /root/.bashrc)
In the…
terdon
- 234,489
- 66
- 447
- 667
91
votes
2 answers
Understand logging in Linux
As I understand, Linux kernel logs to /proc/kmsg file(mostly hardware-related messages) and /dev/log socket? Anywhere else? Are other applications also able to send messages to /proc/kmsg or /dev/log? Last but not least, am I correct that it is the…
Martin
- 7,284
- 40
- 125
- 208
91
votes
2 answers
What is the difference between .a and .so file?
As far as I understand they are libraries, but what is the difference between the two?
Erik B
- 1,103
- 1
- 10
- 9