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

4
votes
4answers
4k views

Bash Script: Invalid argument

Why can't I use echo $1 > /sys/class/backlight/acpi_video0/brightness in a simple bash script? It gives me the error: echo: write error: Invalid argument.
11
votes
7answers
6k views

Sorting human readable file sizes

How can I sort a list using a human-readable file-size sort, numerical sort that takes size identifier (G,M,K) into account? Can I sort "du -sh" output for example? Problem: Consider the problem of ...
0
votes
1answer
28 views

rename only the last directory in the tree

The below command in unix will rename all the directory with the name Utility to Claim, when executed from the top level find . -type d -name Utility -exec sh -c 'mv "${0}" "${0%/Utility}/Claim"' {} ...
8
votes
4answers
5k views

Windows PowerShell equivalent to Unix/Linux `pwd`?

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?
1
vote
2answers
49 views

Why redirecting FINDSTR output produce UNIX line ending?

When I issue this command: FINDSTR /I /N "<sdk:extra>" addon.xml output is: 973: <sdk:extra> 995: <sdk:extra> 1017: <sdk:extra> 1036: <sdk:extra> 1057: ...
1
vote
2answers
357 views

Fail cronjob with /usr/bin/env

I have a script that works perfectly if I execute it from the command line manually. However, when it runs via cron, the job fails with the following error: /usr/bin/env: escript: No such file or ...
3
votes
2answers
1k views

What does Unix “lunch” command do?

man lunch and lunch --help both return nothing Googling for unix lunch command, I also find nothing I am assuming it is custom. How do I go about finding its location and what it does?
1
vote
3answers
64 views

How can I separate my work-developer environment and home-user environment effectively?

I used python-virtualenv previously for python tools, but now I've found a new remote job which needs a lot of native tools to be installed into my system. The question is how can I separate my ...
3
votes
4answers
266 views

Why is it bad to add '.' to PATH?

I've read one explanation saying it can allow malicious executables that are in the cwd to run in place of similarly named built-ins and core utilities. For something to wreak true havoc, wouldn't ...
-2
votes
2answers
50 views

How can I create a script in Unix with following requirements? [closed]

A script named /root/backup.sh on w01 that will backup the contents of /home The script will: Create a tar archive named /share/<YYYY><MM><DD>_w01.tar where YYYY represents the ...
2
votes
2answers
985 views

Copying folder from one Unix server to another, updating owners IDs

I'm using the method described here to copy a directory from one Unix server to another (both Ubuntu 14.04): rsync -aruv localfolder/ user@server:destination/ I need to keep the same owners and ...
1
vote
1answer
18 views

Unable to remove a directory

