Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

learn more… | top users | synonyms

2
votes
1answer
47 views

What is the difference between “elif” and “else if” in shell scripting?

I am very new to shell scripting. When I look at some code, written for ksh (#!/bin/ksh) I see there is else if as well as elif used in one script. So, what is the difference between else if and ...
0
votes
1answer
40 views

Merging two directory trees with same structure, but different contents in Unix

I have two directories with the following structure: A |_0 |_1 |_2 B |_0 |_1 |_2 each 0,1,2 directory contains unique contents. I want all of the contents to simply exist as: A |_0 |_1 |_2 Is ...
3
votes
2answers
2k views

How can I get the uncompressed size of gzip file without actually decompressing it?

Please find my OS details: $ uname -a AIX xxyy 1 6 000145364C00 I've tried the following command to get size of a file in gzip archive: $ gzip -l mycontent.DAT.Gz compressed uncompr. ratio ...
0
votes
0answers
13 views

What installs fonts on a unix-based system?

I want to understand in which operating systems (unix-based), I can assume that fonts will be installed automatically? I assume they are probably installed in conjunction with a desktop GUI such as ...
0
votes
1answer
17 views

Old Linux Distros [on hold]

I want to have some old linux/unix versions in order to get to know them. Install them, take a look. What happens is that I have not found any of them, for example, the old RHL distros are no longer ...
3
votes
1answer
2k views

How do I move a linked file on Unix?

I have a bunch of files in one directory and links to each one of those files in another directory. So ls -l looks something like this: lrwxrwxrwx 1 rembol rembol 89 Jan 25 10:00 copyright.txt ...
0
votes
0answers
5 views

USB Target mode multiplexer for video feeds

We have proprietary (not ours) windows software that processes video from one camera connected via USB. We would like to analyze feed from many (10+) cameras by rapidly switching video source. Usage ...
0
votes
5answers
48 views

My user information was deleted [duplicate]

Possible Duplicate: Undo an “rm -rf ~” command? So I made a stupid error, I did a sudo rm -rf of my ~/ directory. I wasn't thinking of the hidden files in there. Now instead of showing what ...
1
vote
1answer
150 views

How can I split a large file into smaller parts on Windows? [duplicate]

I want to split a large file ~9 GB by lines, I know split command in UNIX but is there a similar command for Windows?
0
votes
2answers
312 views

Hide files in unix without changing their name (adding the dot) so that scripts that use them still work [duplicate]

Short version: I want to be able to prevent certain files from appearing in the output of ls, without adding the dot, and thus changing their names. Long version: Recently, I moved a bunch of scripts ...
1
vote
0answers
25 views

Monitor disk I/O used by specific command

I know that there are various tools for monitoring disk I/O, but I am wondering specifically if there is something equivalent to time for disk usage? For example, I am benchmarking a specific command ...
2
votes
1answer
2k views

Need to copy a file from unix box to windows folder using pscp command

I have a unix svr A: username: uname password: pwd then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username ...
1
vote
1answer
34 views

How to get tree -a to ignore .git directories?

I love using tree to list directories, and I have a git repository with all my dotfiles. For me to be able to see them I need to do tree -a, but that will also list the contents inside the .git ...
1
vote
3answers
188 views

Creating a large file of random bytes quickly

I want to create a large file ~10G filled with zeros and random values. I have tried using: dd if=/dev/urandom of=10Gfile bs=5G count=10 it creates a file of about 2Gb and exits with a exit status ...
1
vote
1answer
148 views

what happens when moving hard linked file across filesystems using mv?

I have a collection of folders on one file system which have been hard linked together (the contents are identical). What happens when I move one of the folders to another filesystem on another ...
4
votes
3answers
4k views

What is the difference between Linux (Ubuntu) and Mac shell commands?

I use Ubuntu at work and a Mac at home. I was trying out some shell commands on my bash terminal on the Mac today but they didn't work. I was told both machines should operate UNIX commands so the ...
3
votes
2answers
5k views

How do I close a file that I created using cat > command?

I learning how to use git on a Mac and I'm trying to add a file in one of my branches by using the "cat > " command. The problem I'm having is that I want to end editing the file in the terminal but I ...
3
votes
3answers
84 views

How can I see how much of a file has been read by an active process?

I often have a long-running job where an application reads through a large file (>2GB) and performs processing on each record. Is there any UNIX command I can use to see how deep into the file the ...
0
votes
0answers
40 views

36 forks of a program Vs. 36 instances of it? Pros and cons? [on hold]

For a research project in human learning and cognition we're writing a wrapper shell script with these objectives: Should launch 36 different PDFs at once. Place them appropriately at different ...
0
votes
1answer
20 views

How to remove mac extended attributes from a file?

I have the following special attributes on my pdf file: -rw-r--r--@ 1 Barnabas staff 18227 Oct 9 11:34 myfile.pdf com.apple.metadata:kMDItemWhereFroms 331 ...
7
votes
3answers
69k views

How to change file permissions for a directory in one command

How can I change all the file permissions of a directory in one command in Unix?
14
votes
5answers
15k views

ps: How can i recursively get all child process for a given pid

How can I get the entire process tree spawned by a given process displayed as a tree and only that tree i.e. no other processes? The output could e.g. look like 4378 ? Ss 0:10 SCREEN ...
2
votes
2answers
131 views

Slicing video file into several segments

I am currently using ffmpeg to slice video files. I automated the process through a script called ffmpeg_split.sh. Although this very slow it is efficient in splitting videos into equivalent settings. ...
2
votes
1answer
52 views

Splitting video file into equivalent segments with ffmpeg

I have ffmpeg installed in my linux box. I am using it to split files into equivalent segments. So far I have test two approaches: 1. Create a bash script that grabs the file durationffprobe and then ...
0
votes
0answers
39 views

How to justify and center text in bash?

Newbie here. I'm looking for bash script to center and justify text. My script only works with one line of text. How would you improve it? #!/bin/bash COLS=$(tput cols) while true; do clear ...
4
votes
6answers
3k views

Listing everything else than *{.tex, .aux} by ls

How can you ls everything else the the files *{.tex, .aux}? I run unsuccessfully ls -I".tex"
0
votes
3answers
42 views

*nix virtual environment

I used python-virtualenv previously for python tools, but now I've found a new remote job which needs a lot of native tools to be installed into my system. The question is how can I separate my ...
6
votes
4answers
9k views

How to limit output of ls to only show filename, date and size?

How can I use ls in linux to get a listing of filenames date and size only? I don't need to see the other info such as owner, permission.
1
vote
1answer
20 views

Authenticate User's Unix Credentials via Web Browser

Can anyone give me tips on how to authenticate a user's Unix credentials through the browser? I am basically giving access to some file viewing and I want to make sure the users are authenticated but ...
7
votes
5answers
9k views

Stuck choosing between ext4 and ext3 for the file system

I was in the process of installing Ubuntu 11.10, but got stuck choosing which file system to use. ext3 and ext4; which is better for a personal desktop? If ext4 is better, will it work well on my ...
6
votes
5answers
633 views

Is there any functional-like unix shell?

I'm (really) newbie to functional programming (in fact only had contact with it using python) but seems to be a good approach for some list-intensive tasks in a shell environment. I'd love to do ...
-1
votes
2answers
51 views

Unix - Searching for every file with a certain string in it

I am searching for every file within a root directory and want to search every subdirectory as well. I have tried grep -r "message" * but I am not sure that this searches every subdirectory, any ...
6
votes
3answers
5k views

List all unique extensions for files contained in a directory

I would like to see all the unique extension of files contained in a certain directory. What is the command to do that in bash? One could use find . -type f to get all the files in the current ...
3
votes
1answer
31 views

Merging multiple log files by date including multilines

How can I merge log files, i.e. files that are sorted by time but that also have multi-lines, where only the first line has the time, and the remaining ones have not. log1 01:02:03.6497,2224,0022 ...
6
votes
3answers
11k views

count lines in a compressed file

if i have a .gz file on unix which has certain number of lines. How could i count the lines on unix without uncompressing it.
21
votes
2answers
52k views

Command: sudo su -

I understand what su - does logs you into root with the root environment (as opposed to su which logs you into root with your environment) And I understand what sudo does you are root for one ...
1
vote
1answer
188 views

What is the difference between these two grep options?

I am writing a script. What is the difference between the following two lines? grep . || echo something and grep "^\." || echo something
11
votes
2answers
2k views

Unix: Slash after directory names or not

What is the difference between the following commands? mv foo bar mv foo/ bar/ mv foo/ bar mv foo bar/ Or is there no difference? Or does it depend on the command being used? Think for example I ...
1
vote
1answer
71 views

What is the difference between OS X and Linux filesystem? [closed]

When I go to the terminal in a Mac running OS X 10.something, which is everything now, the file hierarchy and naming scheme, especially when I cd to the root of the hierarchy it looks identical to ...
0
votes
1answer
3k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
1
vote
4answers
1k views

Tool to monitor file read/write in unix

Is there any tool/command available in unix to monitor read/writes in a particular file. I also want to collect how much data is being read each time the file is accessed.
3
votes
1answer
2k views

Does rsync delete files, folders at destination by default?

Files Suppose that /foo/src contains only A.c and that /foo/dest contains both A.c and B.c. And suppose I run the following command: rsync /foo/src/ /foo/dest Will rsync erase B.c? Folders Now ...
2
votes
2answers
26 views

Grep in newest file

I'm trying to find a specific line from the newest file I have in subfolders. Files have the same name. So structure is like: Folder SubFolder1 filename.xml SubFolder2 filename.xml I'm ...
4
votes
0answers
294 views

Connection timing out when connecting to Milter service

I'm using a VPS with CentOS 5, containing Postfix and OpenDKIM. I have set up OpenDKIM using this guide. Everything seems to work properly as the log in /var/log/maillog does not report anything other ...
2
votes
2answers
40 views

In UNIX, the rm='rm -I' is not working

In the command prompt of g++ terminal, I am typing alias rm='rm -I' and it is giving me missing operand. I'm not quite sure what I should do, and yes I know naming it rm is bad. It is for an ...
14
votes
5answers
4k views

How to make Emacs read buffer from stdin on start?

With Vim I can easily do $ echo 123 | vim - Is it possible to do with Emacs? $ echo 123 | emacs23 ... Emacs starts with a Welcome message $ echo 123 | emacs23 - ... Emacs starts with an empty ...
7
votes
5answers
6k views

How can I compare two directories, one being a remote directory?

I want to compare two directories, one is local and the other is on another machine. How can I do that? Can I do it with diff?
5
votes
1answer
452 views

Best practice for storing custom commands (Unix)

I wish to know if there's any standard or recommended place to store your own custom commands (should you prefer not to install them in /usr/local/bin)? I'm referring to small gimmicks that I, ...
0
votes
1answer
20 views

DU reports different folder size in unix and cygwin (windows)

I was copying some files from windows machine to unix one (debian) and after checking file count (both matched) i tested folder size with du and i got different results: windows: ...
2
votes
4answers
293 views

man page command: man 3 vs. man

I'm wondering what's the difference between "man 3 command" vs "man command"? I read in wiki (http://en.wikipedia.org/wiki/Man_page) that man 3 is used in Linux in section 3 of the man pages. And ...