1,234 reputation
17
bio website
location
age
visits member for 1 year, 5 months
seen yesterday

Apr
3
comment Interpret backspaces in file
+1, great, never saw the usage cases for "col" before.
Mar
31
comment What does $# mean in shell?
@NoName you can also, when using an OS with GNU tools (linux, etc) use info for either the man page, or additionnal informations (very detailled, and compartmentalized) if the packages has some
Mar
27
comment How to input a network file using scp to ffmpeg
You should edit the question : As it stands, its a "XYProblem": asking to do Y, when you really want to do X. You really want to input a network file remotely, not "using scp" (It sounds like: "how can I shave my beard using a bycicle" : the real need is shaving the beard, not really using a bycicle ^^) Don't mix your need with the means to do so (so that you can find better means, using people's feedback!)
Mar
27
comment What happens when I run the command cat /proc/cpuinfo?
@slm : +1, great answer. But to me, the first hint it's a special file is its size ^^ 0 bytes, yet you can cat lots of things from it (a bit like some pipe files).
Mar
27
comment dumpe2fs - lifetime writes - what is it
is there a limit to that lifetime write ? can it "roll over" ? or will it change to a scientific notation for bigger numbers?
Mar
25
comment ssh with for loop - parentheses problem
Avinash means : remove the ; at the end of the line for(i=0.....)
Mar
20
comment weird problem with 64 bit install and memory
you should try to see the exact output of dmesg when you boot on your working 32 bit linux... maybe your hardware is not what you think it is?
Mar
18
comment How is the order in which tar works on files determined?
@John : you could use tar itself to see what it would do : tar cf - /path/to/dir | tar tvf - will tar to stdout, and tar tvf will read from stdout (long, but does exactly what it would do if you were taring) (it's also a nice trick to get a date of files not depending on the age of the files, as "ls" would be). Sorting by inode may work, but not always (inode can "wrap around", and start again with lower numbers than some of the higher ones, so you can't use that if your filesystem created more than X files !)
Mar
13
comment Updating last modified time of a file
I should add that on linux, you don't have the creation time... you have in POSIX: "Each file has three distinct associated timestamps: the time of last data access, the time of last data modification, and the time the file status last changed." (thanks to stackoverflow.com/questions/14842195/… )
Mar
13
answered Updating last modified time of a file
Mar
7
comment Compare two text files and find matching lines
it cuold be optimized: each time you increment a matching nb_items: if all are above 10, you can stop reading BIGFILE and go to the END section!
Mar
7
answered Compare two text files and find matching lines
Mar
7
comment Running a bash script as root prevents asynchronous execution?
the missing ' at the end of echo is here and not in the script?
Mar
4
comment how to make alias to make grep command shorter
@slm: ah, indeed, with that (impossible) requirement I agree. (I focused on the question's title, "make grep command shorter" ^^)
Mar
4
comment how to make alias to make grep command shorter
@slm: with alias mygrep='grep -rnIi --color' : when you then mygrep "something" somewhere it will expand to grep -rnIi --color "something" somewhere (and therefore will work as expected). you can have as many arguments after "mygrep" as you want: the first one will be the regexp to look for, the next one(s) will be places to look at/in. (as the alias only expands to "grep -options", the rest of the line will be appended to it by the shell)
Mar
4
comment Where is a shell script run from?
another way for the 1st line (so that "./something" will not output only "." ...) : echo "I am located in $(cd "$(dirname "$0")" && pwd)" (don't worry, $(...) will run this in a subshell, so the cd only occurs in that subshell and will not affect the rest of the script, and thus the 2nd line will still work)
Mar
4
comment how to make alias to make grep command shorter
Otherwise, with no "place" to search in, it greps the standard input.
Mar
4
comment how to make alias to make grep command shorter
slm: please see my comment on Graeme's answer. You can not assume grep will use the current dir as a default. grep (should) need both a string and "a place where to look for it". Its default is not "current dir", but "Standard Input", so your tries (Running grep -rnIi --color "string" just hangs indefinitely, waiting for a file/path argument to search) was in fact not waiting for a file/path, but was already grepping the standard input. Graeme's mygrep 'abcabc' . should work fine on CentOS as on any other "normal" unixes (using bash/sh/many others).
Mar
4
comment how to make alias to make grep command shorter
I believe your solution is the easiest and so "more correct" one. But you need to show how it's used: mygrep something somewhere (ex: mygrep "abcabc" . , for the OP's example). Grep needs both something to search for, and where to search it (a file, or a directory, both are valid here). The alias only provides the options, as those can (and should) be placed before the arguments.
Feb
21
comment What does a bash sequence '\033[999D' mean and where is it explained?
be careful that the action of escape codes depends on the type of terminal (and you can emulate several types of terminal on modern screens/OS). You can use tput commands instead, to have more portability, iirc (but at the expense of less coverage of the specifics of your terminal). VT100 (the one that page talks about) is supported by many (but not everything is supported, I believe...). But your TERM variable may be set to some other terminal, and this could affect the effects of some of the commands