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

1
vote
1answer
22 views

AIX - how to change user shell to bash?

I want to know how I can run bash automatically when I log into my AIX server. How can I do that without having to type bash every time I log into my AIX server?
0
votes
1answer
3k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
1
vote
0answers
18 views

Delay packets sent through a given TCP port

What is the best way to purposely delay packets (by 10 seconds for example) uploaded to a given TCP port (e.g. 1935) on the RTMP protocol? The approach must work on Mac OSx Yosemite. I have tried ...
1
vote
2answers
65 views

Edit xml file using shell script / command

I need to do this using unix script or command There is a xml file in /home/user/app/xmlfiles like <book> <fiction type='a'> <author type=''></author> ...
0
votes
2answers
109 views

Unix Script: Wait until a file exists

I need a script that will wait for a (examplefile.txt) to appear in the /tmp directory and once it's found to stop the program, otherwise to sleep the file until it's located So far I have: if [ ! ...
9
votes
6answers
7k views

bash execution time in milliseconds (mac osx user)

I've checked this , but the solution provided did not work for me. Using date I can get the execution time in seconds: T="$(date +%s)" #some work here T="$(($(date +%s)-T))" echo "execution time ...
1
vote
1answer
27 views

Follow current window in screen -x

Using screen -x (after connecting over ssh) from a second computer is a great way to follow what someone is doing in a terminal. However, if the first person changes the screen window (C-a p or C-a ...
0
votes
1answer
21 views

Unix Networked Display

I'm setting up a space for a group at school where we can do meetings and presentations. We have a few large displays that I would like to be easily usable over the network. We already have a server ...
3
votes
2answers
2k views

Multiple parameters to bash script

I need to check for user provided options in my bash script, but the options won't always be provided while calling the script. For example the possible options can be -dontbuild -donttest -dontupdate ...
0
votes
0answers
14 views

To compile Pandoc Table in Editor by selection

Pandoc table in Tex document based on this discussion --------------------------------------------------------------------------------- ...
3
votes
2answers
1k views

How to justify and center text in bash?

Newbie here. I'm looking for bash script to center and justify text. My script only works with one line of text. How would you improve it? #!/bin/bash COLS=$(tput cols) while true; do clear ...
7
votes
3answers
28k views

How do I reset the $PATH variable on Mac OS X?

I've messed up my path variable, and now some apps that I run raise errors saying Command Not Found (error 127) for commands like date and sleep. These commands work fine when executed directly in the ...
0
votes
1answer
26 views

How to Identify which person with root access has killed a job/process from a pool

I was curious to know if there are 3 or 4 people who has root access to a node. one of the person has initiated a job for running, But some one has killed the job that was running. what would be the ...
0
votes
0answers
9 views

AIX lspath doesn't show any output

root@xxxxx:/>lspath root@xxxxx:/>lspath -l hdisk20 lspath: 0514-538 Cannot perform the requested function because the specified device does not support multiple paths. ...
528
votes
7answers
349k views
2
votes
1answer
961 views

wc / cat command not found

I'm trying to run some simple bash script which uses wc and cat commands. The script fails with this: wc: command not found or this (after I commented string which uses wc): cat: command not found ...
47
votes
4answers
33k views

What does load average mean in unix/linux?

If I run uptime, I get something like this: 10:50:30 up 366 days, 23:27, 1 user, load average: 1.27, 2.06, 1.54 What do those numbers on the end mean? The man page tells me it's "the load ...
142
votes
18answers
73k 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 ...
5
votes
0answers
473 views

Connection timing out when connecting to Milter service

I'm using a VPS with CentOS 5, containing Postfix and OpenDKIM. I have set up OpenDKIM using this guide. Everything seems to work properly as the log in /var/log/maillog does not report anything other ...
7
votes
11answers
16k 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 ...
104
votes
7answers
80k 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 ...
1
vote
1answer
38 views

How to convert column of text to CSV

I have the following output from a command in Unix: "10" "30" "u" "hello" And I want it in the following CSV format without the trailing comma: "10","30","u","hello" I tried tr '\n' ',' but ...
0
votes
2answers
103 views

How can I delete half of the files in a directory?

A directory has files with names ending 001 to 100. How can you delete 2,4,6,8...100. And can that be written as a script. As soon as the directory becomes week old, this has to run. And after a month ...
8
votes
5answers
7k views

Unix command-Line CSV viewer

Is there a convenient command-line csv viewer, possibly a unix tool or a mod of some tools (e.g. vim or python)? I find it easy to simply edit CSV files by writing it manually (since all you need to ...
1
vote
2answers
245 views

How to start a job in the stopped state?

In bash, how can I initiate a job in a stopped state, as if I started it normally and then immediately pressed Ctrl-Z? Or as if I had sent SIGSTOP to the process immediately, but without giving the ...
99
votes
9answers
47k views

How can I search the bash history and rerun a command?

Can I search history in bash and run the result?
1
vote
1answer
57 views

Bash quotes unescaped on command substitution

Can someone explain me why this is working (listing the contents of a directory that has a whitespace in its name): ret="$(ls "my dir")" Shouldn't it rather be interpreted as: ret="$(ls " my dir ...
0
votes
1answer
8k views

Setting timezone in AIX

The timezone is set to "CET" but date displays CEST $ echo TZ CET $ date Tue Apr 16 15:56:57 CEST 2013 Noticed the timezone on another similar system is "CET0" (not sure what the 0 means here!). ...
2
votes
2answers
279 views

Is there colorizer utility that can take command output and colorize it accordingly to pre-defined scheme?

I already know that I can colorize output with grep and with a couple of different ways. I want to have something like supercat, but for commands (and not that dead). The application Supercat ...
2
votes
3answers
2k views

How to test stability of wireless router

I had a wireless router that would intermittently drop connections, so I had switched to using a different router. I have since updated the firmware on the problematic router. Is there an easy way to ...
1
vote
1answer
28 views

Segmenting video to X seconds parts with ffmpeg

I have one video with duration of one minute and 35 seconds. I am able to split it into multiple 30 second segments (I am fully aware of other ways to split a video but chose this for a particular ...
1
vote
2answers
43 views

Given key-value content, how do I group values by key and sort by value?

I've the following sample input format (file or stdin): key1: 1 key2: 2 key3: 3 key1: 4 key2: 5 key3: 6 Is there any few-liner which can group values based on the key and then sort? Expected ...
1
vote
3answers
47 views

How To Quickly Switch Paths (in Bash)

Sometimes, usually when installing packages with brew, I want to disable/remove certain parts of my path, and then later restore them. I haven't been able to find an easy way to do this, and while I ...
0
votes
1answer
13 views

shift all running process from user1 to user2

I have presently all my process running by user1 id on my server . Now we have a new user user2 and we want all the process running by user1 to run by user2. This is done for consistency as all other ...
7
votes
5answers
10k views

How to get the actual directory size (out of du)?

How do I get the actual directory size, using UNIX/Linux standard tools? Alternative question: How do I get du to show me the actual directory size (not disk usage)? Since people seem to have ...
1
vote
1answer
19 views

Why the process of sleep command is always in sleep status?

Why the process of sleep command is always in sleep status ? Sleep status means waiting for I/O right ?
5
votes
5answers
83k views

How to run a command file in PuTTY using automatic login in a command prompt?

I am using the following to login automatically to a remote server and then run commands listed in a commands.txt, like this: C:\path\to\putty.exe -load "[Sessionname]" -l [user] -pw [password] -m ...
2
votes
1answer
93 views

Get rid of “Resource Busy” message on Mac OS X

I am trying to repair a lost HSF+ partition table an iMac by running the i command inside of sudo pdisk /dev/rdisk1. Once I try running the i command, I get an error message saying that the resource ...
106
votes
10answers
62k views

How do I set up SSH so I don't have to type my password?

How do I set up SSH so I don't have to type my password when connecting to a host?
0
votes
1answer
2k views

Unix zip: zip multiple folders in to one zip file without creating a top containing folder

I have a folder like this: -resources --graphics --sounds I want to zip graphics and sounds folder into a .zip file named resources.zip, which I will use zip -r resources.zip graphics/ sounds/ ...
4
votes
2answers
48 views

Why does bash need && to echo a variable on one line?

Why does SOMETHING=1 && echo $SOMETHING need && to return 1 Why doesn't SOMETHING=1 echo $SOMETHING return 1
11
votes
4answers
1k views

Who deals with the star * in echo *

Who deals (interprets) the * in echo * Does the echo see the star or the shell take care about it and return a list of filename .. What about cp temp temp*
1
vote
2answers
41 views

Copying Unix Executable File content from file to file

I am simply experimenting but have found a phenomena that I would be very appreciative if someone could try to explain. I write a simple Hello World program in C. Use gcc to compile this program into ...
0
votes
2answers
6k views

How to move files to hdfs in hadoop using unix command

I have 2 directories "dft" and "hdfs" in the unpacked Hadoop folder. I am trying to copy the file(StartUnit.txt) in dft into hdfs. The corresponding command and exception are as shown below ...
50
votes
6answers
29k views

Is there a way to see any tar progress per file?

I have a couple of big files that I would like to compress. I can do this with for example tar cvfj big-files.tar.bz2 folder-with-big-files The problem is that I can't see any progress, so I don't ...
43
votes
10answers
30k views

Unix: ls, how to sort first directories then files etc

I would like to use ls command to first show direcotries and then files. I tried ls -la | sort -k 1 But I got a wrong order.
1
vote
1answer
41 views

How to parse a space delimited text file

I have a text file like this: Fam1000: CMIN|CMIN_9-RA CMIN|ABC_7-RA GCLA|EFX5.1 GCUC|GCUC_7-RA Fam1001: GCLA|EFX6.1 GCLA|EFX7.1 Fam1002: GCLA|EFX5.1 GCLA|EFX2.1 GCUC|GCUC_8-RA GCUC|GCUC_8-RA Fam1003: ...
1
vote
3answers
2k views

“at” command not working

I wanted to schedule a job with at command and see this error: [root@labeir1 exm]# date Sun Dec 9 01:54:45 IST 2012 [root@labeir1 exm]# at 01:47 "df -kh" syntax error. Last token ...
0
votes
0answers
33 views

Linux - how to force the operating system doesnt go into maintenance mode

Is there any way to prevent or force a Linux System doesnt go into into maintenance mode when there is a system problem?. Example: In this case was for file integrity. Another opcion is if exist any ...
7
votes
3answers
6k views

Recursively chown all files that are owned by a specific user

Is it possible to find and chown all files that a specific user owns? I did a bunch of things as the wrong user and need to give the correct user ownership of the files. Is there a recursive and ...