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

13
votes
4answers
5k 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.
13
votes
2answers
9k 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--@ ...
9
votes
3answers
3k views

Stop cron from emailing me

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

How do I password protect a .tgz file with tar in Unix?

I'm using the Unix tar command as follows to tar up a directory and its files: tar cvzf fileToTar.tgz directoryToTar Is there a way to password protect the .tgz file? I've created ...
8
votes
8answers
4k 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
2answers
825 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
5k 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 ...
5
votes
5answers
3k 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 ...
5
votes
5answers
295 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
23k 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?
4
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?
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
4k 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
713 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
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 ...
25
votes
4answers
8k 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 ...
17
votes
4answers
18k 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
4answers
17k 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 ...
11
votes
1answer
9k views

Why do we use cp to copy files and not dd? (in unix-derivatives)

For normal file copying in *nix, I've only ever seen people use cp (eg. cp /mnt/mydevice/myfile ~/myfile), but I eventually ran into dd, which appears to do the exact same thing (dd ...
11
votes
6answers
12k 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 *
10
votes
2answers
5k views

Printing pages from 7 to 17 by lpr

How can you print pages from 7 to 17 by lpr?
10
votes
3answers
7k 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 ...
8
votes
4answers
7k 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
2k 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
366 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 ...
6
votes
5answers
9k views

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

File: O000000667520994000000074720121112000000N^@^@^@ I used the below command but it doesn't work. grep "^@^@^@" *
6
votes
3answers
10k 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? ...
6
votes
3answers
7k 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
1answer
10k 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.
5
votes
2answers
3k 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
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 #?
5
votes
4answers
5k views

Gnu Tools for Windows [closed]

I was looking for Gnu Tools for Windows and came across two links: http://unxutils.sourceforge.net/ and http://gnuwin32.sourceforge.net/ Does anyone know what is the difference between them and ...
5
votes
6answers
705 views

Commandline complete list of commands

Is there a way/command to get a listing of all the commands available on my system from the commandline prompt?
4
votes
2answers
691 views

Is VIM adding the Windows newlines?

Notice the line endings from git diff: - IP_ADDR: 'http://1.2.3.4:143' + IP_ADDR: 'http://2.4.6.8:143'^M I edited this file by putting the cursor on 1 then pressing ct: and then entering the ...
4
votes
3answers
21k 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?
4
votes
2answers
142 views

How can I take the output of a shell script and place it in a file on the command line?

How can I take the output of a shell script and place it in a file on the command line?
3
votes
2answers
805 views

Resolving unix server disk space not adding up

I'm trying to evaluate where my disk space on my unix server is distributed. In order to see disk space current status I'm running: df -h But when trying to evaluate what is taking the disk space ...
3
votes
1answer
841 views

Strange permission changes when saving file on a Samba partition from a Windows editor

I'm trying to figure out why a specific behavior is exibited when perms change on a file being saved from a Windows editor on a SAMBA-mounted Unix partition. Situation: We have a file on Unix, with ...
3
votes
0answers
192 views

Clarification on signals (sighup), jobs, and the controlling terminal

So I've read two different perspectives and I'm trying to figure out which one is right. 1) Some sources online say that signals sent from the controlling terminal are ONLY sent to the foreground ...
3
votes
2answers
662 views

When does rm remove open files?

Particularly, I want to know what happens when I rm an open file and don't explicitly kill the process holding the file descriptor to that file. Will the file be removed when the system is shut down?
3
votes
1answer
151 views

Editing softlinked files in UNIX

Let's say I have file A, and using 'ln -s A B', I have B. When I open, edit and save B, now B is not symlink anymore. It's just a new copy of A. Is this expected behavior? I use Mac OS X, and I ...
3
votes
3answers
3k views

How to store a Unix alias?

I know I can create an alias for untar like this alias untar=’tar -xvzf’ How do I make this persist from session to session, because it seems it is lost when I reconnect?
3
votes
2answers
3k views

Is it possible to find all files with a given inode? Efficiently?

It is possible to find all the paths to a file with a given inode, in general, using find's -inum option. But this has awful performance for typical filesystems. What options are there to improve ...
2
votes
3answers
294 views

Filter file when a column is in whitelist

Suppose I have two files, File A: a,abcdef b,bcdefa c,cdefab a,defabc b,efabcd c,fabcde And File B: a b The output I'm looking for is: a,abcdef b,bcdefa a,defabc b,efabcd So, basically, I ...
2
votes
5answers
2k views

Where does the name in the shell prompt come from?

When I open the terminal on my Mac, this is what it shows: australia:~ rod$ I don't live in Australia, don't have anything to do with Australia, nor have ever setup terminal as Australia. Where ...
2
votes
4answers
2k views

Alternatives to cd/ls for command line navigation?

I generally work a fair amount from the command line in order to launch vim, git, ssh and so on. However, I find the Finder's columnar view more natural for browsing through my files. Unfortunately, ...
2
votes
1answer
1k views

How to create custom keyboard shortcuts in vim?

For example - when coding in Perl, I need to sometimes comment out a bunch of lines. What I do is something like :80,96 s/^\(.*\)$/#\1/ I want to create a custom shortcut for this so that I can do ...
1
vote
1answer
535 views

How to batch rename files in Mac OS X?

I have the bunch of files that have names like MOV001.mpg, MOV002.mpg etc. They all have different date-time. How can I rename them so they turn into 2012 08 05 13 45 33 MOV001.mpg, 2012 09 02 23 ...
1
vote
1answer
5k views

Unix/Linux: recursively search for files containing a string [duplicate]

Possible Duplicate: How to Combine find and grep for a complex search? ( GNU/linux, find, grep ) I have a directory hierarchy of files (some of which are plaintext and others are binary). ...
1
vote
3answers
8k views

Monitor average CPU usage and RAM usage on one process linux

Is there any way to monitor one process' CPU usage and RAM usage over time on linux? I am trying to change to a cheaper VPS and need to work out what level of CPU and RAM I need!