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

7
votes
2answers
7k views

Auto-restart process on crash [duplicate]

I have a Java server process which runs native code and the possibility of the entire process crashing due to a problem in native code is always there. Is there any mechanism offered by *nix operating ...
33
votes
4answers
10k views

Powershell equivalent to unix `which` command?

Does powershell have an equivalent to the which command found in most (if not all) unix shells? There are a number of times I'd like to know the location of something I'm running from the command ...
27
votes
5answers
14k views

What is the difference between bash and sh?

I see two types of code being used: #!/usr/bin/sh and: #!/user/bin/bash I searched for this online and opinions vary a lot. The explanations I saw on most websites say that sh is older than ...
16
votes
4answers
7k views

What is the unix command to find out what executable file corresponds to a given command?

For example, if passed ls as input it should tell me that /bin/ls will run if run ls on the command-line.
15
votes
2answers
5k views

Linux-like top/netstat/etc. on Mac OS X?

Unix utilities on Mac OS X are quite painful to use. port install coreutils +with_default_names and a few other such replacements fix most of them, but it leaves some in broken Mac OS X defaults - ...
12
votes
4answers
2k views

Who deals with the star * in echo *

Who deals (interprets) the * in echo * Does the echo see the star or the shell take care about it and return a list of filename .. What about cp temp temp*
12
votes
4answers
10k views

Terminal Vs. Shell [duplicate]

Possible Duplicate: What are the differences between shell , console & terminal? This probably sounds like a stupid question but I'm having a lot of trouble clearly differentiating ...
10
votes
6answers
6k views

Custom vim highlighting

I am editing some xml right now and I have been leaving myself some comments of things to come back to. Like this <!-- Question: bla bla --> I am editing with vim right now and I would like ...
9
votes
13answers
25k views

Scripting: what is the easiest to extact a value in a tag of a XML file?

I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example: <?xml version="1.0" encoding="UTF-8"?><project ...
8
votes
5answers
9k views

What's the best way to perform a parallel copy on Unix?

I routinely have to copy the contents of a folder on a network file system to my local computer. There are many files (1000s) on the remote folder that are all relatively small but due to network ...
5
votes
2answers
1k views

How can I run a different command but with the same arguments?

For example, I edit and then run the same source. vim arbit.py python arbit.py I know I could run it from within vim, but I want a general solution on Bash. I keep finding situations where I reuse ...
4
votes
8answers
482 views

Fast Ways of Cd'ing on *nix?

I find myself constantly typing (using tab, of course) absurd paths like cd path/to/the/thing\ that\ I\ need/python/proj/eraseme Aside from doing an ln -s (or some other type of ln?), is there any ...
3
votes
1answer
530 views

Attributes of a file

I am trying to determine what all of the attributes are of a regular file (as opposed to a symbolic link, etc.) on Mac OS X with Mac OS Extended (Journaled) (HFS+). Here is my current list: ...
14
votes
2answers
11k views

what does the @ symbol mean in ls -l directory listing? [duplicate]

Possible Duplicate: ls -la symbolics… what does that last symbol mean? When I run ls -l on my mac I see two .yml files: -rw-r--r-- 1 aa staff 6 Apr 15 05:50 s1.yml -rw-r--r--@ ...
12
votes
5answers
16k views

How to move only files in Unix

How can I move only the plain files (not the directories) from one folder in Linux to another folder using the mv command? I have tried mv * ~/, but it copied everything including the directories.
10
votes
3answers
4k views

Stop cron from emailing me

How can I stop cron from emailing me the results of jobs I schedule?
8
votes
8answers
5k views

Ending a process in unix instead of interrupting it

At the unix command line if i press Ctrl-C,that does not end a process but rather interrupts it and i return to the shell prompt. So,i have the following two questions: 1.Is there a way i can see the ...
6
votes
7answers
4k views

“chown -R root /” how screwed am I?

I accidentally performed the command chown -R root / while trying to change the permissions to the public folder of my rails app. I believed this changed the permissions to all my folders on the / ...
6
votes
4answers
9k views

How to rename a file inside a folder using a shell command?

I have a file at some/long/path/to/file/myfiel.txt. I want to rename it to some/long/path/to/file/myfile.txt. Currently I do it by mv some/long/path/to/file/myfiel.txt ...
6
votes
3answers
23k views

Where are my private/public SSH keys on UNIX?

I'm starting to understand how RSA and public/private key systems work, and I was wondering where my private and public SSH key are stored. When I go to my home directory, and I browse my .ssh ...
6
votes
5answers
4k views

How to read one line from `tail -f` through a pipeline, and then terminate?

I would like to follow changes to a file via tail -f and then print out the first line that matches a grep command before terminating. What's the simplest way to do this? So far I've been ...
6
votes
2answers
898 views

Potential issues with adding /usr/local/[s]bin to root's path?

I've noticed that the root account $PATH does not include /usr/local/bin or /usr/local/sbin by default. Are there any potential issues that could arise from adding those directories to the path? If ...
5
votes
4answers
2k views

Convert symbolic links into corresponding target files [duplicate]

I have several symlinks to other files in a directory. I want to convert these links into independent files. Is there a command that does this?
5
votes
6answers
323 views

Linux/Unix in Windows

What would be the best way to get the full-blown Unix/Linux bash inside Windows? I don't mean the Virtual Machine, but rather only the terminal with mounted NTFS drives. This way I could use the ...
5
votes
8answers
27k views

How to check the current disk space used by my linux?

The entire box. How many gigs is everything using? And how do I check total?
3
votes
5answers
2k views

dd producing corrupt ISO images on Snow Leopard (whether invoked from a script or the shell)

