unix

how to list files of specific permissions using UNIX ls command ?

I would like to see all the files recursively in a directory or drive which are not read only. I would like to do this as i am using the clear case and i would like to check on on the files which are to be added to he source control or view-private files. even a clear case command would help thanks. For clear case specific i tried "ls...

What's the difference between $@ and $* in UNIX?

Hi, So I was just wondering what's the difference between $@ and $* in UNIX, as when echoed in a script they both seem to produce the same output. Thanks. ...

Emacs user base size

I have for several years tried to get an estimate of the emacs user base. Does anyone have good estimates besides the naive guess of the Linux/unix install base? ...

Question regarding Unix/Linux kernel programming

Hello guys, I would like to learn about linux/Unix kernel programming for scalable multi processors (smps). I found this book UNIX(R) Systems for Modern Architectures http://www.amazon.com/UNIX-Systems-Modern-Architectures-Multiprocessing/dp/0201633388/ref=pd_rhf_p_t_3 . Is there any other good resources or a better book since its relea...

Syntax error only when command is run from cron

Hi folks, This command: /usr/bin/mysqldump --add-drop-table -u myuser -pmypass mydb > "/home/myuser/dbBackups/"`date +%Y%m%d`".sql" works fine from the command line but whenb cron runs it I get /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' /bin/sh: -c: line 1: syntax error: unexpected end of file The command i...

Windows X Unix in USB communication

inHi, this question is fast, but from my point of view its pretty hard. I have been messing with implementing USB device built from MCU. So I found project called V-USB which is software-emulated USB interface for Atmel MCUs. But this is not so important. The question is, on their site, they say that using custom USB class, you can simp...

Disk reads / seeks on a shared unix server for a directory list

I want to get a better understanding of how disk reads work for a simple ls command and for a cat * command on a particular folder. As I understand it, disk reads are the "slowest" operation for a server/any machine, and a webapp I have in mind will be making ls and cat * calls on a certain folder very frequently. What are "ball park" ...

Hide/encrypt password in bash file to stop accidentally seeing it

Sorry if this has been asked before, I did check but couldn't find anything... Is there a function in Unix to encrypt and decrypt a password in a batch file so that I can pipe it into some other commands in a bash file? I realise that doing this provides no real security, it is more to stop someone accidentally seeing the password if t...

How can I print specific lines from a file in Unix?

I want to print certain lines from a text file in Unix. The line numbers to be printed are listed in another text file (one on each line). Is there a quick way to do this with Perl or a shell script? ...

My memcache is timing out. Does anyone know why?

I am using memcached and python-memcache. On my cache server, iptables is set perfectly, and it's allowed: ACCEPT all -- dev anywhere The process is this: /usr/local/bin/memcached -d -u root -m 3900 -p 11211 I do this in Django but it's not working. It times out at cache.set. cache.set("test","laa",333) prin...

(unix shell scripting) Trim last 3 characters of a line WITHOUT using sed, or perl, etc.

Hi, I've got a shell script outputting data like this: 1234567890 * 1234567891 * I need to remove JUST the last three characters " *". I know I can do it via (whatever) | sed 's/\(.*\).../\1/' But I DON'T want to use sed for speed purposes. It will always be the same last 3 characters. Qny quick way of cleaning up the output? ...

sed command line

Hi I need to run 'sed' command on file1.txt and have it extract all names that are in between StringA and StringB... ex: "Nickname":"bad_name", extract bad_name and then save all results too Output.txt. is this even possible or should I be looking at another command? ...

fastest hashing in a unix environment?

Hi, I need to examine the output of a certain script 1000s of times on a unix platform and check if any of it has changed from before. I've been doing this: (script_stuff) | md5sum and storing this value. I actually don't really need "md5", JUST a simple hash function which I can compare against a stored value to see if its changed....

How does one define PATH_MAX for a given filesystem?

I'm presently writing a filesystem. The statvfs (and even the statfs) structs contain a field specifying the maximum length of a name in that path. As PATH_MAX is defined in the pathconf manpage (getconf), this means it is defined on a per-directory basis (and thus, determined by the underlying filesystem). How does one specify this valu...

How to determine the current shell i'm working on ?

How to determine the current shell i am working on ? Does ps command output will alone do ? How to do this in different flavors of UNIX ? ...

Combining tab delimited files based on a column value

Suppose I have two tab-delimited files that share a column. Both files have a header line that gives a label to each column. What's an easy way to take the union of the two tables, i.e. take the columns from A and B, but do so according to the value of column K? for example, table A might be: employee_id name 123 john 124 mary a...

file format not recognized; treating as linker script

I am trying to run the C files downloaded from here as follows : gcc main.c docs_file.txt ksg_file.txt However, I receive the following error: /usr/bin/ld:docs_file.txt: file format not recognized; treating as linker script /usr/bin/ld:docs_file.txt:2: syntax error collect2: ld returned 1 exit status I am not sure what the problem ...

Source code of the "halt" tool?

Can anyone link up the source of the halt tool? It is a binary usually located in /sbin which shuts down the system. I did some search and I couldn't find it anywhere. ...

Why does the included code not work in bash?

DOWNLOAD_PATH="sample.ext" RATE_LIMIT="300K" mkdir ../$DOWNLOAD_PATH BASE_COMMAND="screen wget --continue --directory-prefix=../$DOWNLOAD_PATH --tries=2 --input-file=$DOWNLOAD_PATH" $("${BASE_COMMAND} --limit-rate=${RATE_LIMIT}") This does not work, but throws an error: line 5: screen wget --continue --directory-prefix=../sample.ext -...

In kshell Make file Can i know the syntax of if else

In kshell Make file Can i know the syntax of if else where it should check different paths if (b folder found) select this path else should select other path or existing path ...