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

6
votes
2answers
804 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
4k 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
282 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
22k 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
652 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 ...
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 ...
16
votes
4answers
17k 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
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
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 ...
9
votes
2answers
5k views

Printing pages from 7 to 17 by lpr

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

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

File: O000000667520994000000074720121112000000N^@^@^@ I used the below command but it doesn't work. grep "^@^@^@" *
5
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? ...
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
4k 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
692 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
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 " <----
4
votes
3answers
20k 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
139 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
764 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
768 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
181 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
635 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
275 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
2answers
2k views

Why doesn't 'find' prune the way I think it should?

I'm running MacOSX 10.5.8 I run the following: ~/Sites/jjprof/trunk/content > find . -type d -name '*svn' -prune ./.svn ./resources/.svn ./resources/sitewide/.svn ./temporary/.svn ./users/.svn ...
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
513 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
1answer
12k 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 ...
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!
1
vote
2answers
12k views

How to create a cron job to upload files to an FTP server

I would like to create a cron job that uploads files from a directory on my computer to my FTP server. I would like it to do it daily at midnight. I know pretty much nothing about cron, so I ...
0
votes
1answer
686 views

Unable to edit files in _www group on OS X

I am using my MacBook as a local dev environment. In order to make the files publishable I had to give my web folder user and group of _www:_www using chown. I'm using another account to log into my ...
0
votes
2answers
2k views

execute ssh command without password? [duplicate]

Possible Duplicate: How do I set up SSH so I don't have to type my password? i execute the following command :- ssh -l admin hostname command but each time i execute it, it ask me to ...
0
votes
1answer
894 views

Unix: How to one-way-sync directory with FTP directory

Is there a good command I can run from the Terminal that will one-way sync a directory with an FTP directory in a smart way? I'd like it to for example delete all files on the FTP that no longer ...
0
votes
6answers
132 views

what did I do on my linux box, used the rm incorrectly

What will this command do on unix: rm somefile ~/data I was trying to move somefile to the folder at home/data