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

How can I swap patterns in filenames?

I have a folder of files with names like thing.y.big.png thing.y.small.png thing.xxx.big.png thing.xxx.small.png and I would like to rename them so that the 2nd and 3rd "fields" are swapped. In the ...
1
vote
1answer
15 views

How to create filename.tar.Z file on SunOS operatting system

I am trying to create filename.tar.Z file using single command on SunOS but it doesn’t seem to work: bash-3.2$ tar c DIR | compress >DIR.tar.Z tar: /dev/rmt/0: Permission denied bash-3.2$ Other ...
0
votes
0answers
13 views

OSX: Postgresql port 5432 is closed. How to open?

Mac OS X Yosemite (10.10.2) Postgresql 9.4.1 (installed with Homebrew) I can't connect to psql - port 5432 seem to be closed: $ psql postgres psql: could not connect to server: No such file or ...
0
votes
2answers
42 views

unix Command doesn't work

The command: tar c DIR | compress >DIR.tar.Z which works on a Debian-based Linux, fails on SunOS. Why?
0
votes
1answer
15 views

How to handle a condition when an expect script executing another script on a remote host is interrupted?

Im using an expect script to say xyz.exp to login to a remote host and execute another script abc.sh Now most of the times abc.sh runs fine, but there is a scenario where if a certain condition is ...
0
votes
1answer
13 views

Assign Substr of a string to a variable