Alright, I am probably being an idiot here, but I am writing an ISO-ripping util that is really just GUI slapped on top of dd, and I can't coax the thing to produce non-corrupt ISOs on Snow Leopard. ...
3
votes
1answer
5k views

OS X (Unix) shell command: possible to get last opened date of file?

when you use the following command find /Users/someUser/someFolder/* -type f -mtime +90 you'll get all the files that have a modification date that is bigger than 90 days. If you open however the ...
2
votes
1answer
4k views

What's the difference between “uname -r” and “uname -v”?

I am using CentOS 6.2. In the man page of uname (i.e., man uname), it says: -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version ...
2
votes
1answer
937 views

Easy way to columnize STDOUT (format text in columns)?

I just want an easy way to columnize output to the terminal. Don't care about colors. (Well, actually I do quite a bit! But there is the awesome, easy-to-use ANSI Color for that.) Shell scripts ...
1
vote
1answer
89 views

How do I find out what services are bound to a port number?

Given a TCP/UDP port number, how do I find out the name of the service bound to that port? I want to do this on various flavours of Unix. Mostly Gnu/Linux (usually Debian) and Mac OS X.
1
vote
1answer
13k views

-bash: ls: command not found at Terminal on Mac OS X

I need to start using GIT for my projects from now on and I need to use some UNIX commands. but no matter what I do, I always receive "command not found" error. I installed MacPorts, but still cant ...
20
votes
4answers
23k views

Is there a Windows equivalent of the Unix “strings” command?

strings in Unix and Linux extracts printable strings from a binary file. Is there a version of this for Windows? I couldn't find one.
13
votes
2answers
5k views

Linux - alternative places where to store pid file instead of /var/run

As written in the title, where should I let the init script write the pid file? are there any standard paths I should choose instead of the /var/run ? Could /tmp be a good place where to store it or ...
13
votes
4answers
19k views

Do symbolic link files survive SVN?

Let's say I create a symbolic link file inside an SVN managed path, commit the path to SVN and later checkout the path. 1) Will the symbolic link file survive? 2) If the symbolic link file is made ...
12
votes
2answers
7k views

Printing pages from 7 to 17 by lpr

How can you print pages from 7 to 17 by lpr?
11
votes
6answers
13k views

How to delete all but one file in Unix? [duplicate]

Possible Duplicate: How to delete all files in a directory except some? How to delete all but one(or some) file in Unix? Something like rm -rf -ignore myfile.txt *
11
votes
3answers
9k views

How Many Unix Groups Can A User Be A Member Of?

We've recently run into a situation at a group-happy site where some group memberships are not being picked up. I seem to remember that there is an upper limit to the number of groups that a user can ...
9
votes
6answers
14k views

How to grep for special character NUL (^@^@^@)

File: O000000667520994000000074720121112000000N^@^@^@ I used the below command but it doesn't work. grep "^@^@^@" *
9
votes
4answers
9k views

Windows PowerShell equivalent to Unix/Linux `pwd`?

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?
8
votes
5answers
3k views

When would creating a hard link be useful?

There are basically two main limitations with hard links: Hard links normally require that the link and the file reside in the same file system. Only the superuser can create a hard link to a ...
7
votes
1answer
456 views

Multiple unix pipes not working

This first pipeline works fine (printing "c"): echo "a" | sed 's/a/b/' | sed 's/b/c/' This one does not do what I expect (nothing gets printed when I feed an "a" into my fifo ): mkfifo fifo; cat ...
7
votes
1answer
4k views

Is there a scenario where rm -rf -no-preserve-root is needed?

I've seen some questions on here where people accidentally do rm -rf --no-preserve-root or rm -rf *, wiping out most or all of their file system before they can react. Is there ever a reason to use ...
7
votes
1answer
17k views

Unix commands to get last modified date and size of file/folder (NOT LS)

I need a command that retrieves the last modified date and another that gives the size of a file. I've looked everywhere, and I cannot find commands like this. LS will not work.
7
votes
3answers
15k views

Can a Linux user belong to more than one group?

Can a Linux user belong to more than one group? If it is allowed, then one use may access files from two groups, that would be quite nice! If not, is there any alternative way to have this function? ...
7
votes
3answers
4k views

Using the watch command with an argument that contains quotes

I'm trying to get watch to work correct with commands that contain quotes, and the watch man page isn't very detailed about how quotes work. To give a concrete example, how can I run the following ...
6
votes
2answers
2k views

How to append data in a file by dd?

I want to append new data in a file stored in SSD. dd if=/dev/shm/test of=/data/sdb/test bs=1G oflag=append But df -h shows the dd command always overwrite the test file, instead appends new data ...
6
votes
4answers
8k views

How-to limit Unix FIND results number

Is there a way to limit the number of results returned by the FIND command on an unix system? We are having performance issue due to an unsually large number of files in some directories. I'm tryging ...
5
votes
2answers
5k views

What does the number after Unix/Linux file permissions like “-rw-rw-r--. 1 ” mean in “ls -l” output

Can any one explain "-rw-rw-r--. 1 " and give some "detailed" information on ls -lart command. Why does the number change after "-rw-rw-r--. 1 " <----
5
votes
3answers
24k views

Connect to WiFi network using Mac Terminal

Every time I try to find out how to do this, I find out how to do it on a linux, and it doesn't transfer. How do I connect to a WiFi network using Mac Terminal Bash?
5
votes
2answers
1k views

How to create a file with a “#” character in the name in Unix?

I've tried many commands already for creating a file and deleting a file with a # character, but it does not work. Can anyone tell me the command to create and then delete a file that begins with #?