Reputation
3,493
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
2 18 38
Newest
 Yearling
Impact
~229k people reached

Feb
11
comment Remove all files/directories except for one file
Yes, this is a common problem. See the options -print0 in find and -0 in xargs. Here is a workaround, but is is slightly inconvenient. find . -maxdepth 1 -type f | grep -v 'a b' | tr '\n' '\0' | xargs -0 rm. By the way, gnu parallel handles this well (I almost always use it as a substitute for xargs: ls | grep -v 'a b' | parallel rm
Feb
8
comment Remove all files/directories except for one file
Ciao @Matteo, it works for files with spaces too, but you need to surround the grep-pattern by quotes, e.g. ls | grep -v "a file with spaces.bin" | xargs rm. This is normal grep syntax.
Nov
4
comment error in count script for number of occurences
You may find the -c/ --count option of grep for printing a count of matching lines for each input file useful.
Nov
1
comment Linux find-command skips a directory
I see you've thought about this much more thoroughly than I have. Thanks for providing feedback to my answer. Much appreciated! I now agree that a more complex solution is required to cover the needs of OP exactely.
Nov
1
comment Linux find-command skips a directory
yes, this solution is not bullet proof. Also, there are "real options" to find which precede the path (-H -L -D -P -O), which one would need to take into account if aim is 100% compatibility. I'm leaving these exotic cases as an exercise to the reader. Edits welcome. Cheers.
Nov
1
comment sshfs mounts share in read-only mode
using the first option, is the share mounted read-only also for root or only members of the users group?
Oct
19
comment replace several comma out side one or more sets of curly braces and exception that in one or more sets of curly braces
great explanation. (*SKIP)(*FAIL) is truly the greated regex trick ever. Cheers
Sep
23
comment How to change the word to be inclined in vim?
You asked two questions: (Subject:) You need to edit the syntax highlighting file. (Body:) It depends on the capabilities of your terminal. Not all terminals support italic glyphs.
Sep
23
comment Start server from terminal using a script
nohup start_server.sh should work actually if your script works fine (I haven't checked). But you can always try to run the script inside a screen or tmux session, detach and log off. This way, you will also see errors when you reattach.
Sep
5
comment How to use a alpha usb network adapter on debian
Please post the output of lsusb
Sep
5
comment Interrupted OpenCV building
If you really think the error stems from accidental interruption, just try to repeat all steps, starting out clean.
Sep
5
comment Interrupted OpenCV building
Try to install qt4 packages through your package manager. You might have to install the dev packages, depending on what distribution of Linux you use.
Sep
4
comment Linux Mint 17 Cinnamon, characters are not displayed properly sometimes
it affects the titlebar and every other window, not only the terminal, right? What happens if you type reset in the terminal?
Aug
29
comment How to use ln -s to create a command line shortcut?
If you consider this question to be generic enough, please answer it to keep it for the posterior. I didn't think it was worth it. Cheers!
Aug
29
comment How to use ln -s to create a command line shortcut?
great. you may now delete this question. adieu
Aug
29
comment How to use ln -s to create a command line shortcut?
e.g. try sudo ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/studio
Aug
29
comment How to use ln -s to create a command line shortcut?
If you want to execute the script from anywhere using studio alone, you have to put the link in a place that is being searched by the shell. The shell searches everything in echo $PATH. You can either change $PATH or put the link into one the directories of $PATH. What do you prefer?
Aug
29
comment How to use ln -s to create a command line shortcut?
try ./studio.
Aug
28
comment Live Linux and FAT32
Hello, please try to clarify what you mean by "modular system to contain their system files" and what your problem is, exactly. Almost all distributions can run off USB drives.
Aug
28
comment How can I show the size of all cache files in my home directory?
du -ach ~ will recursively show the size of all files and directories in ~, execute it and let us know which ones you want to filter for