Questions tagged [unix]

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

Excerpt from the Wikipedia page:

Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees. It has also greatly influenced the development of a free alternative: GNU/Linux.

Unix was originally written in assembly but has since been rewritten in C. It has been branched many times both commercially and open source. One popular variant is the BSD variant which originated from the University of California, Berkeley. It also gave rise to Linux.

Notable Variants

  • Irix (Silicon Graphics)
  • AIX (IBM)
  • Solaris (Sun Microsystems)
  • HP-UX (Hewlett Packard)
  • (UC Berkeley)

Unix is officially trademarked as UNIX.

3969 questions
1717
votes
10 answers

How can I sort the output of 'ls' by last modified date?

How can I sort the output of ls by last modified date?
nearly_lunchtime
638
votes
18 answers

How to copy with cp to include hidden files and hidden directories and their contents?

How can I make cp -r copy absolutely all of the files and directories in a directory Requirements: Include hidden files and hidden directories. Be one single command with an flag to include the above. Not need to rely on pattern matching at…
eleven81
  • 15,376
  • 15
  • 55
  • 83
638
votes
41 answers

How to execute a command whenever a file changes?

I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file. Currently, I'm using this: while read;…
Denilson Sá Maia
  • 12,863
  • 12
  • 40
  • 44
563
votes
7 answers

What is the "You have new mail" message in Linux/UNIX?

Sometimes, when I log into a box and 'su' to root, I get a cute little message saying I have mail (thank GOD it's not AOL). Where is this mail? What does it contain? Who/What sent it? How important is it? Is this even actual "mail" in the same…
n0pe
  • 16,472
  • 18
  • 71
  • 102
415
votes
9 answers

How to get the summarized sizes of directories and their subdirectories?

Let's say I want to get the size of each directory of a Linux file system. When I use ls -la I don't really get the summarized size of the folders. If I use df I get the size of each mounted file system but that also doesn't help me. And with du I…
2ndkauboy
  • 4,343
  • 4
  • 17
  • 8
389
votes
7 answers

How can I make chown work recursively?

I've got a directory called pdfs that contains a bunch of sub- and sub-sub-directories. I want to change ownership on all PDF files in all of the subfolders. I just tried this: chown -R someuser:somegroup *.pdf ...but it didn't change ownership of…
Nathan Long
  • 26,015
  • 36
  • 102
  • 139
383
votes
13 answers

How can I search the bash history and rerun a command?

Can I search history in bash and run the result?
Richard Hoskins
  • 12,245
  • 10
  • 49
  • 52
383
votes
3 answers

What is the Windows equivalent of the Unix command cat?

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type in a folder In Unix: cat *fna…
Kirt
  • 7,001
  • 17
  • 51
  • 61
374
votes
6 answers

less command with multiple files: How to navigate to next/previous

I just found out I can use less with multiple files. less status line tells me (END) - Next: file2.txt But how do I navigate previous/next from less?
Jesper Rønn-Jensen
  • 6,910
  • 7
  • 27
  • 34
350
votes
11 answers

If I know the PID number of a process, how can I get its name?

If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process? What do I have to do?
AndreaNobili
  • 6,981
  • 14
  • 37
  • 46
306
votes
4 answers

How can I find files that are bigger/smaller than x bytes?

In a terminal, how can I find files that are bigger or smaller than x bytes? I suppose I can do something like find . -exec ls -l {} \; and then pipe the result to awk to filter by file size. But shouldn't there be an easier way than this?
ceiling cat
  • 4,327
  • 4
  • 24
  • 32
256
votes
6 answers

Choosing between .bashrc, .profile, .bash_profile, etc

This is embarrassing, but after many years of using POSIX systems full time, I still have a hard time figuring out if a shell customization should go in .bashrc, .profile, or somewhere else. Not to mention some of the OS-specific config files like…
Avdi
  • 2,740
  • 3
  • 16
  • 13
254
votes
18 answers

Unix/Linux find and sort by date modified

How can I do a simple find which would order the results by most recently modified? Here is the current find I am using (I am doing a shell escape in PHP, so that is the reasoning for the variables): find '$dir' -name '$str'\* -print | head -10 How…
Richard Easton
252
votes
5 answers

How to find files with certain text in the Terminal

I'd like to find all files that contain a certain string of text. How would you do that in the Terminal?
Svish
  • 38,310
  • 61
  • 136
  • 181
247
votes
8 answers

What do the parentheses and number after a Unix command or C function mean?

I keep seeing parentheses and a number after a command in Unix or Linux or C function. For example: man(8), ftok(2), mount(8), etc. What do these mean? I see them in man too.
Malfist
  • 2,989
  • 3
  • 27
  • 24
1
2 3
99 100