Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.
9
votes
8answers
483 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 ...
9
votes
1answer
2k views
What does the 'rc' in `.bashrc`, etc. mean?
Well, this is embarrassing. I feel like I just realised I don't know a loyal colleague's name after working with them for 10 years. "Hey, er... *cough!*, thanks for that great job you did on setting ...
9
votes
2answers
6k views
How long are files kept in /var/tmp/, and how to use the directory?
I'm always hesitant to use /var/tmp/, because I never quite know exactly how long the files are kept there for, or even what the directory is used for. What determines when a file gets removed from ...
9
votes
5answers
710 views
Export NFS path containing “-” (dash)
I'm in a bit of a pinch with NFS exports file.
Specifically, I can't find a way to export a directory containing "-" in the path name.
Manual (exports(5)) states:
Also, each line may have one or ...
8
votes
8answers
4k views
grep all .java files in a directory for a particular string
How would I search all .java files for a simple string (not a regex) in the current directory and all sub-directories on Mac OS X? I just want to print a list of file and directory names that match.
8
votes
3answers
21k 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?
8
votes
4answers
286 views
Unix tools: what if a file is named minus something?
I'm always wondering: most GNU/Unix tools take options in the form "minus something", sometimes followed by an argument. What if you got a file named minus something?
$ ls
-f
$ rm -f
$ ls
-f
$ mv -f ...
8
votes
2answers
7k 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 ...
8
votes
5answers
1k views
How is \$ being interpreted by grep?
When I write
$ grep \$
then whatever I type on terminal, is matched and printed on terminal. How is \$ being interpreted?
8
votes
8answers
2k views
Mass renaming, *nix version
I was looking for a way to rename a huge number of similarly-named files, much like this one (a Windows-related question) except that I'm using *nix (Ubuntu and FreeBSD, separately). Just to sum up, ...
8
votes
3answers
6k 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 ...
8
votes
2answers
4k 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?
8
votes
3answers
2k views
SSH: completly disabling password authentication
is there a way to disable password authentication completely? The command line is the following:
ssh -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no machine"
it STILL asks for a ...
8
votes
2answers
2k 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.
8
votes
1answer
3k 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 ...
8
votes
3answers
11k 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 ...
8
votes
3answers
3k 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$ ...
8
votes
4answers
7k 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 ...
8
votes
4answers
3k views
8
votes
4answers
3k 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 ...
8
votes
2answers
19k views
Subsystem for UNIX-based Applications in Windows 7
Noticed a thing called Subsystem for UNIX-based Applications in the Turn Windows features on and off dialog under Windows 7. Never seen it before, and it seems interesting. What exactly is it really? ...
8
votes
5answers
6k views
sudo chmod -R 777 /
sudo chmod -R 777 /
I did this. It was a mistake. Is there any way to undo it?
Basically it's messed up more things than I can list. I don't have time-machine enabled on my mac.
8
votes
4answers
4k 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 ...
8
votes
4answers
4k 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
...
8
votes
8answers
3k views
“Detach” and “Reattach” xterms across X sessions?
Is there a way to save/detach an xterm (or another window), and reopen/load/reattach it on a different X session on the same machine ?
What I'm trying to achieve is "move" running xterms between two ...
8
votes
3answers
2k 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 ...
8
votes
4answers
5k views
Vim highlighting for specific file types (where to put syntax files, vim events, line to put into vimrc)
I have defined a file time jak.vim to offer custom highlighting when I take notes, however it is being applied to some files that do not have the .jak extension. Specifically a file named ...
8
votes
2answers
4k views
Finding all symbolic and hard links to a file on UNIX
If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?
8
votes
1answer
1k views
PowerShell vs. the Unix Shell
I've heard some things about the features of the PowerShell. Some of it seems like typical features of Unix shells.
So it seems Powershell includes piping and the commandlets, similar to shell ...
8
votes
2answers
13k views
How can I check the user command history in Unix?
I know the 'history' command give me a list of the commands I have typed into the Unix terminal.
How do I see the command history for all of the users currently logged onto the system?
7
votes
4answers
7k 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?
7
votes
7answers
3k 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 ...
7
votes
4answers
3k views
Keep a program running after closing a console, after the program has started [duplicate]
Possible Duplicate:
How do I detach a process from Terminal, entirely?
I've a program running in a Unix console on a remote Unix computer. I (stupidly) didn't run it using nohup &, and ...
7
votes
5answers
2k 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 ...
7
votes
6answers
5k 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 *
7
votes
3answers
7k 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.
7
votes
3answers
8k views
How can I use ssh to run a command on a remote Unix machine and exit before the command completes?
How can I use ssh to run a command on a Unix machine and exit before the command completes?
For instance, if I type
ssh localhost 'sleep 60 &'
ssh hangs on my terminal until sleep completes, ...
7
votes
2answers
3k views
What does the @ in ls -al mean? [duplicate]
Possible Duplicate:
ls -la symbolics… what does that last symbol mean?
What does the @ in the below execution of ls -al mean?
atom:Lib fak$ ls -al
total 1056
drwxr-xr-x 5 fak staff ...
7
votes
4answers
632 views
Sorting numerically in a comma-delimited file with Unix
I've got a comma-separated file that looks like this:
100,00869184
6492,8361
1234,31
200,04071
I want to use sort to sort this file numerically by the first column only.
Desired Result:
...
7
votes
4answers
7k views
How to call bash functions
Maybe I am looking at this the wrong way.. But here I what I am trying to do. Do most of my work with Java but just switched to a unix (bash) environment. I am doing this:
[~/Desktop/bashPlay]% ...
7
votes
3answers
2k views
How do I set up SSH so I don't have to type a password, and without using a public key?
I know there are dozens of questions here about how to connect to an SSH server without typing your password every time, and the answer is always "use a public key." Well, I find myself in the rare ...
7
votes
5answers
661 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
3answers
2k views
How can I create a cron job that runs a task every three weeks?
I have a task that needs to be performed on my project schedule (3 weeks).
I'm able to set up cron to do this every week, or (for example) on the 3rd week of every month - but can't find a way to do ...
7
votes
3answers
2k 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 ...
7
votes
2answers
2k views
Practical tips when transitioning to xmonad?
I like the idea and concept of xmonad, however I still keep going back to gnome after an hour or so. This feels like when I first tried to learn vim, but I've gotten past the learning curve point and ...
7
votes
5answers
529 views
Is it possible to get your router's external ip address without using a website?
I was wondering if there was a way to find out your router's ip address without using a website like www.whatismyip.com.
I searched around, and I am beginning to think it is impossible. If that is ...
7
votes
2answers
2k views
using a second computer as a mere screen/monitor in X (VNC?)
My goal is to use three monitors with my Linux system. It is a laptop, so adding another video card is not the easiest solution. (I have investigated a number of such options: getting a docking ...
6
votes
5answers
3k views
Is there a VI equivalent I can use on Windows XP and later?
I get frustrated using Notepad on my Windows XP machine when I want to do more complicated text manipulation. Having used VI on various versions of UNIX I'd like to get something with its power on my ...
6
votes
11answers
1k views
Unix: How can I allow only one person to see my folder in the same fs?
I want to give an access to a dir for a friend. He has the access to the file system, where the dir is located. I don't want to set the permissions to all users. How can I allow only a person to see ...
6
votes
2answers
598 views
Passing options to a program: what's the convention for one dash vs two?
Some programs will take options like this:
$ someprogram -orange apple
And other programs will use something like this:
$ otherprogram --orange apple
Is there a "rule" or convention for this in ...