Unix & Linux Weekly Newsletter
Unix & Linux Weekly Newsletter

Top new questions this week:

Why does the following bash 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

/ shell-script / files / rm / executable / shebang  
asked by immibis 27 votes
answered by Stephen Kitt 43 votes

In Vim , how can I copy from several lines? (not a range);

Assume I have 1 - funct1 2- funct 2 3 - funct 3 4 line 4 how can I copy line 1 and 3 (not a range of lines) and paste them, for example at line 8? If I do this in way with | arg like ( 1y|3y), I ...

/ vim  
asked by Whats Myname 18 votes
answered by lgeorget 29 votes

Why is /etc/shadow shortening the password that I've set with the command: useradd -p?

[root@P-dude dude]# useradd -p $6$Ic2PVlwi$2nf.IRWTMy0FHrPza6mh5wjomwbYtIIxnzxPZL7yg8SsvOdbjEpoI0G8uy7AqduYKQOn2R/rnnaalRmfPMy.a0 bwong20 [root@P-dude dude]# cat /etc/shadow | grep bwong20 ...

/ shell / useradd  
asked by PolkaRon 14 votes
answered by Anthon 47 votes

How to run a command at an average of 5 times per second?

I have a command-line script that performs an API call and updates a database with the results. I have a limit of 5 API calls per second with the API provider. The script takes more than 0.2 seconds ...

/ command-line / multithreading  
asked by Benjamin 14 votes
answered by Stéphane Chazelas 16 votes

How can I see the whole file and also wait for more data to be added to that file?

I want to read whole file and make it waiting for input, just like tail -f but with the complete file displayed. The length of this file will always change, because this is a .log file. How can I ...

/ command-line / tail  
asked by malworm 14 votes
answered by Anthon 29 votes

dd: multiple input files

I need to concatenate chunks from two files: if I needed concatenate whole files, I could simply do cat file1 file2 > output But I need to skip first 1MB from the first file, and I only want ...

/ files / dd / cat / data  
asked by Martin Vegter 12 votes
answered by meuh 16 votes

Why does `find . -type f` take longer than `find .`?

It seems like find would have to check whether a given path corresponds to a file or directory anyway in order to recursively walk the contents of directories. Here's some motivation and what I've ...

/ find / performance / gnu  
asked by Gregory Nisbet 12 votes
answered by Gilles 9 votes

Greatest hits from previous weeks:

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this. This way: export ...

/ bash / environment-variables / path / bashrc  
asked by Paolo 364 votes
answered by Gilles 377 votes

Linux: set date through command line

How to change the system date in Linux ? I want to change: Only Year Only Month Only Date Any combination of above three

/ linux / date / clock  
asked by SHW 24 votes
answered by Michael Homer 36 votes

Can you answer these?

how do I get fileshares to mount after a wireless connection is established?

Changed the computer from a wired to wireless connection for a few days. Now the network shares will not mount at boot. But they will mount with sudo mount -a. I tried adding _netdev but that made no ...

/ mount / fstab  
asked by jcollum 2 votes

Polling for Serial Port Information

Firstly, let me preface by saying I feel silly for asking a question like this. The information should be online, but I can't seem to find it anywhere. I feel like I've looked pretty hard, but nothing ...

/ serial-port  
asked by MD-7 2 votes

How to read/change SELinux context on mounted ext4 image from non-SELinux system?

I have a Linux system (Arch Linux) without SELinux support. I would not like to configure such support on my system. Now, I have an ext4 volume image which is known to have some SELinux context set on ...

/ arch-linux / ext4 / selinux  
asked by MarSoft 2 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3