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

Accidently ran 'dd' command on external drive - partially deleted data

I accidently ran the below: sudo dd if=dev/sda1 of=/dev/sdb1 bs=32M count=10 iflag=direct Removing the first 320MB of the drive has of course made the drive mounted on /dev/sdb1 inaccessable and ...
1
vote
1answer
147 views

Significance behind January 6 1980 server time

Today my iPhone reset it's date to Jan. 6 1980... I googled it and apparently it's a very common problem (A ton of results for January 1980... Most if not all were in January 6th of 1980)... the ...
1
vote
0answers
19 views

ps aux and processes between [ ] [duplicate]

Just wondering if there is a difference between processes listed between [ ] and others when running ps aux. What does it mean? Is the process still running or is it a recent process that has been ...
2
votes
4answers
96 views

Add a display to let user wait in bash

I am looking for a pretty stupid piece of code for bash that will show a kind of "please wait" rolling display, with the characters : - \ | / The first problem is that I don't know the name of this ...
1
vote
1answer
24 views

Fix User permission (UID changed)

I changed the UID of an user, (cos I was having problems with file permission), now this user can access or see any file... any ideas how to fix? I executed usermod -u UID username with the old ...
1
vote
4answers
180 views

How to split CSV files as per number of rows specified?

I've CSV file (around 10,000 rows ; each row having 300 columns) stored on LINUX server. I want to break this CSV file into 500 CSV files of 20 records each. (Each having same CSV header as present in ...
0
votes
0answers
18 views

What permissions should I have on a file to make it available via owncloud and readable to my local user?

Files stored in .../owncloud/data seem to be owned by www-data and in a group of the same name.
1
vote
2answers
47 views

How do I search for a string in a group of files when some of those files contain spaces?

I'm running Mac 10.7.5. In a terminal, I'll use this command for finding files with strings find src/main -name "*" | xargs grep -i 'mystring' However when the files contain spaces, I'll get ...
0
votes
1answer
27 views

Can I tell if I'm in an scp session in my .bashrc?

Inside my .bashrc, I'm doing a bunch of magic that causes problems when I'm trying to do an scp. The solution I've been going with is to manually ssh to the target machine, disable my .bashrc, do the ...
4
votes
1answer
43 views

Unix /Linux show the last part of a file with line numbers

Is there a way to make tail show a line number in front of the last lines it show so that it show the growth of the file when using it in a script. e.g: when using it in a script like this one: ...
0
votes
1answer
62 views

Eject all disks and dmg's with Automator script in Mac OS X

I have created an Automator Service to eject all disks in Mac OS X. find /dev -name "disk[1-9]" -exec diskutil eject {} \; This works, but I still receive an error message afterwords: "The action ...
0
votes
2answers
237 views

using awk with find -exec

I have a directory structure with 14 directories containing a bunch of files containing data in a three-column format (separated with tabs). I intended to use find and awk to extract the second column ...
0
votes
2answers
86 views

Logrotate says “log needs rotating” and then does nothing

