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

16
votes
3answers
6k views

Use GNU screen as login “shell”

What's the best way to have screen automatically run when you open a new shell, whether by login, xterm, or anything else? I see the most common recommendation is to put exec screen in your regular ...
15
votes
4answers
13k 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.
15
votes
5answers
12k 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.
15
votes
5answers
16k views

ps: How can i recursively get all child process for a given pid

How can I get the entire process tree spawned by a given process displayed as a tree and only that tree i.e. no other processes? The output could e.g. look like 4378 ? Ss 0:10 SCREEN ...
15
votes
7answers
4k 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 ...
15
votes
2answers
23k views

What is a CPU tick?

Question: How is a CPU tick calculated and what does it represent? Does a single tick equate to 10 miliseconds thus if some thread reported not called for (5 * 10 ticks = 500 ticks) does this mean ...
15
votes
2answers
4k views

What happens to running processes when I lose a remote connection to a *nix box?

I occasionally lose my remote SSH connection to my VPS. I use screen for long-running processes, but am wondering what happens to the processes I had running aside from those run within a screen ...
15
votes
1answer
668 views

Make Firefox use the favicon as window icon under Linux

Is there a Firefox feature, setting, or add-on that arranges it so that the favicon of the currently open web page becomes the icon of the browser window in Linux/X11? In particular, it ought to show ...
14
votes
7answers
899 views

Is there a way to go to any directory from any other directory directly?

Is there a way to go to any directory from any other directory directly? For example, lets say that I'm at root and I wanted to go directly to currentProject without doing: cd ...
14
votes
8answers
14k 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?
14
votes
5answers
365 views
14
votes
4answers
2k views

Is there an image viewer that takes images on STDIN?

I'm looking for an image viewer that takes data on stdin and can be run like: cat image.png | imageviewer
14
votes
9answers
4k views

Finding what's using all the space in *nix

Which sequence of commands will tell me which files are the largest starting from a particular directory, including all sub directories? I want to know where all the space went. Preferably just with ...
13
votes
5answers
14k views

use rm to remove files and directories recursively

is it possible to use rm to remove files and directories matching a pattern recursively without using other commands?
13
votes
4answers
4k 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
5answers
748 views

How to jump to a particular flag in a Unix manpage?

When reading a Unix manpage in the terminal, how can I jump easily to the description of a particular flag? For instance, I need to know the meaning of the -o flag for mount. I run man mount and want ...
13
votes
5answers
4k views

How to mass prepend text to file names?

Lets say I have a directory full of .md files all named various things. Lets say I wanted to prepend "text" to the front of each file name. So for example: file a.md, b.md, and c.md would become test ...
13
votes
4answers
11k 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.
13
votes
4answers
7k views

How can I recursively grep paticular files in a directory

I'm new to linux and grep, and trying to find my way around. By using find -name *.java I am able to find the names of all of the java files in a particular directory. Suppose I want to count the ...
13
votes
3answers
10k 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 ...
13
votes
4answers
13k views

Users in /etc/passwd on Mac OS X

By examining the /etc/passwd I should get a list of all users in the system. However, when dumping the passwd file on Mac OS X I don't see my current username but many entries like these: ...
13
votes
2answers
8k views

Difference between /etc/crontab and “crontab -e”

What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?
13
votes
3answers
12k views

UNIX - mount: only root can do that

I need to allow a non-root user to mount/unmount a device. I am a total noob when it comes to UNIX, so please dumb it down for me. I've been looking all over teh interwebz to find an answer and it ...
13
votes
2answers
3k views

Unix: Files starting with a dash, -

Ok, I have a bunch of files starting with a dash, -. Which is not so good... and I want to rename them. In my particular case I would just like to put a character in front of them. I found the ...
12
votes
5answers
1k views

How do we pronounce “/etc” folder? [closed]

Can't find similar question in SU. Anyone knows? Is it only 3 letter e,t and c? I can't find similar things in google. It would be good if someone provide this answer
12
votes
8answers
767 views

Is there a command for going back a number of steps in a directory, without using cd?

I'm constantly going 'cd ../../../../'. Is there a command/alias that could let me go 'cmd 4' and I'd be taken back 4 directories?
12
votes
4answers
16k 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 ...
12
votes
5answers
1k views

How to jump back to the first character in *nix command line?

