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
40 views

Find UID of user via SAMBA [closed]

Is there a way to retrieve the UID of a user via a SAMBA share? I can get the user list with: rpcclient -W 'WORKGROUP' -c querydispinfo -U''%'' '192.168.21.129' 2>&1 index: 0xa RID: 0x4c0 ...
3
votes
3answers
485 views

Mac- or Unix-compatible utility to compute and compare LAME MusicCRC in MP3s?

The LAME encoder stores a CRC16 checksum of the audio stream in the header of every MP3 it encodes. The 'actual' audio checksum can then be computed and compared to the original value at a later date ...
0
votes
1answer
37 views

Matching () with a Unix/Linux regex

I have a couple files with the name (a).1 (a).2 ... (a).100 Since a lot of processing tools don't really like ( and ) in the filename I thought it best to rename them to a different name. I googled ...
0
votes
0answers
37 views

x11 forwarding from windows to unix

i am trying to launch some GUI to a UNIX server from my win7 laptop. I have installed XMing Server (as also its fonts and XLaunch) and i am using a putty in order to launch an SSH session from my ...
0
votes
1answer
13 views

How can i detect if the virtual CD ROM is attached or detached?

I have a requirement where i need to check if a virtual CD ROM is attached if yes then read the values and apply it on to the application. But couldn't find a way to detect if a CD ROM is attached or ...
6
votes
4answers
6k views

What are the advantages of symlinks over hard links and viceversa?

I understand the differences between symbolic and hard links, but I've never understood why choose one or the other.
0
votes
2answers
57 views

Unix/linux shell scripting floating point division

I have to divide two floating point values and store it in variable. My code below v_missedvol=4003.03 v_allvolume=3003.03 v_vol_temp= $(echo "$v_missedvol / $v_allvolume" | bc -l ) the result ...
3
votes
4answers
2k views

Get md5sum without file name?

I need to get the md5 sum of a file on AIX, but the md5sum program prints the sum followed by the name of the file. How can I get the sum without the file name.
2
votes
1answer
158 views

Why can't “sudo cp” find the files?

Who can give me a logical explanation to this issue: I can not run this command: sudo cp /data/*20150522* /backup/ cp: cannot stat `/data/*20150522*': No such file or directory And when i switch ...
0
votes
1answer
40 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 ...
2
votes
1answer
91 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?
1
vote
0answers
39 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
394 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
8k 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
30 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
26 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 ...
1
vote
0answers
27 views

To compile Pandoc Table in Editor by selection

Pandoc table in Tex document based on this discussion --------------------------------------------------------------------------------- ...
3
votes
2answers
2k 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 ...
8
votes
3answers
30k 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
0answers
52 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. ...
575
votes
7answers
383k views
2
votes
1answer
1k 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 ...
49
votes
4answers
35k 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 ...
6
votes
0answers
550 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
18k 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 ...
1
vote
1answer
40 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
120 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
259 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 ...
112
votes
9answers
53k 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
71 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 ...
2
votes
2answers
335 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 ...
1
vote
1answer
70 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
81 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
55 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
15 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
11k 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
25 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 ?
2
votes
1answer
408 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 ...
110
votes
10answers
66k 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?
4
votes
1answer
56 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
62 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 ...
53
votes
6answers
32k 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 ...
46
votes
10answers
32k 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
51 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
51 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
7k 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 ...