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

6
votes
2answers
4k views

Encoding to base32 from the shell

I'm looking to encode an input string to base32 encoding directly from the shell. I'm looking to do this in ubuntu, but I imagine flavor doesn't particularly matter here. Are there any existing ...
1
vote
4answers
7k views

SSH Tunnel yielding “administratively prohibited: open failed” after a few hours

i have a dynamic OpenSSH tunel running as : ssh -N -D *:1080 user@example.com (OpenSSH_5.3p1 Debian-3, OpenSSL 0.9.8n 24 Mar 2010) which runs perfectly for a few hours, of few days, but begin to ...
0
votes
1answer
13 views

Timestamp comparison on AIX without date -d

I have a bash script on AIX 7 that runs a database query and the output I get is a timestamp in the following format: 201607130319 Now I would like to compare the timestamp with current time(date +%...
31
votes
6answers
35k views

How to convert line breaks in a text file between the Windows and Unix/Linux formats?

How do I convert line breaks in a text file between the Windows and Unix/Linux formats? I have a *nix environment, but that I need to import and export data with the Windows-style line breaks. I ...
2
votes
2answers
13k views

How do you configure X11 forwarding over SSH on AIX?

Here is what I've tried. I've edited /etc/ssh/sshd_config on the remote AIX system X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes as well as set $DISPLAY DISPLAY=localhost:10.0 export ...
0
votes
1answer
34 views

Run FNDLOAD command on unix server from windows using Jsch

I'm trying to run an FNDLOAD command using Jsch after connecting to my unix server through ssh. But the command is giving me the following error bash: FNDLOAD: command not found Also if I try to ...
-1
votes
1answer
35 views

Finding average CPU load for previous X minutes? [closed]

I'm working on some different infrastructure monitoring tools and looking for a tool/plugin/utility that can tell me the average CPU load for the most recent 5 minutes. This time is preferably ...
37
votes
6answers
11k views

Can you have more than one ~/.ssh/config file?

We have a bastion server that we use to connect to multiple hosts, and our .ssh/config has grown to over a thousand lines (we have hundreds of hosts that we connect to). This is beginning to get a ...
0
votes
1answer
1k views

Cannot get exclusive lock on rpm database in Unix

I was trying to install a python rpm on AIX 6.1 and it was taking too long and so I had to close ther terminal. Later when I tried to install the same rpm as root I am getting the problem as : root:...
2
votes
7answers
19k views

Find size of file in MB

How to find the size of file in MB in UNIX command line?
0
votes
0answers
26 views

How secure is it to use secret directory names to share files on unix? [migrated]

There is an old trick on unix systems to allow a non-root user to "securely" share files with particular other users. mkdir share chmod 711 share #others can traverse share, but can't list its ...
-1
votes
1answer
35 views

What is the equivalent of chdir for UNIX?

I'm working on OSX 10.11.4 trying to write a simple bash script. I'm getting command not found when I try to use chdir. When I test with which chdir I get nothing. What's going on? I'm using this ...
1
vote
1answer
1k views

How do I install Rake (Ruby on Rails)?

I want to install Ruby on Rails (I'm running a FreeBSD but don't want to use Ports for RoR) so this is a more generic unix/RoR question. Simply what is the best way to install Rake. http://rake....
3
votes
1answer
47 views

How to let chef listen on multiple IPs

I'm currently playing with chef to evaluate whether or not such a configuration tool might help us in our *nix-based environment. For the last few days I'm struggling with one problem I can't find a ...
0
votes
2answers
64 views

How to filter (out) certain output in bash

I have a process that tails our AWS CloudWatch logs. It works great, except for the fact that every line is prepended by the CloudWatch group and container ID. For example: core-api ...
-5
votes
1answer
45 views

Run 64bit installer on 32bit centos cannot execute binary file [closed]

I Have a 64bit file from my old server, its ./install file now i want run it in 32bit server, see below error: [root@host ~]# ./installer.1 -bash: ./installer.1: cannot execute binary file My ...
3
votes
2answers
119 views

Create a file only if the directory exists?

I am trying to write the module where it creates the file if directory exists or else it shouldn't do anything. class puppetmodule{ exec { 'chk_dir_exists': command => 'test -d /usr/dir1', ...
-4
votes
1answer
22 views

web program today: why is online web program user =/= Unix user in /etc/passwd [closed]

History and explanation In the early days of Unix, ... as Unix was invented as a network and multi-user operating system; you could deploy web server programs on Unix where the online user in the ...
21
votes
8answers
50k views

How to disable everything in crontab -l?

I just want to pause everything. Don't execute anything listed on crontab -l.
4
votes
2answers
1k views
8
votes
3answers
814 views

Password similarity

I wanted to change my password on a unix machine. I did a normal "passwd" and typed in my old and my new password. Then the machine came back to me with the following message: BAD PASSWORD: is too ...
1
vote
2answers
1k views

Ubuntu Server 14.04LTS Swappiness for server with 16GB memory [closed]

(don't worry I'm not asking what my setting should be, asking for the theory behind some conflicting advice I've read) My application is one that is lightweight and not under much load, but needs to ...
83
votes
7answers
52k views

What does 'set -e' do, and why might it be considered dangerous?

This question has appeared on a pre-interview quiz and it's making me crazy. Can anyone answer this and put me at ease? The quiz has no reference to a particular shell but the job description is for a ...
110
votes
10answers
58k views

Environment variables of a running process on Unix?

I need to troubleshoot some problems related to environment variables on a Unix system. On Windows, I can use a tool such as ProcessExplorer to select particular a process and view values of each ...
3
votes
2answers
2k views

Should I create ZFS zpools with whole disks or partitions?

I am making zpools on FreeBSD machine. While creating zpools I observe these two cases: If I take raw disks and create zpool then I am able to form zpools and they are working perfectly. If I format ...
10
votes
4answers
20k views

Differences between /dev/sda and /dev/sda1

I know that /dev/sda is the raw device, and that /dev/sda1 is the partition or virtual device. But I'm a little confused as to why the sda# only comes up some of the time, or only on certain systems. ...
0
votes
2answers
193 views

Run a script in /etc/motd [duplicate]

I'd like to run a python script when people log in to the server. I thought editing /etc/motd would be the best approach, but since it's only readable file, that won't work. I found pretty much ...
110
votes
14answers
100k views

In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?

I need to test sub-domains on my localhost. How can I effectively have this result of adding *.localhost.com to my /etc/hosts/ file? If it's not possible, how do I work around this problem? I need ...
0
votes
0answers
15 views

Control WIN from Unix

I'm struggling right with taking control of my Windows7 VM, from a Unix VM. Let me explain.. I need to copy some resources from UNIX to WIN. One of these is a bat script to launch. So, I want to ...
2
votes
0answers
35 views

ssh -t -t sudo displays back my password

My problem is about executing sudo over SSH. I have tried various things, but non works. Here is my script: ssh my-host /bin/bash << EOF # some commands... sudo -u my-user -s -- << EOFF ...
0
votes
1answer
55 views

Check number of connections to webserver port 80 AND 443

As the title says how would one check the number of open connections to a webserver on port 80 and 443? I'm currently using this oneliner to get the number of open connections per ipaddress from port ...
0
votes
0answers
29 views

wget FTP directories with more than 10k folders

I have an issue trying to move servers. I have a couple of folders with 300k subdirectories and wget will only copy the first 10000 (the same number that Filezilla is capable of showing). Splitting ...
0
votes
0answers
46 views

Understanding CPU load vs CPU Time/Percentage

Been reading similar threads, seem to have grasp the idea but can't really put it into practical usage. Can I confirm on the following understanding q1) CPU time - CPU time spent in execution for a ...
0
votes
4answers
3k views

How to kill processes on a remote *nix machine

I would like to issue a kill command across many *nix machines. I'm attempting to do something like this: rsh <remotemachine> ps -ef | grep <somepattern> | awk '{print $2}' | xargs n1 -t ...
8
votes
8answers
15k views

what is the difference between linux and solaris OS? [closed]

What is the basic difference between Linux and Solaris? As both the OS are derived from UNIX so where lies the difference between Linux and Solaris? Are they because of creation by different ...
8
votes
4answers
10k views

How big (in bits) is a Unix UID?

I understand that unix user IDs (UIDs) are usually 16 or 32 bit unsigned integers but how can I find out for any given system (in a shell)?
1
vote
1answer
26 views

Why is my awk sub command failing?

When I run df -hl | grep '/dev/disk1' | awk '{sub(/%/, \"\");print $5}' I'm getting the following error: awk: syntax error at source line 1 context is {sub(/%/, >>> \ <<< "\...
0
votes
0answers
34 views

dentunusd and inode-nr values growing

One of my linux server experienced Out of system memory and had to restart. When I checked sar -v , I have seen a gradual increase in dentunusd and inode-nr values over a period of time. The values ...
194
votes
5answers
76k views

What is the difference between double and single square brackets in bash?

I just wondered what exactly the difference between [[ $STRING != foo ]] and [ $STRING != foo ] is, apart from that the latter is posix-compliant, found in sh and the former is an extension ...
12
votes
4answers
47k views

Move files to another directory which are older than a date

I am looking for a solution to move files that are year older from today. My log partition is getting full, but I can not remove them. They are needed for a long long time. Anyway one solution I came ...
-1
votes
1answer
94 views

Removing 1 line of code from all php files

I can see same code under all php files. Starting from <?php $rfghoh = '*f%)sfxpmpusut)tpqssu6 And end $rfghoh=$yuoopi-1; ?> I am just looking for script using which only first line of ...
0
votes
1answer
48 views

Changing /etc/passwd in SSH User

I've got an Amazon EC2 instance running. It's an Ubuntu 14.04. I connect using Putty SSH. I use the key/certificates I got when I created the instance to authenticate my connection. This is all done ...
1
vote
3answers
1k views

Linux's /etc/init.d - symlink, hard link, or actual file?

I have a Debian and an RPM package that requires a start/stop script to be added to the /etc/init.d directory. Recently, I was informed by a remote developer that "those in the know" know that "best ...
43
votes
6answers
15k views

Meaning of directories on Unix and Unix like systems

I've been using Linux for a couple of years now but I still haven't figured out what the origin or meaning of some the directory names are on Unix and Unix like systems. E.g. what does etc stand for ...
1
vote
2answers
141 views

Sources/replacements for idled?

In the good old days there used to be a Unix program called "idled" that would log out idle users after warning them. It was really configurable and generally did the right thing. Unfortunately it's ...
0
votes
2answers
39 views

SERVERFAIL error while doing nslookup on server itself. FreeBSD

I am using FreeBSD to setup a DNS server. I have install BIND and setup everything in resolv.conf and named.conf file. This is the ip address of my DNS server 192.168.10.100. in resolv.conf I added ...
11
votes
2answers
10k views

How do I print contents of at jobs?

I have a Debian box with some jobs scheduled using at. I know I can list the jobs with their times using atq, but is there any way to print out their contents, apart from peeking into /var/spool/cron/...
0
votes
4answers
783 views

best opensource firewall

We implemented Untangle opensource firewall on our network and interested to know various other firewalls with GUI interface. Can someone suggest which are the best opensource firewall implemented. I ...
1
vote
0answers
101 views

Kernel fails to assign memory in any Linux Distro

I have a motherboard: X11SBA-LN4F/F. After install CentOS, i have error in log: May 2 21:47:48 ll-226 kernel: pci 0000:04:04.0: BAR 14: failed to assign [mem size 0x00200000] May 2 21:47:48 ll-226 ...
0
votes
0answers
10 views

Setting samba along with quota

We are trying to project quota for folder share managed by samba. We are using following permission for folder we want to share, User:nobody Group:perProjectGroup Mode drwxrwsr-x Please note ...