When writing a long command in the *nix command line and having to go back to the first character, in order to add something at the beginning (for instance a nohup, when you realize the process will ...
12
votes
3answers
25k views

Copy list of files

I have a list of files separated by spaces in a file list.txt. I'd like to copy them to a new folder. I tried to do: cp `cat list.txt` new_folder but it did not work. How would you do this ? ...
12
votes
3answers
11k views

Bash Man Page: kill <pid> vs kill -9 <pid>

My man page does not document the difference between kill <pid> and kill -9 <pid> Since these do different things why is the -9 not documented in the kill manpage? I thought maybe ...
12
votes
8answers
7k views

How to run commands as in a queue

I need to do a lot of copying of various files to various folders. I can add all my copy commands to a bash script and then run that, but then I must wait until it finishes if I want to add more ...
12
votes
6answers
8k views

Full command text with unix ps

When we enter: ps -f ... the CMD column text doesn't show the full command. Any way to prevent this truncating? Seems like it's showing the first 80 characters. We are running a fairly ...
12
votes
8answers
23k views

Tell `ls` to print only the base filename

This is the default behaviour of ls ls /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm ...
12
votes
2answers
674 views

Why does redirecting the output of a file to itself produce a blank file?

Why does redirecting the output of a file to itself produce a blank file? Stated in Bash, why do less foo.txt > foo.txt and fold foo.txt > foo.txt produce an empty foo.txt? Since an ...
12
votes
4answers
8k views

Why is the size of a directory always 4096 bytes in unix?

I am sure a directory file has much less information than 4096 bytes. I know the sector size is 4096 bytes. But normal files smaller than that do exist. Why does Unix reserve 4096 bytes for each ...
12
votes
5answers
11k views

.tar files without directory structure

I'm .taring some files with the path example/super_user/Output.*. The resulting .tar looks like this: + example + super_user - Output.zip - Output.xml - Output.txt ...
12
votes
3answers
9k views

Can I monitor a local unix domain socket like tcpdump?

I'd like to monitor responses on a unix socket without disturbing the original connections and pipe them to a script for processing. I know how to do this with tcpdump for tcp connections but I ...
12
votes
4answers
8k views

Terminal Vs. Shell [duplicate]

Possible Duplicate: What are the differences between shell , console & terminal? This probably sounds like a stupid question but I'm having a lot of trouble clearly differentiating ...
12
votes
3answers
3k views

Making Linux shell prompt show last return value

I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple). My own computer ...
12
votes
3answers
4k views

Using `find` for multiple file extensions

I am using the following command for counting the lines of text in JAVA files: find . -name '*.java' | xargs wc -l How can I modify the find command parameters to match more than one file ...
12
votes
2answers
11k views

Unix: Is there a way to “copy” file or directory permissions?

I have two files in a directory. One has correct permissions and the other has not. Is there a way I can "copy" the set of permissions from one file to another?
12
votes
2answers
7k 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--@ ...
11
votes
6answers
11k views

Find and delete all the directories named “test” in linux

I have many directories named "test" and I would like to remove them. I know how to find them and print them using: find . -name test -print Now, how to do I remove the directories? Please note ...
11
votes
5answers
3k views

Map “untar” to tar xvfz?

How can I map 'untar' as a command to 'tar -xvfz' ? Sorry, but I almost always forget the arguments necessary to 'tar' for this operation.
11
votes
2answers
14k views

How to keep program running after SSH disconnection? [duplicate]

Possible Duplicates: Keep a program running after closing a console, after the program has started How can I use ssh to run a command on a remote Unix machine and exit before the command ...
11
votes
7answers
6k views

Advantages of cat'ing file and piping to grep

Are there any additional advantages of cat'ing a file and piping it to grep, besides convenience? The convenience being that, when I retrieve commands such as those below from my history, the cursor ...
11
votes
3answers
18k views

finding L2 cache size in Linux

I wanted to know how to find L2 cache size in Linux... for L1 cache size, I am doing the following pico /proc/cpuinfo what about L2 cache size?
11
votes
7answers
6k views

Sorting human readable file sizes

How can I sort a list using a human-readable file-size sort, numerical sort that takes size identifier (G,M,K) into account? Can I sort "du -sh" output for example? Problem: Consider the problem of ...
11
votes
3answers
10k views

what is the max length of password on unix/linux system?

what is the max permissible length of password on unix/linux system?
11
votes
2answers
348 views

Linux mv command moved data to an unknown location?

I accidentally executed this command in SSH: mv /var/www/vhosts/website/httpdocs/magento/* Now all the data in the magento dir is gone. Does anyone know where it moved to? Thanks!