I am new to unix script. i am asked to modify a ksh script. it requires i assign a substring of a string to another variable. I tried below and its not working GET_OLDEST_FILE=`ls -ltr ...
0
votes
0answers
28 views

Trying to create poor man's PowerBroker

For those of you who are not familiar with PoerBroker, it is somewhat of a sudo on steroids. I know it has much more than just giving you super user abilities but this time I am only concerned about ...
1
vote
0answers
8 views

umask linux incorrect file permissions

id buser - umask 0022 - group - appgrp directory /sample/sftp getfacl sftp # file: sftp # owner: appsdr # group: appgrp user::rwx user:590:rwx user:15003:rwx group::rwx mask::rwx other::r-x now ...
0
votes
0answers
10 views

How to read CPU load with Java on AIX

I checked /proc FS on AIX 6.1 in order to get some values for CPU load but unfortunately I could not find anything useful. Is there any text file in AIX which I can use to get these values similar ...
0
votes
0answers
16 views

changing the ownership to subfolders will affect the other folder owned by the same user?

I would need full access to the subfolder A owned by user xxxxx .(unknown may be moved out of organization) The parent folder is owned by root. Whether I am able to achieve this by changing the ...
0
votes
0answers
12 views

How do I set $LESS invocation options in a lesskey file?

I'm trying to use less's lesskey-file support, as described in the manpage: KEY BINDINGS You may define your own less commands by using the program lesskey (1) to create a lesskey file. This ...
1
vote
2answers
23 views

Wildcard not working in cp command when using exec

I want to copy all the files in all the directories to the parent directory, but I get the error ./img/* is not a directory For example. Here is the command that I used. Is there a better way to do ...
0
votes
4answers
47 views

Please explain the man page of command mv

I understand if I mv foo.file boo.file, I just rename foo.file to boo.file, and if I mv dir1/foo.file dir2/boo.file, I delete dir1/foo.file and make a copy of that to dir2 and rename it as boo.file. ...
0
votes
0answers
23 views

How can I automatically run two commands in different screen windows with an argument?

My process is ctrl+a 0 command $1 ctrl+a 1 /join#$1 I'd like to shorten it down to one command.
0
votes
1answer
34 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 [ ! ...
0
votes
1answer
34 views

How to find the total number of processes in Unix/Linux shell script

I’m trying to find the total lines of running processes excepting the commands I’m using to create the listing. Then to parse out the userID and the PID into a new list. All within the same shell. ...
0
votes
1answer
10 views

tree will not descend into directories

I just unpacked a tar file with a folder in it. I did a tree -F and saw asterisks popping everywhere. All of the files (even png, txt, etc) were marked as executable. So I did what any sensible human ...
0
votes
0answers
49 views

Windows 10 Technical Preview: running custom commands

I have recently installed the Windows 10 Technical Preview and like using unix in my terminal. When I had Windows 8 I used a very lightweight application called gow that installed a few unix commands ...
0
votes
0answers
17 views

Why do UIDs start at 0 but PIDs start at 1 in Unix?

During a discussion of Unix operating system concepts, the question was raised, and no one really seemed to be sure. It seems against "the Unix Way" for things to be inconsistent that way, yet it ...
0
votes
0answers
14 views

System Partitions Over Two Drives

I have a machine with two drives a Compact Flash card (CF) and a Solid State Drive (SSD). Recently I have been experiencing failures of both the SSD and the CF. When I sent these back to the ...
1
vote
1answer
52 views

file exists not working in expect script

I'm trying to check if a particular line exists in filename on a host. So only if the particular pattern is found from the grep command a dummy.txt will be created. Then I want to check if dummy.txt ...
1
vote
2answers
22 views

Not creating new file while output redirection

I'm using this for output redirection: cat filename | grep 'dis' | wc -l > test.txt But I do not want a zero byte file created if no result is found from the grep command. Is there any way this ...
0
votes
0answers
21 views

ArchLinux can't install perl-wx

I am trying to install perl-wx from the AUR Repo with yaourt, but can't get it to work. I have tried "export LC_ALL=C". Still an error occurred during the check. Maybe you can help me? Pastebin: ...
-1
votes
2answers
29 views

What happens in linux when you copy a hardlink on top of another hardlink to the same file?

I've used a file deduplicator on a large folder with hundreds of thousands of files. The deduplicator created hardlinks for all duplicate files that it detected. If I was to attempt to merge some ...
0
votes
1answer
26 views

Executing Perl command from shell script not resulting into anything

I am trying to execute the below command from a shell script: perl -pi -e 's/Ç/|/g' diff_new_old.dat This command gets executed without any errors, but the execution doesn't do the intended ...
0
votes
2answers
30 views

Call URL from console without opening in any browser

I have a browser controllable smart pluck outlet, which I can control by calling a URL. I know I am aware of the command open http://192.168.1.175/cgi-bin/relay.cgi?off But that opens a tab in the ...
0
votes
1answer
45 views

bash command in python not working

I would like to run a bash command from python. My code: process = subprocess.Popen(('ifconfig -s'), stdout=subprocess.PIPE, shell=True) output = process.communicate()[0] lcd.message(output) sleep(2) ...
1
vote
1answer
23 views

How do I install programming info pages in Mac OS X?

I used to have a Linux system i was able to type info libc to view info pages on the C library, including unix functions. However, now I am running Mac OS X this does not work. How do I install the ...
2
votes
1answer
86 views

dyld: Library not loaded: /usr/lib/libcurl.4.dylib curl SSL error

I'm not sure what happened to my system but I am having an issue with dyld/curl, affecting my overall computer performance. I am on Yosemite. I have a feeling it's the Conda openssl. How do I just ...
0
votes
2answers
19 views

How to allow a user to view a particular file via sudoers?

In Linux, I want to allow a normal user to view only one file in a path. How to give the entry in sudoers file. Is the below one is correct? user ALL = /bin/cat
-2
votes
0answers
12 views

How can i write a one line script that will print out parameters from table [on hold]

How can i write a one line script that will print out parameters from table for example : prints only students from xxx place that have grades above 80
-1
votes
0answers
11 views

How can i write a script that prints all files (recursively) in the current working directory that are bigger than 100kb [duplicate]

How can i write a script that prints all files (recursively) in the current working directory that are bigger than 100kb.
1
vote
1answer
12 views

rsync ignoring partition directory

I use rsync to clone my internal hdd to an external disk. My system is Arch Linux. I have two partitions: / /data I am using the following rsync command: rsync -avzxt --progress --delete ...
3
votes
2answers
30 views

How to tell of a GZip file is still being written while being copied

I am getting a gzip file in a path. Input Folder Path: <server>/input_gate I want to check whether the GZIP file I am getting in this folder are valid? I have used the following command. It ...
1
vote
0answers
16 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 ...
1
vote
1answer
52 views

Unix/Java process stops running when moved to background

We have a Java process that was created using Appassembler. It runs fine as long as it is started and run in the foreground: [ec2-user@ip-xxx ourapp-0.0.1-SNAPSHOT]$ bin/ourapp Starting in ...
0
votes
1answer
20 views

Go to directory of symlink file target

How can I create a command (or alias) to go to the directory which contains the target file of a symlink. For example, if I have a symlink symFile@ -> /Users/zhermes/some/dir/someFile I'd like ...
1
vote
1answer
24 views

SSH working but SCP permission denied using the same password

I can successfully SSH into my remote sever (amazon web services if that matters, I'm on a mac) using ssh -i mykey.pem ubuntu@??.??.??.??? But when I try to use scp scp -i test.php mykey.pem ...
0
votes
1answer
19 views

Detect IPC between running processes on Unix

Suppose I have 2 processes on any unix-based system and I sure they are using some inter-process communication. How can I detect what do they use in order to simulate or hook it? I mean pipes, for ...
1
vote
1answer
30 views

Why tar hangs failing to extract a file

I am using a Solaris 11 system and am trying to extract from a tar file which I know to be OK, but when I try to extract it, tar hangs. I don't get any feedback from tar. What areas of Solaris should ...
0
votes
1answer
48 views

Missing MySQL extension required to run WordPress on custom Linux server

I need to get WordPress up on running on a custom Red Hat Linux server, but am getting the following error when attempting to visit the WordPress install page: Your PHP installation appears to be ...
0
votes
4answers
81 views

How do I DELETE a comma and a space from a numeric string using a bash script

Folks, I have asked this question 5 times on here and have received 5 separate bits of code from super users that have all *failed. Problem: I have stock information being brought back into a txt ...
0
votes
2answers
62 views

Downloading large amount of files from unix server

there are about 7000000 files in a single directory summing up to a total of 650 GB. (listing them alone is not even possible) what options do i have to download these? i was thinking of using tar ...
1
vote
1answer
46 views

Using cURL command-line tool on Mac, What can I do to this script to ask it to fetch stock data which will replace commas with NO SPACES

Example: Google Outstanding Shares are 670,000,000 and this value is collected in a txt file from Yahoo Finance API via the below script. The issue is; that numbers WITH commas or spaces are a bloody ...
0
votes
1answer
54 views

Linux bash command to list hidden files first, then other files sorted by extension

This page: How can I make "ls" show dotfiles first? lets me list hidden files first, but I also wish to sort non-hidden files by "extension" e.g. all filenames ending with ".png" come after ...
0
votes
1answer
37 views

How can I write a script to kill process that runs for a few hours?

I run python script from cron every hour on CentOS 5 and see some processes keep running for a few hours I would like to run a script every few hours to kill those processes. How can I write the ...
0
votes
1answer
45 views

“ls -la | sort +0nr -2 +2d” , what does sort do here?

I hae seen this somewhere written: ls -la | sort +0nr -2 +2d What is sort doing here? What are these arguments.
0
votes
2answers
52 views

Unable to get accurate record count of a csv file

I have a .csv file that has some values formatted as paragraphs with line breaks or sometimes bullet points. "STAT","ID","DESC" "UPD", "1", "Updated" "CHG", "2", "Changed" "UPD", "3", "Updated. ...
0
votes
0answers
13 views

remove group by gid ubuntu

When I open a shell I get the following: groups: cannot find name for group ID 10065 id prints: uid=xxxx(user),27(sudo),105(fuse),10004(pr_SDIS1),1006 How do I remove this group?
0
votes
1answer
20 views

How to fetch the string “Hi there” from the below array in unix

I only want to fetch Hi there and store it in a variable VAR1. So basically VAR1 should contain Hi there VIEW_COL[1]="Hi there,USA,Y" This is what i have tried so far. Column_Display_Name=`echo ...