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.
3,994
questions
1742
votes
10
answers
1.6m
views
How can I sort the output of 'ls' by last modified date?
How can I sort the output of ls by last modified date?
670
votes
18
answers
764k
views
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 ...
645
votes
41
answers
562k
views
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 ...
579
votes
7
answers
775k
views
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 ...
432
votes
9
answers
902k
views
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 ...
413
votes
3
answers
1.0m
views
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 ...
401
votes
7
answers
1.0m
views
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:...
397
votes
13
answers
289k
views
How can I search the bash history and rerun a command?
Can I search history in bash and run the result?
389
votes
7
answers
149k
views
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?
358
votes
11
answers
781k
views
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?
327
votes
5
answers
377k
views
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 ...
279
votes
20
answers
342k
views
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):
...
271
votes
7
answers
278k
views
When should I use /dev/shm/ and when should I use /tmp/?
When should I use /dev/shm/ and when should I use /tmp/? Can I always rely on them both being there on UNIX?
266
votes
6
answers
130k
views
Choosing between .bashrc, .profile, .bash_profile, etc [duplicate]
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 ...
260
votes
5
answers
387k
views
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?