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

32
votes
5answers
49k views

List the current folder folder's sizes with the terminal?

I want a list of the folders from the current directory or one that I specify with their size. I have tried with du but I only get the size of the directories I specify (du . ./f1), and ls doesn't ...
32
votes
4answers
11k views

which/whereis differences

What's the difference between which and whereis ?
32
votes
2answers
10k views

How do I reload .inputrc?

Background I have heard that the readline module is reading ~/.inputrc and that is how it changes the behaviour of keystrokes under programs such as bash. Question How can I reload this after ...
32
votes
2answers
14k views

Is it a bad idea to use the same private ssh key on multiple computers?

I recently bought a laptop from which I need to access the same remote hosts that I do from my desktop. It occurred to me that it might be possible to simply copy the private key file from my desktop ...
31
votes
10answers
26k views

Bash: Reset and Clear Commands

I have been using the command: reset to clear my terminal. Although I am pretty sure this is not what I should be doing. Reset, as the name suggests resets your entire terminal (changes lots of ...
31
votes
3answers
21k views

Unix: How to unsplit in screen

I'm trying to learn how to use screen, in unix so that I don't have to open up several ssh connections and terminal windows just because I want to do more than one thing at the same time on a machine. ...
31
votes
3answers
58k views

How do I make sudo preserve my environment variables?

Using sudo 1.7.4p4 on Solaris 5.10 and sudo 1.6.7p5 on RHEL4 u6 I can't see how to preserve my environment variables, for instance $PYTHONPATH. I've added this line to sudoers, but it doesn't make any ...
30
votes
9answers
30k views

How Unix is Mac OS X? [closed]

From my limited knowledge: The Unix OS coder assumes the user knows what they're doing etc. versus the Apple's you can only do it the way you are allowed to do it, etc. Compared to other variations ...
29
votes
5answers
23k views

Unix zip directory but excluded specific subdirectories (and everything within them)

I'm trying to zip a directory (on Unix via SSH) but I need to exclude a couple of subdirectories (and all files and directories within them). So far I have this: zip -r myarchive.zip dir1 -x ...
29
votes
1answer
24k views

Is there an equivalent to /dev/null in Windows?

If I want to ignore stdout of a command, I do this on *nix: myprog > /dev/null How do I achieve the same on Windows (in cmd or a batch file)?
29
votes
5answers
3k views

Does running commands verbosely make them slower?

I've found myself using the -v flag for lots of applications less and less (especially for trivial stuff like tar and cp). However, when I did and I was, say, unzipping a large file, it would take ...
27
votes
4answers
45k views

What is effect of CTRL + Z on a unix\Linux application

I was curious and confused that what exactly is the behaviour of CTRl+Z. I know, If a process in running in foreground, and we press ctrl+z, it goes to background. But what exactly happens. Does it ...
27
votes
4answers
29k views

How do you find the parent process of a zombie process?

How do you find the parent process of zombie processes? When the child process is something where the parent is not entirely obvious... Is there some way to list processes in tree format or ...
27
votes
5answers
12k 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 ...
26
votes
4answers
74k views

How to gzip multiple files into one gz file?

I have 100 files: cvd1.txt cvd2.txt ... cvd100.txt How to gzip 100 files into one .gz file so that after I gunzip it, I should have cvd1.txt, cvd2.txt ... cvd100.txt separately? Thanks for your ...
26
votes
6answers
19k views

On Linux/Unix, does .tar.gz versus .zip matter?

Cross-platform programs are sometimes distributed as .tar.gz for the Unix version and .zip for the Windows version. This makes sense when the contents of each must be different. If, however, the ...
26
votes
7answers
21k views

How can I find the oldest file in a directory tree

I'm looking for a shell one-liner to find the oldest file in a directory tree.
26
votes
3answers
66k 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 ...
26
votes
2answers
66k views

How to UNIX sort by one column only?

I know that the -k option for the Unix sort allow us to sort by a specific column and all of the following. For instance, given the input file: 2 3 2 2 1 2 2 1 1 1 Using sort -n -k 1, I get an ...
25
votes
7answers
52k views

Which is more efficient - tar or zip compression? What is the difference between tar and zip?

I'm working in Linux environment and want to know about tar and zip commands. Which is more efficient - tar or zip? I also need to know the differences between the tar and zip commands. Can anyone ...
25
votes
2answers
14k views

How does one switch between windows on VIM?

I'm using both Vim and MacVim (or well, trying to). I installed the Tagbar plugin but find it impossible to switch to the actual Tagbar window to make my selection. I've been reading loads about ...
25
votes
4answers
11k views

How are PID's generated?

On *nix, PIDs are unique identifiers for running processes. How are PID's generated? Is it just an integer which gets incremented or a more complex structure such as a list? How do they get recycled? ...
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 ...
24
votes
4answers
17k views

How do I get the mx records for a domain from *nix command line?

What is the best way to lookup MX records for a domain from the command line?
24
votes
6answers
3k views

What is the general consensus on “Useless use of cat”?

When I pipe multiple unix commands such as grep, sed, tr etc. I tend to specify the input file that is being processed using cat. So something like cat file | grep ... | awk ... | sed ... . But ...
24
votes
1answer
4k views

Is there a way to make bash more TAB friendly?

I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it. My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion. For ...
24
votes
4answers
15k views

Exclude hidden files when searching with Unix/Linux find?

What options do I need to use with find to exclude hidden files?
23
votes
4answers
15k views

How do I configure SSH so it dosen't try all the identity files automatically?

I have been putting my ssh identity files inside my ~/.ssh/ folder. I have probably about 30 files in there. When I connect to servers, i will specify the identity file to use, with something like ...
23
votes
3answers
33k views

unix copy a directory

How can I copy a directory structure dir1 to dir2 ? (with all the subdirectories) in unix using the terminal window
23
votes
2answers
14k views

Linux 'man' command: How do I search for a word/phrase and cycle through?

When looking for a certain word or phrase in the man page of linux command, one can type '/' followed by the word/phrase to search for it. What I'd like to be able to do is to search for the next ...
23
votes
2answers
45k views

How do I gunzip to a different destination directory?

How do I gunzip to a destination directory other than the current one? This did not work: gunzip *.gz /putthemhere/
23
votes
2answers
50k views

Allow specific user permission to read/write my folder

I have a folder /home/samantha/folder that I want to share with the user tom. He can read/write the folder. How do I do that? chown wouldn't do it because I still want to be able to be the owner of ...
23
votes
2answers
18k views

Counting total number of matches with grep instead of just how many lines match

Does grep offer a way to count the total number of matches it makes? The -c option only returns the number of lines that matched the regex, but in this case I have multiple matches per line.
23
votes
0answers
23k views

ls -la symbolics… what does that last symbol mean?

Possible Duplicate: what does the @ mean on the output of ls on os x terminal? when I type ls -la I get this familiar output... drwxr-xr-x+ 38 kent staff 1292 Nov 6 11:09 . ...
22
votes
7answers
3k views

Is there a standard unix program that returns a range of numbers

Im learning shell scripting from an outdated textbook, and it seems to me like it'd be really usefull to have a program that just returns a string of numbers delimited by spaces something like $ ...
22
votes
13answers
6k views

Non-Windows, non-Unix-like OS's?

Since most operating systems I've heard of besides Windows seem to derive their heritage from Unix, I've been curious whether any OS's with the following characteristics exist: Not generally ...
22
votes
6answers
1k views

Learning the basics of Linux/Unix [closed]

I would like to learn the basics of Linux; In contrast to tutorials that teach how to do common tasks with Ubuntu or something. I'm looking for a structured introduction, not a reference. Also I would ...
22
votes
2answers
2k views

Is there a git-like file system?

Git stores content uniquely in its repo based on the calculated hash of any file. If my directory has two copies of the same file somewhere inside it, git will only actually store it once. I am ...
21
votes
5answers
2k views

Are Linux commands interchangeable with Unix commands?

I find that some commands, for example, ls and pwd, can be used on both Linux and Unix systems. Is it that all Linux commands can be used in the Unix systems, and all Unix commands can be used in ...
21
votes
9answers
16k views

What's the difference between the commands “su -s” and “sudo -s”?

What is the difference between the two super user commands, su -s and sudo -s? They both give a shell with access to the superuser account.
21
votes
2answers
14k views

How do I interpret the results of the `ls -l` command?

I want to learn about the meaning of values for example first line; drwxr-xr-x 2 ataka root 4096 2008-11-04 16:58 ataka is ataka here the owner of directory ? kioutsovkm@orkide:/users/lnxsrv2/ee$ ...
21
votes
3answers
10k views

Random password generator: many, in columns, on command line, in Linux

A while back, I came across a random password generator for the command line that displayed a grid of "memorable" passwords. Output was something like this: adam@host:~$ CantRememberThisCommand ...
20
votes
8answers
18k views

How can I prepend a line number and tab to each line of a text file?

How can I append a line number and tab to the beginning of each line of a text file?
20
votes
3answers
81k views

How can I concatenate two files in Unix?

How can I create a new file "new.txt" that is a concatenation of "file1.txt" and "file2.txt" in Unix?
20
votes
2answers
8k views

Can the output of one command be piped to two other commands?

How can I pipe the output of one command to the input of two other commands simultaneously?
20
votes
3answers
11k views

Safely get rid of “You have new mail in /var/mail” on a Mac?

I was messing around with sendmail in Rails a year ago and have had this message popping up in the terminal after every command ever since: You have new mail in /var/mail/Lance How do I properly ...
20
votes
6answers
21k views

tar – extract discarding directory structure

unzip has a nifty option -j, whereby the directory structure of the archive is discarded, and all files are extracted into the same directory. Is there a way of making tar work in the same way? ...
20
votes
7answers
5k 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 ...
20
votes
5answers
10k views

Mac OS X: at command not working

I am going to schedule a job by using at command. Here I tried the following command: $ at now + 1 minute echo 'Test at command' <EOD> I saw the job is scheduled by using at -l. However, I ...
20
votes
4answers
15k views

How to copy a file without using scp inside an ssh session?

I have logged on to a system with ssh and there is no scp present on both the systems. How to copy a file without using the scp program.