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
42 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 ...
1
vote
1answer
22 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 ...
3
votes
2answers
42 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
1
vote
2answers
39 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 ...
2
votes
1answer
77 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 ...
1
vote
2answers
31 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
44 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 ...
1
vote
1answer
40 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: ...
0
votes
0answers
30 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 ...
1
vote
0answers
32 views

How to convert .torrent file into magnet link?

I'm interested of converting a .torrent binary file into a magnet file. What are the possibilities to achieve that in Linux/Unix/OSX? Sample format: ...
2
votes
0answers
20 views

Why does Linux(and perhaps Unix) set the default chmod to 644? [closed]

The 6 for the owner makes sense, and 4 for groups makes sense. But why can everyone read? It personally seems like an opening for potential misconfiguration.
2
votes
1answer
39 views

UNIX, how to compare and transfer values between two text file

I have two text files with different number of columns in them and I want to compare values of a given column in file1.txt with values of a given column in file2.txt: if these values found in ...
1
vote
0answers
12 views

tcpdump - rotate capture files using -G -W and -C

I'm looking to be able to capture a rotating tcpdump output which captures 30-minutes worth of data, into 48 files, cyclically. The man implies this should be possible, but my testing doesn't seem to ...
0
votes
2answers
45 views

Is there any Unix window manager that looks like it is from a sci fi movie? [closed]

I woke up today with a weird desire to make my laptop look like those sci-fi movies where a hacker/IT guy can save the world using just a macbook ( -.- ). Anyway on all those movies you can notice ...
1
vote
1answer
21 views

Unix permissions error when working with symbolic link and MySQL installation

I'm working to install MySQL on one of our servers. I'm the ec2-user, and I'm attempting to install in the ec2-user home directory, but allowing access to the directory to the mysql user. However, ...
-2
votes
1answer
18 views

File size is different in unix servers but count matches

I have a file in two servers like p01 and p11 ,both having same no of records but when i check the size both are different. Can anyone please explain me why it is like???
1
vote
2answers
34 views

What is the difference between the processes listed by `ps` and `ps -A`?

What is the difference between the processes listed by ps and ps -A ?
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 ?
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 ...
0
votes
0answers
19 views

UNIX Command to Determine Mac OS Version on a Specific HD

(For some reason, the DeployStudio forums aren't accepting new members at the moment, so I'm hoping you folks can help me out) I'm in the midst of exploring using DeployStudio for a series of test ...
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
0answers
52 views

How do I install Nix on a custom directory?

I have been trying to follow the Nix wiki to install Nix on a custom path /scratch/gopinath/nix. The /nix path is not accessible to me due to the restrictions on the system provided by my university. ...
1
vote
1answer
25 views

how to mount a network drive from specified network adapter in freebsd

I want to mount a network shared drive by my freebsd 9.3. I know This is possible by: mount_smbfs -I 10.1.1.20 //user@10.1.1.20/shared /root/local_folder/ This is done by default from em0. How can ...
0
votes
4answers
27 views

What issue exists when multiple lines of 'date' are used in bash?

I'm currently reading through a book on bash programming, Pro Bash Programming. At one chapter (Chapter 4) they ask what problem the following script has. I myself have no clue after reading through. ...
1
vote
1answer
20 views

Launch executable with custom root directory

How can I launch an executable so it thinks that the root directory is at a custom path, and not at the actual root. I thought it would be possible with sandbox-exec, but I haven't found any ways so ...
0
votes
1answer
13 views

iptables: Routing requests to localhost:8080 to google.com

I am trying a simple routing rule that would forward the requests to localhost:8080 to some external address (ex google). I added the following rule : sudo iptables -t nat -A PREROUTING -p tcp -d ...
2
votes
4answers
90 views

What is a backslash colon doing in this chown command?

What is the \: doing in the command below? sudo chown nobody\: folder/ Is it some kind of mistake?
0
votes
0answers
11 views

Java Runtime Exception: Unable to create lock manager

Hello when I run a script as root on unix shell it works, for example: sh -x /opt/auto/wso2is/bin/wso2server.sh However when I run it as a non root user I get the following error: ...
1
vote
1answer
22 views

How can echo the previous command I ran to a file?

I tried running echo '$(!!:p)' > /tmp/tmptxt.txt, however I just get $(!!:p). The previous command may have unescaped characters so I i need to escape it.
0
votes
0answers
25 views

GNU tar and condensed sparse files

My version of tar doesn't appear to be able to make non-sparse files sparse, though cp does. Are some tar implementations capable of this? (This answer suggests that they may be.) $ dd if=/dev/zero ...
0
votes
1answer
10 views

Using chuser and stopudt without root

I am trying to create a user account that can preform certain commands via command line without having to login as root. The commands I want to run are stopudt, chuser, chpasswd. What I have tried is ...
0
votes
0answers
13 views

