Skip to content
Advertisement

How can I exclude directories from grep -R?

I want to traverse all subdirectories, except the “node_modules” directory. Answer SOLUTION 1 (combine find and grep) The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5. Use find, for excluding directories foo and bar : Then combine find and

ssh-keygen – how to set an rsa key with a certain username

I just installed ubuntu and would like to set its rsa keys up with bitbucket/github. When I ssh-keygen the keys are generated as they should be which is perfectly usable except the username part. In every rsa key I’ve generated previously, the username section read my email address: No, it’s not a major impediment but if I don’t get this

Does epoll(), do its job in O(1)?

Wikipedia says unlike the older system calls, which operate at O(n), epoll operates in O(1) [2]). http://en.wikipedia.org/wiki/Epoll However, the source code at fs/eventpoll.c on Linux-2.6.38, seems it is implemented with an RB tree for searching, which has O(logN) In fact, I couldn’t see any man page saying the complexity of epoll() is O(1). Why is it known as O(1)? Answer

Combining two files in different folders in Linux

I have two set of folders that have files with the same filenames and structure. The folder structure is something like this: So what I need to do is to combine (append) all the files with the same name in these folders (file1.txt with file1.txt etc.) into another file inside the outputfolder. After getting these combined files I also need

How to connect from USB port to RJ45 console device?

In my Linux laptop, the USB port is connected to an external router with console port (RJ45, Juniper SRX210). This is the cable i am using: I used cuteCom And i used minicom To connect using 9600 but it does not recognize /dev/ttyS0. Also tested with USBViewer (http://www.kroah.com/linux-usb/) which gives error “can not open the file /proc/bus/usb/devices” How can i

What do these strace system calls mean?

I need to profile the performance of an application for which I am using strace. However, I do not really know how to interpret the various system calls the strace emits. Examples of a few of them are below: I would be grateful if someone could briefly explain in plain English what these lines from (A) to (F) really means

How to clean a data file from binary junk?

I have this data file, which is supposed to be a normal ASCII file. However, it has some junk in the end of the first line. It only shows when I look at it with vi or less –> grep is also saying that it’s a binary file: Binary file data.dat matches This is causing some trouble in my parsing

Advertisement