Skip to content

u/morgothan

In this archive from Aug 2010 to Dec 2016

0
posts
18
comments
0
media
22
score

Top comments

There may be a more elegant solution, but a simple one line bash script will do this for you. Just put all the txt files in one directory and run this;

for i in $(ls *.txt); do for j in $(cat $i); do echo "$i: $j";done; done
5 points

If kill -9 doesn't cause the application to stop then the hang up is likely in the kernel. The reason for this is kill -9 sends a SIGKILL to the process which cannot be blocked and basically just forces the kernel to remove the process from the process queue. The only reason I can see that not happening is if the kernel is locked doing something else (ie a device driver isn't playing nice, etc). What might be a better idea is instead of doing a kill -9, try a few other signals first to try and let the app die gracefully. Look at This on which signal to use and why. Hope that helps.

4 points

I'm not 100% on this as I'll have to test it when I am at home, but I think that the script will fail because bash is smart enough not to execute with effective permissions. So you would need to add each command that is being executed in the wifi_restart script to the sudoers file. so add something like;

litle ALL=NOPASSWD: rmmod
litle ALL=NOPASSWD: modprobe    
3 points

I'm not 100%, but I would assume it's based on rm having to look through the directory recursively index what's there check if it's a directory then go though that again, prior to doing it. Whereas the find command just indexes the files and passes it to rm which deletes it without thinking. Tldr; no idea probably rm has a poorer recursive checking algorithm them find.

2 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.