Most Popular
1500 questions
92
votes
2 answers
Trim audio file using start and stop times
I have an FFmpeg command to trim audio:
ffmpeg -ss 01:43:46 -t 00:00:44.30 -i input.mp3 output.mp3
The problem I have with this command is that option -t requires a duration (in seconds) from 01:43:46. I want to trim audio using start/stop times,…

whitewings
- 2,457
92
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,113
- 1
- 10
- 9
92
votes
9 answers
Can sed replace new line characters?
Is there an issue with sed and new line character?
I have a file test.txt with the following contents
aaaaa
bbbbb
ccccc
ddddd
The following does not work:
sed -r -i 's/\n/,/g' test.txt
I know that I can use tr for this but my question is…

Jim
- 10,120
91
votes
7 answers
How safe is it to cat an arbitrary file?
Sometimes when I cat a binary file by mistake, my terminal gets garbled up. Nothing a quick reset can't fix, but couldn't an attacker theoretically create a file that, when displayed on a terminal, would execute some arbitrary code? Through an…

Gunchars
- 1,001
91
votes
6 answers
Why do iptables rules disappear when restarting my Debian system?
I add this rule:
sudo iptables -t nat -A OUTPUT -d a.b.c.d -p tcp \
--dport 1723 -j DNAT --to-destination a.b.c.d:10000
When restart computer rules are deleted. Why?
What I can do to make the rules persist?

Jhonathan
- 3,605
91
votes
8 answers
Ubuntu update error: "waiting for unattended-upgr to exit"
I'm unable to update my system having two installations of Ubuntu: One is version 16.04 and the other version is 17.04. In both, I'm getting the same error.
For ex., in Ubuntu 16.04, I run software updater and get the result as shown below.
I did…

Ravi
- 3,823
91
votes
6 answers
How to exit a shell script if one part of it fails?
How can I write a shell script that exits, if one part of it fails?
For example, if the following code snippet fails, then the script should exit.
n=0
until [ $n -ge 5 ]
do
gksu *command* && break
n=$[$n+1]
sleep 3

Weylyn
- 935
91
votes
4 answers
How to OCR a PDF file and get the text stored within the PDF?
First, apologies if this has been asked before - I searched for a while through the existing posts, but could not find support.
I am interested in a solution for Fedora to OCR a multipage non-searchable PDF and to turn this PDF into a new PDF file…

ingli
- 1,847
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
91
votes
9 answers
How do I split an audio file into multiple?
I found something for videos, which looks like this.
ffmpeg -i * -c:v libx264 -crf 22 -map 0 -segment_time 1 -g 1 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*9)" -f segment output%03d.mp4
I tried using that for an audio file, but only…

DisplayName
- 11,688
91
votes
5 answers
Refresh env variables after editing bashrc file
I frequently edited the .bashrc file to export new environment variables.
Rather than close the console and start a new one to refresh the env variables, is there a convenient way to refresh?

xiaohan2012
- 1,705
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
91
votes
5 answers
Merge two video clips into one, placing them next to each other
I have two video clips. Both are 640x480 and last 10 minutes. One contains background audio, the other one a singing actor. I would like to create a single 10 minute video clip measuring 1280x480 (in other words, I want to place the videos next to…

user
- 1,005
91
votes
3 answers
Piping commands after a piped xargs
HP-UX ***** B.11.23 U ia64 **** unlimited-user license
find . -type d -name *log* | xargs ls -la
gives me the directory names (the ones which contain log in the directory name) followed by all files within that directory.
The directories …

anotherperson1
- 1,229
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,516