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

0
votes
1answer
541 views

Using shell script, I need to access a file placed in a location while the script is placed in a different location

I've placed a file in the location /tmp/parent_dir/child_dir/file_1 The script is placed in the location /usr/local/bin/file_load/load_data From this location (/usr/local/bin/file_load/...
0
votes
1answer
180 views

dynamically allocating space for variable in ksh

I am new to ksh unix shell scripting.I need my ksh script to get inputs from the user. and the number of inputs is unkown. I need to get the inputs and process again further .The sample run could be :...
2
votes
2answers
992 views

why does my user show up more than once in ssh

Please help me understand this ps aux output ps aux | grep daniel root 2564 0.2 0.5 8404 2764 ? Ss 04:11 0:00 sshd: daniel [priv] daniel 2621 0.0 0.2 8404 1424 ? ...
1
vote
2answers
947 views

How do I copy only subdirectories but exclude other files in Linux?

Here is my directory structure: /home/folders/test (some directories) and files test.xml test1.xml test.js images (directory) /home/folders/test/images/( some directories ) and files I have to ...
1
vote
2answers
6k views

How do I locate php.ini?

I installed php on the server and php_info(); displays: Configuration File (php.ini) Path /home/gmcnulty/php However, I don't see anything there nor do I see any php directory? How do I ...
0
votes
1answer
692 views

Why does phpMyAdmin display an error with this setup?