I have the following logrotate configuration, and a 2 GB /var/log/messages: /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/network { ...
0
votes
2answers
91 views

Understand what is happening in Linux with ps, top, and free

I'm running my java program on a 12 cores 24 thread machine. They have several processes that are running simultaneously. It seems that I performed too many processes so that the whole tasks made the ...
0
votes
2answers
30 views

Using only 1 command line, how do I write a command to that will do a long list of all files in the storage/file directory

Using only 1 command line, how do I write a command to that will do a long list of all files in the storage/file directory and pipe the output to a grep command that finds all items containing the ...
0
votes
1answer
37 views

Create script to login and change time on unix Darwin

I work for a non-profit and recently had to take on some sysadmin responsibilities, and and it is a new area for me. We have a Apple X Server that is running Darwin, and from time to time, especially ...
0
votes
1answer
36 views

Extract single file from tar without taking its directories with it

I'm currently using this command tar -zxvf foo.tgz -C /root/dir1/ dir2/dir3/dir4/dir5/file to extract my specific file from a tar archive to a given directory, dir1. As is, I end up with ...
0
votes
0answers
16 views

Add a path in $PATH globally for every user

Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.
2
votes
1answer
228 views

How to get actual creation time of a file on Unix?

I'm inspecting some files in my dedicated web server via linux cli after a hack attack and found some files have been modified with the 'touch' command to change the dates. I'm willing to get the ...
3
votes
1answer
195 views

How to find a file whose size is less than 10 MB?

I need to find a file in my current directory whose size should be less than or equal to 10 MB. ls -lh gives me the file size of each file but not sure how to find the files whose size are less than ...
1
vote
4answers
56 views

Remove all folders that does not contain a specific name in UNIX

I'm trying to figure out my old skill in *nix. What I'm trying to achieve is to remove every folders that does not contain a specific word. This is the listing ➜ myfolder: pwd /user/myfolder ➜ ...
0
votes
2answers
58 views

UNIX vs Windows Filesystem; why does UNIX assign a finite space for each directory?

All, I am finally getting settled into the intricacies of NIX however one thing I am still trying to figure out is why UNIX assigns hard disk space to each directory in its filesystem. I discovered ...
1
vote
2answers
59 views

How can I list permissions of every component in a file path?

Sometimes it is necessary to determine on which directory in a path access rights are limited. Here is an example: $ ls /sys/kernel/debug/usb/devices ls: cannot access /sys/kernel/debug/usb/devices: ...
0
votes
1answer
22 views

Symlink to a directory including the trailing slash and without

Is there any noticeable difference between symlinking to a directory including the trailing slash and doing it without, i.e. the difference in doing ln -s somedir/ dir vs. ln -s somedir dir whereby ...
0
votes
3answers
60 views

Cannot find where this colorscheme setting is being set for vim on OS X

A long time ago I was farting around with color schemes for vim and I remember setting a line somewhere colorscheme sonofobsidian. I did this before I knew what I was doing with vim, unix, OS X, etc. ...
0
votes
1answer
33 views

if recursively find ext, then, else on unix

This is what I normally use. But I need to recursively find an extension with, then, and else. The problem with this one is that it is not recursive. if ls $HOME/Downloads/*.ext >/dev/null ...
1
vote
1answer
30 views

Search unix drive for file modified today

Is there a way I can search an entire unix drive for a file that was modified today? I realize this could take a while, but thats not an issue
1
vote
0answers
47 views

Directory and segments in Multics operating system

In Multics OS there are different access rights in the access control list for segments (execute, read and write) and directories (status, append and modify)(book). How do segments correspond to ...
0
votes
1answer
64 views

Pause SSH Session

I have long running processes that I just kick off. I create ssh and long-in into ssh session and create multiple screens and run all the programs and detached using (ctr + A + D). But when i resume ...
2
votes
2answers
295 views

How to grep a group of files within a time range?

I'm trying to write a script used on a buffer box that does full packet capture of network traffic. As it's for a fairly big network we split the captures into 100MB segments. At times of high network ...
0
votes
0answers
35 views

Exposing one network interface through another on Mac OS X

I have a network interface, as specified by ifconfig inet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1400 ether 44:44:44:44:44:44 inet 20.23.10.51 netmask ...
0
votes
1answer
62 views

Batch convert mono WAV to stereo verbatim

I have a bunch mono .wav files which I need to convert to stereo in order to run thru lame. Lame can't encode stereo mp3s from mono input so that's what I need to do. I don't need any modifications ...
4
votes
1answer
55 views

Instead /bin/bash as a shell, /bin/passwd in /etc/passwd file

I'm a Unix support Admin and I have a rare situation here. I have a recently adopted an environment that has a user with a /bin/passwd binary as a shell. xxx:x:1:100:xx:/home/xx:/bin/passwd Anyone ...
0
votes
1answer
79 views

666 permission even after making umask= 0000

I made my umask = 0000. However when I am creating a file it has 666 permission. Although directories get 777 , that's alright. Also my aim is to create file/dir with permissions 774, I guess umask ...
0
votes
1answer
140 views

How to check in shell script if output of command contains a specific word?

Sometimes I have network connectivity issues and I need to re-run the previous command. Not sure how to for the if else statement though? for var in ./* do python2.7 submit.py $var //check if output ...
0
votes
0answers
35 views

Live rsync directory monitor

While developing websites locally on my Mac I would like it to sync with my remote server on changes to the files inside the x directory. I have looked around and found lsyncd which almost does what ...
0
votes
1answer
78 views

Get Rid of Error Message

I have a script with many commands. Like #!/bin/sh mv new /root/ mv old /root/ mv foo /code #many other commands If the file 'new' is not found bash will give an error message:foo: No such file ...
0
votes
2answers
115 views

Check If a script is executed as root?

I have a script that requires root privileges. I have to execute it either via sudo or from an account with uid 0 (e.g. root). If the script is not executed with sufficient rights then I want that ...
1
vote
2answers
135 views

Ignore case from user input

I'm trying to write a script to catch user input. The script should ignore the case. Consider this script foo.sh: if [ $1 == "string" ]; then echo true else echo false fi If the input of ...
0
votes
6answers
106 views

Processes currently run by users

I am looking for a unix command or a bash script to get the processes currently run by users in the system. I tried the ps -Af command, however, all the processes including the root processes pop up. ...
1
vote
1answer
80 views

How to create an operating system on top of Ubuntu 13.10

I want create an operating system the way Mac did, building a program on top of a Unix operating system. I am planning to make a small operating system with a small amount of functions using C. I do ...
-2
votes
2answers
53 views

Shell variables. I'm new at this and having diffulculty

If the shell variable x has the value 5, and you reassign it with x="expr $x + 10", what is the new value of x?  What would have been the value if single quotes were used instead?  What is the most ...
0
votes
0answers
42 views

Find files based on content and sender, receiver and based on date range provided

I would like to find files based on content and sender, receiver based date range provided More details below: Find files between date range (where folder names are the dates in the format yyyyMMdd) ...
1
vote
2answers
258 views

Unix ping and host commands result in different IP addresses for the same domain name

My understanding is that the unix ping and host commands should generate the same IP address given the same domain. If you look at these two commands: $ ping api.dev.myserver.com PING ...
0
votes
1answer
23 views

Temporarily install a package to RAM

When you use apt-get, yum, pkg_add or MacPorts to install a package, the package is written to the hard disk. How to install them temporarily to RAM instead so that they will be removed when you ...
1
vote
1answer
157 views

Connection timeout when transferring file via FTP

I am trying to upload my csv file to a Unix server using FTP in the Windows cmd window, and at the end of the process I get this message: 425 Unable to build data connection: Connection timed out ...
3
votes
2answers
117 views

Trying to delete a directory stored on a Windows server, mounted on a Mac

I am trying to delete a directory stored on a Windows 2008 R2 server, mounted on a Mac as network home (10.8.5). The directory was created by Safari and stores temporary internet files. I need to be ...
1
vote
1answer
114 views

auto hotkey script to convert backward to forward slashes

Though I'm Windows based, I do my web development work in a customized console that mimics much of Unix particularities. One of these is that it uses forward slashes for paths, instead of backwards. ...
0
votes
1answer
45 views

Why is this awk statement not working?

awk 'BEGIN { COLM_FMT = "%-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s, %-8s,\n" } { printf COLM_FMT, ${totals[0]}, ${totals[1]}, ${totals[2]}, ...
1
vote
2answers
683 views

Ubuntu : This does not look like a tar archive

I am trying to run the following command after I have downloaded a tar file using the sudo wget command to install CasperJS on our Ubuntu box. sudo tar -xvf casperjs.tar This does not look like a ...