I'm using SUSE and I'm trying to delete an empty directory When I use ls -la it shows that that it contains .fuse_hidden0000001700000010 with rw for owner (that's me not root). I cannot delete this ...
33
votes
4answers
12k views

Bash: Spaces in alias name

I am trying to create an aliases in bash. What I want to do is map ls -la to ls -la | more In my .bashrc file this is what I attempted: alias 'ls -la'='ls -la | more' However it does not work ...
0
votes
0answers
12 views

Mac OS Yosemite popd: How do you keep the dir in the stack and cd to that dir at the same time?

As the document of popd says, using "-n" will keep the dir in dir stack, but on OS X Yosemite, when the dir stack is like this: 0 ~/0 1 ~/1 2 ~/2 3 ~/3 and if I use popd +2 -n The working ...
0
votes
1answer
28 views

How to correctly mount a tmpfs?

Excerpted from the documentation So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs' will give you tmpfs instance on /mytmpfs which can allocate 10GB RAM/SWAP in 10240 inodes ...
3
votes
4answers
3k views

Login to Oracle database without username and password

I want to login to a database by running an SQL file from a unix script without supplying username and password (as root)....is this possible? Database is oracle
0
votes
0answers
137 views

Batch file unable to run commands after launching putty

I am writing a batch file abc.bat which is used to launch putty. I want the .bat file to go to a particular folder (in PuTTY), source it in csh and go to a particular path on that server. I wrote the ...
0
votes
2answers
46 views

Replace random string using sed

How do I replace random strings using sed. For example if I have a text file like this: EF125353.1 to be replaced 1 EF125353.1 to be replaced again 2 EF125353.1 to be replaced etc etc 3 ...
0
votes
0answers
13 views

/usr/local and /usr/share detailed explanation

I am afraid this is another of FHS questions but I was not able to find more detailed explanation which I feel I need. Yeah, I know about Uni FHS and etc, but what still feels like lacking ...
2
votes
1answer
96 views

How are Unix domain sockets related to networking?

I understand that networking uses sockets as well but I am wondering if Unix domain (IPC) sockets somehow relate to network layer. If so, does this use network HW somehow? Does it work like a ...
2
votes
2answers
2k views

exiftool: delete exif data but preserve some specific tags

Currently I use exiftool with the -all= option and it deletes all the EXIF data from my photos: exiftool -overwrite_original -all= /Users/andyl/photos/*.jpg Now I want exiftool to delete all the ...
1
vote
3answers
836 views

How do I set the Android bash path in ZSH?

Looking through the Cordova Android docs, I see this line You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use ...
0
votes
1answer
15 views

Including and excluding in one regular expression

We're using HP SiteScope system at work to monitor logs and get alerts when a special string or combination of strings is caught. There is one field where the regular expression that catches the ...
2
votes
2answers
2k views

Explanation of the directory hierarchy on Mac OS X

Can anyone explain (or more likely, point to a good article that explains) what the various directories should be used for. (I assume the structure is very similar on all Unix based machines, though ...
0
votes
1answer
34 views

When I delete a file/folder on Windows in a Samba share - what unix commands are being issued?

Let's say I have a Samba share and a Windows client deletes a folder in it. Is it the same internally as rm -rf foldername? Is there any cleanup needed? Also is there a difference for the Samba share ...
0
votes
2answers
25 views

How can I start the process that doesn't die even after I close ssh? [duplicate]

I am sshing to my remote CentOS 5 server and want to run a script that takes long time. How can I have it keep running even after I close ssh session?
0
votes
1answer
269 views

Irritating GitHub Conduit dialog opening up whenever I visit a GitHub link — can I get rid of it?

X-Post from a [closed] StackOverflow question. I have a problem that sprang up out of nowhere in the past two or three days. Whenever I'm using Git in Terminal (which is pretty much always), if I ...
0
votes
2answers
7k views

hod do i grep multiple keywords from a file?

I want to use unix's grep function to pull out multiple lines (with different key words) from a file in one command line. e.g. i have something like doc-A1-151 file-A2-15646 table-A3-1654 ...
141
votes
8answers
134k views

What is the “You have new mail” message in Linux/UNIX?

Sometimes, when I log into a box and 'su' to root, I get a cute little message saying I have mail (thank GOD it's not AOL). Where is this mail? What does it contain? Who/What sent it? How important ...
6
votes
3answers
7k views

How to get I/O usage by process in Unix? [duplicate]

Possible Duplicate: Linux: Is there something similar to "top" for I/O? I am trying to do some CPU intensive operation on a Linux machine and it is showing very high load. I want ...
5
votes
1answer
747 views

Linux/Unix - how to enable one user to `sudo` without a password

How can a user be setup to sudo (or su -) without entering a password?
31
votes
2answers
9k views

How do I reload .inputrc?

Background I have heard that the readline module is reading ~/.inputrc and that is how it changes the behaviour of keystrokes under programs such as bash. Question How can I reload this after ...
-4
votes
1answer
4k views

shell script to send an alert mail if disk usage exceeds 90% and another alert at 95%

I am new to shell scripting and want to implement a script on my server which will automatically send email alerts if the disk usage goes over 90% and second email alert when it goes over 95%. my ...
2
votes
1answer
57 views

recreating just the uid/gid unix permissions from tar

I was restoring a root partition based on a tar backup from system-rescue-cd. It went ok except the uid/gid mappings on the system-rescue-cd disk did not match the ones on this debian system that I ...
0
votes
0answers
10 views

Convention / File Hierarchy for Compiling Source

Background: I have been compiling a lot of source code lately and I am hoping to learn of a convention to organize source code / compiled output. As an example, I have been statically compiling ...
7
votes
4answers
14k views

count lines in a compressed file

if i have a .gz file on unix which has certain number of lines. How could i count the lines on unix without uncompressing it.
2
votes
5answers
236 views

UNIX how to resume process using ID?

I have a problem to resume process. I tried to get process to foreground using jobs, it works, but if i close shell and start it again. In this case i haven't my process in jobs list. I know just ...
0
votes
1answer
37 views

Environment variable LC_ALL is always unset by default. why LC_ALL is unset?

Why LC_ALL is always unset by default on Linux and Unix machines? For example, on Linux: root@icubes:[~]# locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" ...
2
votes
2answers
400 views

How to compare two files for non-printing characters

To share a configuration file between two computers, I emailed the file to myself via my gmail account. When I loaded the conf on the second computer, the program had trouble reading every line. ...
0
votes
2answers
43 views

Vim: how to perform this task every time I open a file?

For a time I have one vim configuration on my laptop and another on my desktop, so when I edited filed on my Dropbox between the two I would end up with format issues. Specifically, I had ...
1
vote
1answer
748 views

Extracting a tar.gz file returns, “This does not look like a tar archive.”

I have a tar.gz file and I want to extract it using terminal. I used following commands: tar tvzf ldtp_3.5.0.orig.tar.gz and tar -xvzf ldtp_3.5.0.orig.tar.gz. However, I get the same result for both ...
0
votes
2answers
470 views

How to update a TAR/Gzip archive

I have compressed a folder using tar like this: tar cvfz folder.tar.gz folder/ Now, say I have changed some of the files in that folder, added some and removed some. And now I want to update my ...
1
vote
3answers
3k views

Using egrep to find lines that have 5-6 Upper Case letters. (but not more than 6)

First off, this is homework and unfortunately I have to use egrep (and not with -w or anything of the like). I need my grep to return lines that have exactly 5 or 6 upper case letters. Doing ...
2
votes
4answers
1k views

How to grep for a line that has the same number you both need and don't need

This isn't at all easy to explain but easy to just show. I have lines in a file such as: 100Dollars 3 IP 200Dollars 3 IP 300Dollars ...
0
votes
3answers
1k views

Can't seem to change directory - “No such file or directory” error using PuTTY

I am required to use PuTTY to submit a program but I have never used it before and am having a hard time changing my directory. I am successfully connected to a Linux computer from my own but can't ...
0
votes
1answer
200 views

How to write a script that does what less does?

Question: Create a script such that it is a command that has the same effect as the "less" command (implement the script by calling "less"). What I wrote: #! /bin/bash for index in "$@" do less ...
0
votes
1answer
19 views

How to receive files on Windows SFTPd by a Unix machine

I have a Unix tool that generates files. The same tool can run SFTP commands and push out files to other machines. I have a Windows box that needs to accept files pushed out by the Unix machine. What ...
0
votes
1answer
32 views

Open file using bash with unix executable

I have an application which loads using a bash script e.g /Applications/My.app/Contents/MyExecutable I can load this using bash like so "/Applications/My.app/Contents/MyExecutable" However, I ...
0
votes
1answer
17 views

Match unix shell promp to that of vagrant

Not sure what it's called but in vagrant when logged in as the vagrant user I get a pretty line before I run commands like so: It even says what branch i'm on in git. What is this line called and ...
1
vote
3answers
201 views

Does specification mean interface?

I was wondering Generally, does specification mean interface, regardless the implementation beneath the interface? Specifically Only systems fully compliant with and certified according to ...