Trying to setup phpMyAdmin for the first time with MySQL. I just created the config script with the wizard as follows: $i++; $cfg['Servers'][$i]['host'] = 'http://server_name_here.edu'; $cfg['...
3
votes
3answers
619 views

Unix sort keys cause performance problems

My data: It's a 71 MB file with 1.5 million rows. It has 6 fields All six fields combine to form a unique key - so that's what I need to sort on. Sort statement: sort -t ',' -k1,1 -k2,2 -k3,3 -...
2
votes
1answer
528 views

Bash Shell Hangs on ?+Tab-complete

I often use tab completion in Bash when completing directories, but I find that it hangs for an unacceptable amount of time if I accidentally include a question mark in the directory. I'd like to know ...
2
votes
1answer
102 views

sanity check file to produce binary answer

What Unix command(s) can I use to determine the existence of each of several words and the non-existence of each of several words which will produce a binary answer? For example: I want to be sure ...
6
votes
1answer
9k views

Regex for “or” of multiple words in grep

[Computer]$ grep "foo|bar" filename I understand the above command should return each line in filename where there exits "foo" or "bar". The man pages confirms | as the Regex or symbol and the code ...
0
votes
0answers
230 views

Terminal emulation has stopped working. Garbage escape chars

To enable me to do some remote administration of our servers I started using a terminal emulation program called TouchTerm Pro on my iPhone. While not the smoothest experience, it has allowed me to ...
0
votes
2answers
62 views

stderr to /dev/tty12 for good

I want to redirect persistently stderr to /dev/tty12 so error messages do not touch my nerves when doing something in tty1. The redirection should go through init.d or ~/.bashrc or ~./bash_profile. ...
-1
votes
2answers
508 views

Create a Shell Service in Ubuntu

I want to create a service, which receives input from a shell script and returns outputs. where should I start, and what to do ? Please give me step by step instruction or reference to one. Thanks.
72
votes
3answers
103k 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 ...
2
votes
1answer
67 views

Or(||) operation in `eval`

I found this if statement in /etc/init/rc-initsys.conf # Check for default runlevel in /etc/inittab if [ -r /etc/inittab ] then eval "$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/...
1
vote
2answers
860 views

-bash Mac OS X Lion “puts” returns “command not found”

I'm trying to follow along with this tutorial and the puts command returns command not found and I am not sure why. I've followed this article and looked in the various folders and do not see a puts ...
2
votes
2answers
2k views

in Linux, how to go to the folder above the symbolic link folder of the actual path?

Say I got a folder with absolute location: /tmp/abc/def, and I created a symbolic link to this folder def, in my home directory. The symbolic link is also called def. Then after I get to the def from ...
0
votes
2answers
3k views

Can't access Terminal anymore, only shows a cursor

I run OS X. Following these directions (Installing MySQL on Mac OS X) I added a file to /usr and the contents were PATH=/usr/local/mysql/bin:$PATH Actually I was trying to get the mysql command ...
4
votes
3answers
4k views

Pipe System sound to another computer

i have no speakers in my PC(Cent-OS 5.5) but there is a stereo speaker connected to the computer next to my Computer(Cent-OS 5.5). Both computers are networked. Is there any way to pipe my system ...
0
votes
2answers
679 views

defaults “command not found” when executed after declaration of variable

Why does the following code not work? #!/bin/sh PATH=$PWD/Info defaults read $PATH Everytime I execute it I get ./script: line 3: defaults: command not found Once I do it in one line it work ...
3
votes
1answer
563 views

Why /home folder is missing from my backup archive created by tar?

So I'm doing full backup of my VPS using the following command (as root, of course): tar czvf 20120604.tar.gz / Everything seems to be fine, all files seem to appear in the list. The size of ...
0
votes
3answers
20k views

How to copy a file to a remote server using the command line?

I am trying to copy a file from my desktop to my remote server using the sudo command. I am doing this from the remote machine since I know the password for this machine and I do not have a password ...
8
votes
4answers
13k views

Linux Both Case Sensitive AND Case Insensitive and Always Inconvenient?

I'm using Ubuntu 10 and I'm quickly finding out that it's case sensitive when it's inconvenient for it to be so (like when autocompleting file paths with tab in terminal) but also case INsensitive ...
9
votes
1answer
2k views

Let tmux set urxvt window title according to session-name

Everyday I launch a bunch of urxvtc -e tmux. I am trying to find a way to override urxvt X window title ("tmux") with the current tmux session name set via :rename-session session_name. Does any ...
2
votes
3answers
2k views

How can delete all files except one from a directory? [duplicate]

I need to delete all files, except one (its name is defined), from a given directory. How can I do this from the terminal in OS X? Can I do this with one single command?
2
votes
1answer
299 views

Can tar be forced to exit on the first error?

By default, for many kinds of errors tar prints a message to stderr and then continues on its way -- the errors it calls "recoverable" errors, typically errors that relate to a single file or archive ...
0
votes
1answer
141 views

Precedent for terminal key bindings for Windows or Mac Cmd key

Unix terminals send ASCII codes below 32 for Ctrl + another key, and have at least two ways of sending "meta" (viz. either prefixing code 27 or setting the high bit of an ASCII character). Is there a ...
0
votes
1answer
56 views

On Mac Terminal, how can I know where a given script resides

For example, on my machine, git is at /usr/local/git/bin/git (I found this by fiddling around). Is there a command I can run on my terminal like show-path git which would return the real path? I tried ...
11
votes
4answers
4k views

What is the reason for rmdir(1) and rm(1) to co-exist?

I use BSD and Linux every day, I have never had a circumstance which I must use rmdir(1) rather than rm(1). What's the purpose of rmdir's existence?
1
vote
2answers
91 views

locate similarly named files

I'm running OS X 10.7.3. I would like to locate all the files that have common strings in their filenames. I have a folder that contains several files whose filenames are the same except for the ...
0
votes
1answer
2k views

Mount -a on reboot after modifying /etc/fstab

I added the third line to /etc/fstab. proc /proc proc defaults 0 0 none /dev/pts devpts rw 0 0 tmpfs /dev/shm tmpfs defaults,...
1
vote
2answers
169 views

How to delete everything in folder?

I've tried executing sudo rm * and it does not remove everything. (I probably have lots of objects in there which I don't need.) I'm not asking whether it is OK to remove everything in /tmp, I'm ...
5
votes
2answers
4k views

Howto interpret SMART-Attributes?

I want to estimate the health and the remaining lifetime of my hard drive using SMART (in my case gsmartcontrol). However I don't know how to interpret the attributes. More specifically: Which ...
-1
votes
1answer
3k views

