3,058 reputation
1429
bio website None
location United States
age 53
visits member for 4 years, 11 months
seen Jul 2 at 16:19
Long-time Informix user and developer, experienced in C and Unix (many variants). Email: jonathan.leffler@gmail.com

Nov
19
comment Prepend new vim buffer with 2 new lines
So, by inference, you could add two blank lines by removing the 'foo' and 'bar'?
Nov
14
comment Shell command to remove a folder contents recursively excluding hidden files?
The rm -fr means that any directories will be forcibly removed along with all their contents, hidden and non-hidden. Using just rm -f would get rid of files and other non-directories. To remove empty directories, you need rmdir. (Using -name "*" is clever, though.)
Nov
14
answered Shell command to remove a folder contents recursively excluding hidden files?
Nov
9
comment find -print0 | xargs -0 grep not working as expected on Ubuntu 10.04
You could also use \( -iname '*.php' ... \) -exec grep -i users +, where the plus means 'build up a command line like xargs without needing to use xargs'. Using a semi-colon \; would mean execute grep for each file as it is found.
Nov
9
comment find -print0 | xargs -0 grep not working as expected on Ubuntu 10.04
Or -iname '*.php' -print0 -o -iname '*.pl' -print0 ......
Oct
21
answered how do I use the grep command to match a particular pattern ? if pattern specified in grep is “4” it should not return lines containing 44
Oct
21
comment how do I use the grep command to match a particular pattern ? if pattern specified in grep is “4” it should not return lines containing 44
What a weird migration!
Oct
17
comment How to do custom sorting using unix sort?
For these three values, you want reverse alphabetic order. For the general case, you'll need to map the names to a sort order number, and then do the sorting using the sort order number. Or go for a scripting language... One possibility is the join command, but you could end up with a lot of sorting — the input files for join must be sorted in one order, and then you'd be using sort again to put the data into a different order (and losing the sort order column as a post-sort step).
Oct
17
awarded  Notable Question
Oct
12
answered How to use LC_MESSAGES=C with gcc every time?
Sep
17
answered What's the difference between unix sort and sort -d
Sep
14
comment linux sort -n uniq -c
What are 'the unique appearances'? One instance of each word that appears? Or one instance (the only instance) of each word that appears only once? Please clarify by editing the question. (Incidentally, it's awfully tempting to say that the fastest way to cat the file is to use cat file.)
Sep
14
comment linux sort -n uniq -c
@squiguy: the file must be sorted before uniq works sanely. The input clearly isn't sorted.
Sep
14
comment linux sort -n uniq -c
@Clustermagnet: UUOC Award? It isn't clear that counts are wanted or needed, so sort -u text.txt? If counts are wanted, then sort text.txt | uniq -c works, optionally followed by sort -n to put the lines into frequency order.
Sep
12
comment Unix weird directory
@ShawnChin: I didn't expect the directory to be there but if the message was 'real' rather than noise, that's where it would be.
Sep
11
comment Unix weird directory
You might want to look for a directory â in the current directory with sub-directory dev containing a file nullâ. Alternatively, it is just the message that is scrambled, and your file really was saved to /dev/null, in which case, it is not going to be possible to get it back (you'll have to FTP it again).
Aug
31
comment How to find files on Linux where only root has read permission
If a file has 0 permissions (or other weird settings like 333), then the owner cannot at the moment read those files (though the owner could change the permission so that they could read those files). Also, if a directory on the path leading to the file is not accessible (the x-bit) to the general world (e.g. the directory is owned by root with 700 permission), then ordinary files under that directory are not readable by others, regardless of who owns them or the permissions on the file. So, there are other possible interpretations for the question, but the selected answer is most plausible.
Aug
25
comment How to kick off multiple shell scripts at startup
Look to the Xsession suggestion by Mr Ramsey.
Aug
25
answered How to kick off multiple shell scripts at startup
Aug
24
revised Does tar preserve links?
Fix trivial typos