Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.
5
votes
4answers
156 views
How to rename a file inside a folder using a shell command?
I have a file at some/long/path/to/file/myfiel.txt.
I want to rename it to some/long/path/to/file/myfile.txt.
Currently I do it by mv some/long/path/to/file/myfiel.txt ...
5
votes
3answers
12k views
Copy Folders from one Unix server to another?
I would like to copy a folder from one Unix server to another Unix server. Can anyone tell me if there is a method or command to to achieve this?
5
votes
4answers
7k 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:
...
5
votes
2answers
2k views
Select text from Terminal.app using the keyboard in OS X
I like to copy things from the terminal, but I don't like to have to move to the mouse. How do you select text in Terminal.app using the keyboard?
For example, while in Terminal one might like to be ...
5
votes
3answers
1k views
Difference between df -k and du -sh
df -k
/dev/sda6 25396228 21249088 2836240 89% /export
21G used
versus
du -sh /export
3.4G /export
The 3.4G is correct because we have removed all non essential file but free ...
5
votes
1answer
967 views
How to escape the At-sign (@) in Bash
Since Apple made a requirement for certain file names to include an at-sign (@) in my iPhone application project, I can't check in my files using the Subversion commandline. How do is escape the @?
5
votes
2answers
1k 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 ...
5
votes
3answers
834 views
Am I using sed properly to perform this conditional replace? Is there a better way?
I have a space-delimited file that's about 3200 lines long. Each line contains 7+ fields.
What I would like to do is edit the file with sed so that every line containing a certain variable in field 5 ...
5
votes
3answers
5k views
Unix - delete files and folders excluding PATTERN
Recently I was faced with the task of deleting all the files/folders in a directory excluding those matching a specific pattern. So I cooked up a single-line unix command to do the work. Must it be ...
5
votes
3answers
1k views
5
votes
5answers
2k views
See history of who all opened a particular file
How can I know who opened a particular file recently but might not have kept it opened at the moment?
Anyone has an idea?
5
votes
4answers
4k 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 ...
5
votes
4answers
5k views
Unix 'grep' for a string within all gzip files in all subdirectories
How do I grep for a string recursively through all .gz files in all directories and subdirectories?
5
votes
3answers
3k views
How-to limit Unix FIND results number
Is there a way to limit the number of results returned by the FIND command on an unix system?
We are having performance issue due to an unsually large number of files in some directories.
I'm tryging ...
5
votes
2answers
88 views
How to connect to a SSH session that was backgrounded with -f -N?
I'm doing some work where I need to pivot off a machine using proxychains so I'm connecting to a system and binding a local port like so...
ssh -f -N -D 9000 user@host.com
… which returns me back ...
5
votes
1answer
71 views
How to let `man` utility to use `less` to display manual rather than `more`?
I've this Solaris 10 installation and it uses more to display manual content. Is there a way to make it using less to display manual? because more is really not convenient to use.
Thank you.
5
votes
3answers
4k views
How do I log all UNIX shell commands submitted by all users?
Is there an elegant way to log every command submitted in all shells on a machine? This is in the context of an infrequently-used Ubuntu server, of which I am the only human user. (There are several ...
5
votes
2answers
457 views
Potential issues with adding /usr/local/[s]bin to root's path?
I've noticed that the root account $PATH does not include /usr/local/bin or /usr/local/sbin by default. Are there any potential issues that could arise from adding those directories to the path? If ...
5
votes
3answers
560 views
Why are there short and long alternatives for command line options?
Most unixoid commands feature short and long alternatives for command line options, like ls -a and ls --all, or ls -A and ls --almost-all. Why do those two ways exist? One is shorter to type, the ...
5
votes
3answers
2k 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 ...
5
votes
2answers
367 views
So port is not unique by machine at all?
$ lsof
memcached 15844 root 28u IPv6 113604 TCP *:11051 (LISTEN)
memcached 15844 root 29u IPv4 113605 TCP *:11051 (LISTEN)
memcached 15844 root 30u IPv6 113609 ...
5
votes
2answers
5k views
Unix: How to merge two directories
Say I have two folders with various content, foo and bar. How can I merge bar into foo so that:
Files in foo that are not in bar are untouched.
Files in bar that are not in foo are now in foo.
Files ...
5
votes
1answer
987 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 ...
5
votes
1answer
149 views
What does the index mean e.g. pkg-info(1)?
Many man pages include an index e.g. pkg-info (1) and sometimes the same man page references the same base but with different indices e.g. pkg-info (4).
What does the index stand for?
5
votes
1answer
108 views
Grep for many arguments [duplicate]
Possible Duplicate:
Grep command, to remove lines containing a specified word
How do I grep for more than one words in one grep command. For example:
cat file.txt | grep -v 'word1' | grep ...
5
votes
2answers
3k 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--@ ...
5
votes
1answer
778 views
STDOUT of a disowned program
As followup of this question, I would like to know where the STDOUT and STDERR of a program on which I've run disown -h is redirected to.
5
votes
2answers
105 views
Blacklist IPs after certain paths requested with Apache2
I have noticed a lot of hackers trying to penetrate my system by making requests for certain paths on my webserver that don't resolve to anything.
Examples: /config/pwtoken_get, ...
5
votes
1answer
468 views
ZSH tab completion of git commands is very slow. How can I turn it off?
If I type:
rm <TAB>
I'll see possible completions almost instantly.
However, if I type:
git rm <TAB>
It'll hang for several seconds if it's in a git repo, or fail to show any ...
5
votes
1answer
3k views
sudo chown fails with operation not permitted
I have found similar questions here, but the answers provided to those questions do not resolve my problem.
If I do:
sudo chown <username> main.m
I get an operation not permitted error.
...
5
votes
5answers
339 views
ports and what they do
I am curious as to what a port number does. Are there specific port numbers for specific things?
I know there is port 80 and I heard of 8000 in passing. I don't know why they are called that and ...
5
votes
6answers
3k views
Screen Capture - command line?
Is there a command line tool out there that can record your computer screen and audio device and then save that to a file?
5
votes
2answers
1k views
How to create shortcut command in Mac
I would like to a shortcut command in Mac as I frequently call commands that are a bit long in Terminal. How can I do that?
5
votes
1answer
78 views
Merge sorted lists
I have a few .txt files (in the same directory) that look like this:
123 carrot
50 apple
13 tomato
5 potato
2 pear
and
100 carrot
10 apple
3 tomato
2 potato
...
5
votes
3answers
3k views
How to get I/O usage by process in Unix? [duplicate]
Possible Duplicate:
Linux: Is there something similar to "top" for I/O?
I am trying to do some CPU intensive operation on a Linux machine and it is showing very high load.
I want ...
5
votes
1answer
475 views
Linux/Unix - how to enable one user to `sudo` without a password
How can a user be setup to sudo (or su -) without entering a password?
5
votes
2answers
236 views
What are some good mnemonics for common Unix commands?
There are a lot of common commands we use on the command line whose names or standard arguments can be difficult to remember. What are some good mnemonics that can be used to remedy this problem?
...
5
votes
2answers
159 views
Cygwin Connection closed by ::1
During the installation of Hadoop I am trying to setup CYGWIN and ssh. Installed and ssh also started successfully and setup authorization key as instructed HERE but When I try to connect to the ...
5
votes
1answer
82 views
cat-ing a file to a unix pipe causes Matlab to freeze
I've created a named pipe on Debian using mkfifo pipe.in. I want to write to this pipe from Matlab.
To do this, I use the following matlab command:
unix( 'cat <myfile> > pipe.in' )
...
5
votes
4answers
5k views
Stuck choosing between ext4 and ext3 for the file system
I was in the process of installing Ubuntu 11.10, but got stuck choosing which file system to use.
ext3 and ext4; which is better for a personal desktop?
If ext4 is better, will it work well on my ...
5
votes
2answers
283 views
How to prove a file was not tampered?
So for one of my programming assignments, I used the turnin command as opposed to a class-specific binary that I was supposed to use. I didn't realize this until I found out that my assignment wasn't ...
5
votes
4answers
2k views
individual cpu % in 'top' output
Usually to view individual cpu % we press '1' in the interactive mode of top.
However I am not able to figure out the logic to get the same output in batch mode i.e,
top -n1b
I am redirecting this ...
5
votes
2answers
56 views
Process files in a folder that haven't previously been processed
I have a series of files in a directory that I need to carry an action out on using a script. Once the action is done, then I want to keep a log that the file has been processed, so that the next ...
4
votes
9answers
645 views
Remove a file named “.”
I found a file in a directory named "." Not the "." indicating the directory but an actual file with content in it. This, as you can imagine is causing all sorts of problems. The problem is I can't ...
4
votes
5answers
484 views
Why do we use ./progname in *nix systems to execute a program?
I've been using Linux & Mac for sometime now and I always wonder - Why do we have to execute a program like ./progname . I know Unix treats every thing as a file and it stores the filename in a ...
4
votes
8answers
431 views
Fast Ways of Cd'ing on *nix?
I find myself constantly typing (using tab, of course) absurd paths like
cd path/to/the/thing\ that\ I\ need/python/proj/eraseme
Aside from doing an ln -s (or some other type of ln?), is there any ...
4
votes
8answers
4k views
Is there some difference between mv and {cp + rm the old file} on Unix?
mv a b
cp a b;rm a
These are two sets of statements. Is there some difference between what they do?
4
votes
8answers
6k views
How to check the current disk space used by my linux?
The entire box. How many gigs is everything using?
And how do I check total?
4
votes
10answers
4k views
Scripting: what is the easiest to extact a value in a tag of a XML file?
I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example:
<?xml version="1.0" encoding="UTF-8"?><project
...
4
votes
3answers
160 views
Why does this bash command take up all space on device?
I'm a little new on searching via bash, so feel free to give me suggestions on the methods to use instead of this, which I'll never use again :)
I'm searching for occurances of a string, recursively ...