SCP send Lost connection

scp file.txt user1@10.57.111.44:/W/ Each time when I issue this SCP command, I get Connection to 10.57.111.44 closed by remote host. lost connection. Why is this happening??
1
vote
2answers
143 views

How can I avoid descending certain directories with 'find'?

Currently I have this find command which avoids descending particular directories: find . \! \( -name ".hg" -prune \) \! \( -name "localhost" -prune \) \! \( -name "logs" -prune \) -type f The ...
2
votes
3answers
2k views

Split a file on Windows and join back together on UNIX?

I have a process that involves transferring files from the Windows LAN to an AIX UNIX server using FTP through a VPN connection. The problem is that some of the files are very large -- up to 4gb. The ...
0
votes
2answers
283 views

Used tar with wrong order of arguments and overwrote original file. Any way to recover?

Pretty noob move but used tar with the source and destination file arguments swapped resulting in a complete mess (the source file has been overwritten with another file of same name with size 4kb). ...
2
votes
1answer
88 views

Is there a cross-*nix compatible way to get file modified timestamp?

Trying to solve this problem I've come up with solutions that are not compatible between ubuntu and osx. I wish to make one replacement command for the following two, which differ in two characters: ...
1
vote
1answer
136 views

Unix (Debian) autocomplete paths thru symlinks

By default, directory symlinks on unix systems are treated as files as far as the autocomplete feature goes. For example, having a directory symlink at /srv/link/, typing /srv/liTAB does only complete ...
1
vote
0answers
173 views

tcpdump loses connection

I'm on Ubuntu – but it's the same on Debian. I'm using tcpdump in order to track the connection of computers on my private network. At some point, the internet connection of the computers launching ...
1
vote
1answer
265 views

TOP command on SUSE Linux Enterprise Server to find a resource intensive process?

I have a box running SLES but I can't run TOP, apparently it's not installed on the box, is there a way for me to find a resource intensive process that's slowing the box down? Any help will be much ...
1
vote
2answers
8k views

I get a permission denied (public key) when I try to scp in ssh

I can login to the remote server via ssh and navigate through it's file system, but as soon as I try to scp a file from the server to my laptop I get an error message. Example: user@server:/file$ ...
0
votes
1answer
996 views

using history command with ssh and getting output with correct time stamps [duplicate]

Possible Duplicate: using history command with ssh and getting output with time stamps Basically i want to get a record of all commands executed on my ssh server, with their correct timestamps....
3
votes
1answer
383 views

How do i acknowledge gnome 3 notifications using the keyboard?

The title says it. I have been looking for a mouseless method to acknowledge the spiffy gnome 3 notifications.
1
vote
5answers
238 views

Linux file contains “@^@^@^@”, how to restore?

I just finished writing a large c code, but when I save and open again the file contains strange characters: "@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@...
0
votes
1answer
86 views

rsync specific dirs to another exact same path as before

I want to rsync dirs includes files from path to another exact path that has been rsynced from it For example :- path 1 have dir1/ dir1/mysql dir1/log1 dir1/log2 dir1/log3 dir1/home want to ...
3
votes
2answers
1k views

Run command as root but create files as another user?

Is there a way to run a command as root (using sudo perhaps) but have the files created by that command be owned by someone else? Some context: I have a web server that I run as root in order to have ...
0
votes
2answers
2k views

Understanding .bashrc and .bash_profile [duplicate]

Possible Duplicate: When should I put configurations into .bashrc vs into. .bash_profile? I am a n00b when it comes to working in Linux env and would like to know the purpose of .bashrc and ....
1
vote
1answer
846 views

using ulimit for current shell

I want to increase the hard limit of maxfiles using ulimit -Hn for the current bash shell. The problem is I can not do it without using sudo. But, when I do sudo ulimit -Hn unlimited, it does not ...
1
vote
1answer
226 views

Terminal highlighting and auto complete

Do you know some plugin for highlighting and autocomplete in postgreSQL terminal?