Printing unique lines with uniq, OS X Yosemite

I am trying to print the unique entries in a column of a .csv file. For this, I tried the following: awk -F "," '{print $6}' dataCoarse.csv | uniq -u which just prints the 6th column as it is. ...
-2
votes
1answer
18 views

ls -ltr command in UNIX and Linux - Behaviour

Why does ls -ltr show different total? We have same files in both unix and linux environment please refer BELOW UNIX > ls -ltr /A/B/C/ total 2140 -rwxr--r-- 1 demo demo 14415 May 30 ...
1
vote
0answers
14 views

Set up multi-head environnement on FreeBSD running X.org

My goal is to set up a multi-head environnement: I need to have an extended desktop available on both screens with the ability to drag and drop windows from one screen to another. The left screen is ...
0
votes
1answer
18 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 ...
0
votes
1answer
25 views

Drive does not do “selftest” when using “smartctl?”

I have one drive which does not want to do the selftest: # smartctl -t long /dev/ada3 smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.2-RELEASE-p3 amd64] (local build) Copyright (C) 2002-13, Bruce Allen, ...
0
votes
2answers
34 views

How to handle duplicate files during runtime

we have a program which unzips a file and store the unzippied files in a directory. While unzipping, there may be a chance that the unzipped file come with the same name as we have unzipped as part ...
0
votes
1answer
11 views

Running time of locating a file in a directory

When you search for a file in a directory with a large number of files (n), what is the worst case running time of locating this file? I mean does the OS (linux) sequentially check all filenames in ...
-4
votes
1answer
26 views

Owner and User in Linux [closed]

I am facing issue with permission in Linux. I would like to know the difference between User and Owner of a particular file and directory, if its a non root user in linux. Please help.
0
votes
1answer
27 views

Get the Group name which has GID=0

I wanted to write a shell script in which it needs to give the group name whose GID=0.I used awk command like this, awk -F ':' {$3==0} /etc/group | cut -d ':' -f1 It works fine in redhat,aix.But ...
1
vote
0answers
22 views

Deny access to a specific folder for a sudo user

So here is the case: I am root in an Ubuntu system. I want to give a user (say username is X) permission to execute any command but at the same time I have a folder that I want no one to be able to ...
0
votes
0answers
11 views

How do I add printer to AIX menu choices. (Unix operating system)

I need help assigning an alias name (printer name in menu) to a printer already installed in root mode on AIX 5.3/Unix operating system. I have added ip address and host name to etc/hosts already. I ...
0
votes
1answer
18 views

What do the parameters in update alternatives install mean

I need help in understanding the following parameters "/usr/bin/java" "java" ""/usr/java/latest/bin/java" 1 in the following command. update-alternatives --install "/usr/bin/java" "java" ...
0
votes
1answer
56 views

No such file or directory when executing an existing file

I have norrowed the error down to this from a larger script and I'm getting the error "No such file or directory" when I try to execute a file which exist and I have the correct permissions for. ...
2
votes
1answer
107 views

What is the scope of “exported” in Unix shell variables?

I have set some environment variables in the following way: MY_VAR='helloworld' export MY_VAR Then I have switched to another user via su SOME_OTHER_USER I echo the MY_VAR variable.. and I see ...
0
votes
0answers
38 views

Can’t cd, ls, chown/mod or rm directory — Unknown error: 211 in Mac OS X

Never seen something like this in all my years. This is happening in Mac OS X: $ ls -lO@ea dr-xr-xr-x 2 root wheel - 1B Mar 20 23:10 Music/ $sudo cd Music/ cd:13: unknown error: ...
1
vote
1answer
47 views

How to correct malfunctioning Terminal in Mac OS X?

I am using Mac OS X 10.10.2 (Yosemite)—not a server version of the OS—and standard “Terminal” commands like ls, sudo, cp, mv, rm are no longer recognized in my Mac “Terminal.” I face this problem ...
2
votes
3answers
87 views

Apparent .bash_profile and .profile conflict in Mac OS X

I have an issue where, when I load up new terminal windows, I have to source the ~/.profile to get my PHP path working correctly. In essence of my issue is getting terminal to use MAMP PHP and MySQL ...
0
votes
1answer
18 views

how to add all the integers between two lines with a pattern and print

I have an input file (sample.txt) Sat 02/28/2015__19:32:37.63 262,404 K 100,964 K 112,052 K 124,628 K Sat 02/28/2015__19:37:38.41 262,408 K 100,964 K 112,056 K Sun ...
1
vote
1answer
34 views

How to mount a device without a password

I am using the following command in a script to mount a device. However whenever I run it, it prompts for a password. sudo mount -t cifs //xxx/lon-hsv/BT/APPOPS/Qlikview /mnt/appops -o ...